-Dark Martin- The dark is most certainly not your friend
Registered 05/06/2008
Points 21
15th August, 2008 at 12:18:26 -
In my project DR there will be monsters in the game and they will appear in multiple rooms of the game.
In that game say the player walks into a room, there are 4 monsters, he kills only 2 of em then leaves the room (Frame) then re-enters it, now of course logically there should still be only 2.
How i would do this is have a global array and each coordinate of the array will be dedicated to a room in the game that will have monsters in it, If a number are killed the array is saved and stored, and of course re-entering the room would mean 2 would still be there.
BUT what i want to know if there is an easier way?
If its complicated i am more than willing to learn.
If your rooms are quite small, you could have them all on one frame and use some fancy scrolling so it looks as if it's multiple frames (a bit like zelda scrolling)
But if you want to save that information when you quit the game/leave the frame or you have large rooms that might be a problem.. I guess the array is a logical choice for this, I can't think of a better way right now.
n/a
-Dark Martin- The dark is most certainly not your friend
Registered 05/06/2008
Points 21
15th August, 2008 at 12:24:03 -
Damn that was replied to fast.O_O
But yeah i want them to be there if he quits and then returns to the game.
I would go with klikmaster's idea. Just use one big frame and add a zelda like scrolling mechanism. There is an easy way for making such a scroller. I think I have a code like that with 2 events or something laying around somewhere. I can find it if you want it.
I don't know how your game is structured, but this usually is the most logical choice.
Yeah, the one big frame idea sounds the easiest since you wont have to actually code anything to make it remember the baddies.
But you might want to add a few things to make sure they stop when you're elsewhere in the frame so you're not trying to have too much going on at once.
oh well hell. just use an array and make it global. and store values for each enemy like "killed" or "alive" ya know? and on the start of the frame if its "alive" then create the appropriate enemy.
it might be a bit of extra work if you have a lot of enemies but its better if you cant restructure your engine for zelda like scrolling.
n/a
-Dark Martin- The dark is most certainly not your friend