Page 1 of 1
Yet another question about Tiles (Dynamic ones at that!)
Posted:
Wed Jul 25, 2007 9:23 am
by Techdojo
I'm creating a little puzzle game and I want to fill the screen with a tiled actor and then let the player change the individual tile images when they click on them with the mouse.
I was going to have a 2D array represent the puzzle data and have the tiles represent the current state of the puzzle.
Is this possible - if so can some one give me some clues ???
Thanks in advance
Jon...
Posted:
Wed Jul 25, 2007 9:37 am
by DilloDude
You cannot dynamically change tiles
You have to make each tile a separate actor, or if the game setup allows it, use a text actor.
Posted:
Wed Jul 25, 2007 10:37 am
by Techdojo
That really sucks, looks like the only way I'll be able to implement this is using the draw_from method that I'm currently struggling with (see my other post in the advanced topics section)...
GE could really do with a decent SIMPLE tilemap engine...
Jon...
Posted:
Wed Jul 25, 2007 12:46 pm
by DilloDude
Using separate clones for tiles may be your best solution. If you only have one screen full of tiles, it chouldn't matter much. I have done a tile-based puzzle game before, with separate clones, and it seemed to work all right. This also gives you the benefit of have events separately on the tiles. If you just want to display an array of locations, a text actor is quite feasible. Just be careful: a text actor can only have a maximum of 255 characters, so if the number of tiles (plus the newline characters) is going to be more than that you may need to use a few different text actors (ie have tiles.0 display the top half of the array and tiles.1 the bottom half.)
Posted:
Wed Jul 25, 2007 1:39 pm
by Techdojo
I saw an example a while back where somebody created a health bar using a text actor and a custom font image.
I think I might try that and see if it works any better (or even if it works at all!)
Jon...
Posted:
Thu Jul 26, 2007 3:47 am
by DilloDude
That method can work well. It really depends on the result you want. IF you have problems, just post them here (or in another topic).
Posted:
Thu Jul 26, 2007 8:46 am
by Techdojo
I had a quick hack at the text actor method and it seemed to work, however I had some difficulties in trying to get the actors to change their display when I made changes to the text field in the Actor structure...
I know this will work and I'm sure it's just down to my inexperience with the GE system, I'm going to have another look for the health bar example and see if I can see what I'm doing wrong (if not I'll post a GED and see who can play spot the noob first).
Jon...