HI it's my first post here and I'm pretty new to Dark Basic but I find it's awesome I just need to practice I guess. Ok I need help on something I got this little guy who can move from
http://omargames.ifrance.com/omargames/
Go there and click on downloads and then get PERSONNE and PERSONNETEX zips
Oh and this is for db I'm not sure if it works for pro
I tried to make him jump using w which is keystate(17)
adding the following line to modify the position of the object
if keystate(17)=1 then y#=NEWYVALUE(5,a#,z#) : z#=NEWZVALUE(z#,a#,2) : stage=1
but instead of jumping when I press w the camera is following the guy when he walks sideways
here's the modified code
LOOP OBJECT 1,0,20 : SET OBJECT SPEED 1,10
rem Activate manual syncronization
SYNC ON
rem Begin loop
DO
rem Modify character angle based on left/right keys
stage=0
IF LEFTKEY()=1 THEN a#=a#-8.0
IF RIGHTKEY()=1 THEN a#=a#+8.0
a#=wrapvalue(a#)
rem Modify character position based on up/down keys
IF UPKEY()=1 THEN x#=NEWXVALUE(x#,a#,3) : z#=NEWZVALUE(z#,a#,3) : stage=1
IF DOWNKEY()=1 THEN x#=NEWXVALUE(x#,a#,-3) : z#=NEWZVALUE(z#,a#,-3) : stage=1
if keystate(17)=1 then y#=NEWYVALUE(5,a#,z#) : z#=NEWZVALUE(z#,a#,2) : stage=1
rem If character action changes
IF stage<>oldstage
IF stage=0
SET OBJECT FRAME 1,0.0
LOOP OBJECT 1,0,20
SET OBJECT SPEED 1,10
ENDIF
IF stage=1
SET OBJECT FRAME 1,105.0
LOOP OBJECT 1,105,125
SET OBJECT SPEED 1,40
ENDIF
oldstage=stage
ENDIF
rem Update character position and angle
POSITION OBJECT 1,x#,0.0,z#
YROTATE OBJECT 1,a#
if keystate(17)=1
yPos#=yPos#+40
endif
rem Refresh screen
SYNC
rem End loop
LOOP
Can someone please help? I have a hard time with variables