The Daily Click ::. Forums ::. Klik Coding Help ::. Major Problem with ALL platform games I make
 

Post Reply  Post Oekaki 
 

Posted By Message

Jim Joe Johnson



Registered
  28/03/2004
Points
  45
27th May, 2004 at 15:35:27 -

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?

 
"Nasty, tricksy Hobbitts!"

Kris

Possibly Insane

Registered
  17/05/2002
Points
  2017
27th May, 2004 at 15:37:41 -

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

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
27th May, 2004 at 15:41:13 -

MMF doesn't save backdrops outside of the area. You'll have to use these pseudoevents:

Player's position is greater than Frame Width
- set its position to Frame Width
Player's position is less than 0
- set its position to 0

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
28th May, 2004 at 15:45:59 -

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

http://sfgames.clicksplat.com/download/background.cca <-- example that shows this

 
n/a

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
28th May, 2004 at 21:47:19 -

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.

Image

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
29th May, 2004 at 09:04:18 -

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


Image Edited by the Author.

 
a/n

cake



Registered
  13/12/2002
Points
  1173
30th May, 2004 at 01:07:20 -

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

Image Edited by the Author.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click