I have been working on a Puzzle game,(basically its Like Portal in 2d). the main Ideas is going to be to get a Box on a button so that you can get out the door. But I ran into a design problem with the Tile engine. How its works is it calls entities from an array in the Tile file so as to get there id's and then compairs them to a .txt file to see were they go.

I designed the Door and Button to be Tiles and then I would use another Tile called wireTile. basically it calls every tile of one sort through the same class, so I cant have a perminiate x, or y to any Tile. Do you know anyway to give each tile a more permintate position?

I'm not sure that I entirely understand your question but what I *think* you are asking is how can you give things positions if they are moving around? (Notice how me not understanding you doesn't stop me from answering ). Can you explain your problem in a little more detail.

1. You have x,y coordinates but those look to be for rendering. Why not add the x,y coordinates of the level to each tile. So your set tile looks like:

Ok ley me try and explain this a little better. The problem I was having is the wiretile in the map is used like 20 time so far but it calls all 20 of them through one class. I want it make copy's of every wiretile so that I can have perminate x and y cords for each tile instead of them swarming through one class per tile. So basically my code to the wire was plans to be something like if(level.getTile(x-1,y).powered) powered = true; the x and the y would be the tiles position so this would look at the tile to your right to see if it's powered and if it is it would turn on too.

It helps but can you show your code for WireTile?. And can you post the snippet of code where it is calling it "20 times through one class"? I am confused about some things in your code. It may not be relevant but it might be. Why do you have these static members in Tile?

Just some quic clarifacations the static tile list was there from my old tile referance system. But I am not compleatly sure the new one is good so I left the code laying around. As for the calling it 20 times that occors in the render method when it's getting the tile. The get tile method calls from a 2d array that was loaded from a txt file, basically what I ment was that I have 20 wiretile recorded to the array. And the tile updating inside the entity loop was amistake :p. sorry for all the extra guff in my code I am not the neatest programer.

So from what I gather I need to set the tile Pos. in the set tile method. I am not sure if this is what you mean or maybe you have something better in mind. Thank you for all the help.

basically to sum it up I want to make a instance of every tile that appears on the screen, because as of now it is making one instance per tile type so the x and y cores for any given tile are the last occurrence of that tile in the map. so what I want to do is every time a tile is set at the start it makes a new version of it.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org