The Daily Click ::. Forums ::. Klik Coding Help ::. My char doesn't jump right...
 

Post Reply  Post Oekaki 
 

Posted By Message

Joshua M.



Registered
  01/06/2004
Points
  1999
25th November, 2004 at 07:03:34 -

Tool: TGF

I'm making a little ninja game, in which you must destroy some enemies and survive some hazards. And especially in the hazard parts the jumping is crucial, but my character doesn't always jump the same hight. Sometimes he makes weak jumps, and sometimes big jumps. This sometimes makes it impossible to get across a hazard without being hit once or twice, and some platforms aren't reachable that way.

Code:

*Every 0.10s
*{Foot} is not overlapping background obstacle
-Add 1 to Value A {Player}

*{Foot} is overlapping background obstacle
-Set Value A to 0 {Player}
-Start loop #0 999 times << fastloop

*Loop Trigger #0
*{Foot} is overlapping background obstacle
Move the player and most of the colliders up 1 pixel (I was too lazy to type it all)

*Loop Trigger #0
*{Foot} is not overlapping background obstacle
-Stop Loop #0

*Upon pressing {SHIFT}
*{Foot 2} is overlapping background obstacle
-Set Value A to -5 {Player}
-Play sound Jump01.wav

And no, I won't make it less than -5, because then, if the player makes a good jump, the game would be much too easy.

HeLP!@!

 

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
25th November, 2004 at 13:18:54 -

Don't use the Every events, or they will vary the height of the jump depending on when you press the jump button. Either use a counter or another alterable value to count down while the player is in the air.

If you had MMF it would be easier to use decimal precision, and would eliminate the need for time delay. But you don't, so that more awkward way is necessary.

 
n/a

Joshua M.



Registered
  01/06/2004
Points
  1999
26th November, 2004 at 09:51:31 -

Well I've just added these two events:

*When {foot} is not overlapping a background object
-Add 1 to Jumper << counter

*When Jumper is or is greater than 6
-set counter to 0
-add 1 to value A {Player}

but the jumping still varies. Very strange.

 
   

Post Reply



 



Advertisement

Worth A Click