Yet another question about Tiles (Dynamic ones at that!)

Talk about making games.

Yet another question about Tiles (Dynamic ones at that!)

Postby Techdojo » Wed Jul 25, 2007 9:23 am

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...
Techdojo
 
Posts: 16
Joined: Mon Oct 16, 2006 11:56 am
Score: 0 Give a positive score

Postby DilloDude » Wed Jul 25, 2007 9:37 am

You cannot dynamically change tiles :cry: You have to make each tile a separate actor, or if the game setup allows it, use a text actor.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Techdojo » Wed Jul 25, 2007 10:37 am

:cry: 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...
Techdojo
 
Posts: 16
Joined: Mon Oct 16, 2006 11:56 am
Score: 0 Give a positive score

Postby DilloDude » Wed Jul 25, 2007 12:46 pm

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.)
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Techdojo » Wed Jul 25, 2007 1:39 pm

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...
Techdojo
 
Posts: 16
Joined: Mon Oct 16, 2006 11:56 am
Score: 0 Give a positive score

Postby DilloDude » Thu Jul 26, 2007 3:47 am

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).
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Techdojo » Thu Jul 26, 2007 8:46 am

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...
Techdojo
 
Posts: 16
Joined: Mon Oct 16, 2006 11:56 am
Score: 0 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron