TmEE co.(TM) wrote:That game demo looks nice. I think the jumping bug is some stupid Bxx error.... my particle stuff did all kinds of weirdnesses until I found that one Bxx was wrong

But then again, I have no idea how your stuff is written so..... anyway good luck.
This is the only piece of code that has to do with jumping:
Code: Select all
;-------;
; Jump! ;
;-------;
cmpi.w #199, d6
bne.s RunPlayerCantJump
btst.l #ILBitButtonUp, d0
beq.s RunPlayerCantJump
moveq #-28, d2
RunPlayerCantJump:
;---------;
; Gravity ;
;---------;
move.w d2, d3
addq.w #1, d2
asr.w #4, d3
add.w d3, d6
cmpi.w #199, d6
blt.s RunPlayerOnAir
move.w #199, d6
RunPlayerOnAir:
D0 = joystick input (bit set = pressed)
D2 = gravity (positive = downwards)
D3 = unused at this point (so free for anything)
D6 = Y coordinate (floor at 199)
Seriously, what's wrong with it?

In C it would look as follows (converting right now, mind you

):
Code: Select all
if (y == 199 && (input & BUTTON_UP))
gravity = -28;
y += gravity++ >> 4;
if (y >= 199)
y = 199;
Yes, I know that dividing by 16 is way too much, normally I divide by 4. I'm using that value for testing

Also don't ask me why am I using >= rather than >, later this will help me setting a player state properly.
TmEE co.(TM) wrote:I'll test it on my MDs ASAP.
Thanks!
