The Daily Click ::. Forums ::. Klik Coding Help ::. Jumping with loops
 

Post Reply  Post Oekaki 
 

Posted By Message

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
13th March, 2008 at 16:58:36 -

Okay soo...! ive made a custom platform engine a million times, but the proble, with all of them is that ive made them in TGF and not MMF but not i have MMF and ive statred using loops and im making a platform game, and right now in the engine i have the movement, BUT when i try to make pixel perfext jumping with loops, it never seems to work right.. help please

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
13th March, 2008 at 18:33:24 -

Phizzy showed me a good way to do pixel perfect collisions with jumps.

(Im using a counter called JUMP here k?)

if JUMP is different to 0 = run loop1 (Abs(value( "JUMP" )) times (so it runs 5 times if the counter is 5 or 10 if the counter is -10)

if JUMP is lower than 0 + floor detector is not overlapping a backdrop = move player +1 and move all detectors +1 too

if JUMP is greater than 0 + ceiling detector is not overlapping a backdrop = move player -1 and move all detectors -1 too


*and you might need to make an event that sets the JUMP counter to 0 when it is overlapping the floor too.

that should deal with collisions but wont do anything by itself, actually making the player jump requires more events.

 
.

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
13th March, 2008 at 18:55:49 -

ive made events that make the player jump, its just the coming back part that got me.. he always went like 2 pixels into the floor, which i diddnt want.. even if i put

-always
+bottom detector overlap floor
-set y position (y position+yposition -1)


it made it look kinda crappy

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )

-MacAdaM-

Megaman Fosho

Registered
  12/02/2008
Points
  560
13th March, 2008 at 19:12:26 -

(double post)



anyway thanks andy, that helped a lot...

 
Your just jealous that you're not as awesome as me.
(And my megaman avatar )
   

Post Reply



 



Advertisement

Worth A Click