Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - narabuster

Pages: [1]
1
Axe / Need help with Jumping
« on: September 27, 2014, 11:28:00 am »
I've been recently programming using Axe, and I have made myself a few programs that mostly involve small little picture animations. Not too long ago, I wanted to start my own side-scrolling platformer. I have been using previous topics and videos about making a line border and everything, and I made a simple moving engine. The only problem is jumping. I made what looked like a jump engine, but the problem is that its... static.

Maybe my code from the program source can give some insight:


Code: [Select]
.PLATFORM
...
X X value
Y y value
...
40-> X
5-> Y
ClrHome
[FF99BDFFFFBD99FF]-> Pic1
Repeat getKey (15)
ClrDraw
Pt-On (X, Y, Pic1)
Line (0,62,95,62)
Line (0,0,0,62)
DispGraph
If getKey (1)
Y+1-> Y
If Y> 54
54-> Y
End
End
If getKey (4)
Y-1-> Y
40-> Y
If Y <40
Y+1-> Y
End
End
If getKey (2)
X-1-> X
If X <0
1-> X
End
End
If getKey (3)
X+1-> X
End
If Y <54
Y+1-> Y
End
End
*The general layout is based on Scout greyscale tutorial and from an author of an AXE Parser video.

When I compile and run the program, the movement and the simple gravity engine work fine, but my jumping seems to be erratic. I was hoping for a fluid jump and the sprite going back down even if I held down the jump key, but instead, the sprite stays up as long as I hold the jump key and the sprite doesn't show its animation for going up to the bound of 40 that I gave to the Y var.

I've read other topics on the issues of jumping, but they don't seem to help me. An explanation with a fix/optimization code is what I need, because for now, I'm kinda stuck. :(        Any help would be appreciated.

Pages: [1]