Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Nodes coordinates changing on their own?

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So I'm working on a game which has to mimic a space ship with aliens and humans on board and the humans have to escape from the aliens and the aliens have to try to eat the humans. Aliens and humans players get to move around the space ship my means of a piece with their player numbers written on it!
The space ship is made up of cells, called sectors, which I did build with a hexagon, every sector has a name and a coordinate and if a player moves into another cell/sector it's present cell/sector should be updated.
For a reason or so it seems there is a rearrangement of the coordinates of the cells/sectors after a player moves...this error is soo difficult to explain so I did create a miniature project of the original one with every minimal feature necessary to mimic perfectly the original one and I'm going to posts all the classes here so that any one who wants to help me solve the situation can can load it and build it and try it and see the problem I'm talking about...unfortunately I think this is the only way I can really get help solving the problem
so here are the classes..
the problem/error I'm having is made clear on line 104 in the piece class where there is some printing to console to make it clear that the coordinates/nodes id being printed to the console is very different from that being seen in the gui /screen

//MAIN


//GAME CLASS


//SHIP ABSTRACT CLASS


//FERMI spaceship class


PLAYER CLASS


PIECE CLASS


enum PLAYERCHARACTER


SECTOR CLASS


enum SECTORTYPE


 
mike Vigor
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really do think unless one loads all the classes in an ide and actually runs this code, one may not understand the problem/error i'm talking about by just looking with his/her eyes..
so please just do that thanks
 
Sheriff
Posts: 7113
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I pasted the classes into an IDE and ran the Main class, but I'm not sure what I'm seeing or what I'm supposed to see.  I'm assuming P1 and P2 are player one and two, and I can move them by dragging them to adjacent sectors, but I don't know what the problem is.  Sometimes  the piece moves where I drag it and sometime not, but I don't see any pattern to it.

I think you need to explain what the desired output is and what the problem is.
 
mike Vigor
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Knute Snortum wrote:I pasted the classes into an IDE and ran the Main class, but I'm not sure what I'm seeing or what I'm supposed to see.  I'm assuming P1 and P2 are player one and two, and I can move them by dragging them to adjacent sectors, but I don't know what the problem is.  Sometimes  the piece moves where I drag it and sometime not, but I don't see any pattern to it.

I think you need to explain what the desired output is and what the problem is.



Thank you for trying to help...if you watch the pieces, they should always be in a sector, so in the example you have in the ide, moving a piece into a sector, that sector Id or sector name should be printed on the console, but if you look on the console, the sector name being printed on the console is different from the sector in which the piece finds itself and every sector has its name written on it in the gui so you can see with your eyes, AND INFACT, you notice sometimes the pieces dont move into the sectors, and sometimes the pieces move into empty spaces, ALL THESE should not be happening...and I'm asking if someone can help me solve this...
 
Knute Snortum
Sheriff
Posts: 7113
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Fermi is a Ship, and Ship has static xCoord and yCoord.  Why are these two coordinates static?
 
reply
    Bookmark Topic Watch Topic
  • New Topic