What follows is the code im using for a fight game modified from a free souce used for 8 way movement in a 2D RPG, i have a feeeling i just need to step back to locate the problem but as we all know its hard for a person to look outside their own codeing, that why we have programingteams in the big companies, i'm hoping though that by looking at his DB (not pro) code the lot of you can tell me why i cant get any vertical movement, let alone one that responds on scankey, makes it a little difficult to jump or duck
Rem
Rem How to animate a 2D sprite on the screen under 8 axes
Rem
Rem Made by : Freddix
Rem Definition of the screen method.
set display mode 320,240,16
sync rate 60 : sync on
Rem One loads the picture or are stoqués all the 16 sprites
load image "images\sprites.bmp",1
Rem One creates the 16 organizations on 4 directions.
paste image 1,0,0
delete image 1
for boucle=1 to 16
get image boucle,posx,posy,posx+16,posy+32
posx=posx+17
next boucle
cls
rem Set player starting point
xpos=5
ypos=200
Rem Beginning buckle of game.
repeat
Remstart One stoque the 4 directions of the keyboard in 2 Low/High variables and Left/Upright
cant move without this
remend
rem _vertical control vertical movement, can be removed for left to right only
_vertical=downkey()-upkey()
rem
_horizontal=rightkey()-leftkey()
remstart control verticle movement
Rem One sees if the player vertically moves itself.
if _vertical0
Rem One moves the sprite according to the direction High=-1 or low=+1
ypos=ypos+_vertical
Rem One defines which organization portion to use according to the direction
if _vertical=1 then _anim_type=0 else _anim_type=1
endif
remend end of vertical control
rem jump timer
Rem One sees if the player vertically moves itself.
time=timer()
if _vertical0
Rem One moves the sprite according to the direction High=-1 or low=+1
ypos=ypos+_vertical
Rem One defines which organization portion to use according to the direction
if _vertical=1 then _anim_type=0 else _anim_type=1
endif
repeat
time2=timer()
until time2-time=2000
if time2-time=2000 then ypos=200
Rem Idem for the horizontal movement.
if _horizontal0
xpos=xpos+_horizontal
remstart horizontal end of screen loop
IF xpos>320 THEN xpos=0
IF xpos300 THEN xpos=300
IF xpos240 THEN ypos=0
IF ypos0 or _horizontal0 then inc _animation
Rem If the organization sort of the number of picture (32/8=4images)
if _animation=32 then _animation=0
Rem One posts the sprite with the required picture of the organization requested and to the positions xpos,ypos
sprite 1,xpos,ypos,(_anim_type*4)+(_animation/8)+1
Rem Synchro
sync
Rem Curls so as the space bar is not préssée.
until spacekey()=1
Rem One obliterates the pictures create for the demo.
for boucle=1 to 16
delete image boucle
next boucle
end
Rem end of demo.