Level editor event system, how to translate event to game action
Posted
by
Martino Wullems
on Game Development
See other posts from Game Development
or by Martino Wullems
Published on 2011-03-13T21:08:20Z
Indexed on
2011/03/14
0:18 UTC
Read the original article
Hit count: 434
Hello,
I've been busy trying to create a level editor for a tile based game i'm working on. It's all going pretty fine, the only thing i'm having trouble with is creating a simple event system.
Let's say the player steps on a particulair tile that had the action "teleport" assigned to it in the editor. The teleport string is saved in the tile object as a variable. When creating the tilegrid an actionmanager class scans the action variable and assigns actions to the variable.
public static class ActionManager
{
public static function ParseTileAction(tile:Tile) {
switch(tile.action) {
case "TELEPORT":
//assign action here
break;
}
}
}
Now this is an collision event, so I guess I should also provide an object to colide with the tile. But what if it would have to count for collision with all objects in the world? Also, checking for collisions in the actionmanager class doesn't seem very efficient.
Am I even on the right track here? I'm new to game design so I could be completly off track. Any tips on how handeling and creating events using an editor is usually done would be great. The main problem i'm having is the
Thanks in advance.
© Game Development or respective owner