Sorry haven't replied, I've been preoccupied with jobs and scholarships
Anyway, by playing with the code, I think I made a breakthrough somewhat. Somehow by changing something I was able to get the gravity working, at the cost of the collision detection(its a little glitchy) here's a screenshot
As you can see, its moving in a parabola pattern, meaning it is working like gravity should. I'm gonna try and compare the changed code with older versions and see what up.
just in case anyone was wondering here is the changed code in its entirety, both x and y collision codes
Code:
I gonna do something first and then try and knock this out once and for all TODAY.[/code]
Anyway, by playing with the code, I think I made a breakthrough somewhat. Somehow by changing something I was able to get the gravity working, at the cost of the collision detection(its a little glitchy) here's a screenshot
As you can see, its moving in a parabola pattern, meaning it is working like gravity should. I'm gonna try and compare the changed code with older versions and see what up.
just in case anyone was wondering here is the changed code in its entirety, both x and y collision codes
Code:
Collisions:
ld a,(YPOS)
ld hl,Velocity+1
add a,(hl)
ld hl,XPOS
ld e,(hl)
push ix
call FindTile
call CheckClearTile
jr c,SkipYCollision
ld hl,$0000
ld (844Bh),hl
B_CALL(_DispHL)
ld a,(XPOS)
ld a,(YPOS)
and %11111000
ld hl,Velocity+1
bit 7,(hl)
jr z,skipYadd8
add a,8
skipYadd8:
ld (YPOS),a
xor a
ld (Velocity+1),a
SkipYCollision:
pop ix
ld a,(XPOS)
ld hl,Velocity
add a,(hl)
ld (XPOS),a
ld e,a
ld a,(YPOS)
dec a
call FindTile
call CheckClearTile
jr c,SkipXCollision
and %11111000
ld hl,Velocity
bit 7,(hl)
jr z,skipXadd8
add a,8
skipXadd8:
ld (XPOS),a
xor a
ld (Velocity),a
SkipXCollision:
ret
I gonna do something first and then try and knock this out once and for all TODAY.[/code]