I made a platform game. WHen I run the game, I noticed that I can walk my player right out of the frame and into nowhere! So I made an event reading: "So-and-So" (the Player Character) leaves play area= "So-and-So"-movement-bounce.
This worked, except for one thing. If my character jumped diagonly at the edge of the frame, he could still leave the frame? How is this, and how can I fix it?
you could put a backdrop wall around the outside of the play area
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G
that's annoying, it didn't work for me before... but that's because backgrounds are ignored when they're more than about 16 pixels away. So I was partially correct ;P
Easiest solution:
Make a fake game border thing. Just put some long pure black wall thingies at the side and set them as backdrops.
If you don't want your screen to see them (i.e. you use a full-screen res), just add an extra few events that don't let the screen go less or more than a certain X/Y amount.
It adds 4 new objects to your game and about 4 more events, but it's worth it .
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Easiester solution: make 4 small active objects (32*32 or so) and put each out of the playfield (turn Destroy if too far from playfield off). Add an event:
+Always
-Set X of top/bottom object to X of player
-Set Y of left/right object to Y of player
And of course the collision events. This saves some memory and you don't have to resize your objects
Just put obstacle backdrops at the edges of the frame and in the properties of the frame under "frame" in the properties tree tick "handle background collisions even out of window". That works, trust me.
Or if you dont want to mess up the frame editor with lots of backdrops just do the thing suggested before:
1.
[X position of [player]] < 0:
* set [X position of [player]] to 0
2.
[X position of [player]] > Frame Width:
* set [X position of [player]] to Frame Width
3.
[Y position of [player]] > Frame Height:
* set [Y position of [player]] to Frame Height