monsters leaving and re-entering a screen

Hy everyone !

I'm working on a simple 1 screen eat food, avoid monsters game and I have some problems with the food and monsters.
I can't keep them on the screen.

The idea is simple.
I want the monsters and food to start moving from the right side of the screen to the left side.
When they leave the screen or hit the player I want them to re-enter the screen from the right side.

With the NESmaker Monster animation info I can make them move on 1 screen in multiple directions and left and right.
But I can't make them re-enter the screen. The are stuck to the screen with an collision box OR they leave the screen and enter another screen even if I click on 1 screen game.

So I guess I have to add some scripts or is there another way ?
 
Hi,

I remember from watching the Zero to 8 Bit Hero tutorial videos. That Joe said, was when the player leaves a screen and enters a new screen. Everything from the previous screen gets deleted. To redraw the new screen for the player. Then Nesmaker redraws the graphics for the old room. Once the player re-enters that room.
You said you have a one screen room. With the food and monsters leaving the room. Instead of the player, so based on what Joe said on those videos. Everything outside the room. Gets deleted to save on memory for Nesmaker. This might be why your objects won't re-enter the room? I would first suggest to try setting all monsters and food to persistent. Like the player, so that these objects won't be deleted. Outside the room and see if they will re-enter the room by doing this? If you want this effect for your game? If not?
Then you may have to redesign your game. So that monsters and food can't leave the screen. By setting all the tiles. That run along the edge of the screen to the Solid attribute. By right clicking on a tile, left click on Modify Attribute and then left click on Solid. Then set all the monster and food tiles. To move in another direction when they hit these tiles. To keep them in the room and moving. Watch the tutorial video, when Joe creates the Sad Monster tile. (Zero to 8 Bit Hero tutorial videos/6. Monsters) To learn how to do this. So that the monsters stay in the room. I hope this helps. But for the moment, tiles leaving the screen and re-entering without the player. Is something, Nesmaker isn't designed to do. From what I have learn't so far about the program.
 

dale_coop

Moderator
Staff member
I am not sure you can do what you want to do, natively in nesmaker.
You want the monster and/or the game object to respawn at the right of your screen, each time it disapears (killed or left the screen)?

Maybe you could create a invisible object that spawns monsters and/or food objects... and place that spawner on the right of your screen.
This spawner would exectue a custom "spawn a monster/object" Action script, that would check how many monster/object on the screen before create a new one, if needed.
Something like that: http://nesmakers.com/viewtopic.php?f=35&t=1985
 
No problem, I am happy to help. Just take into consideration though. By making the monsters and food persistent. It is going to take up more memory. Used by Nesmaker for your game. Here is a suggestion, if you still want the effect. Of Monsters going in and out of screen on there own?

What I think is a better way of creating this effect. By using Nesmaker to it's strengths, is by doing this:
From what I have read so far. I assume you are making a maze game similar to Pac Man. So at the beginning of your game. You could have 1 screen maze. Where the monsters and food can't leave the screen. To teach the player what to do. But there is nothing stopping you in later levels. To break up your maze between 2 screens. That are next to each other, then during later levels. These could be between 4 screens or more. Which are also next to each other. In the shape of a square on the Overworld map. By doing this you are telling Nesmaker and laying down the framework. So the monsters and food know. How to move and interact with objects off screen without the player. By splitting up the screens. If the monsters and food. Don't move back into the original screen when you do this. From what we have learn't from Joe from the tutorials. Once the player does the same thing and leave the screen too and enters into the new screen. With the monsters and food. That will jump start everything in the new room again. If the monsters and food do get stuck for whatever reason. Try it and see what's better and see if this suggestion works or not. I think this suggestion should work. Better than setting the food and monsters to persistent alone.
 
Top Bottom