I would like to request help for my game. This is the code I currently use.
REM Project: ******* ****** ****
REM Created: 19/06/2008 17:10:27
REM
REM ***** Main Source File *****
REM
flush video memory
sync on : sync rate 30
backdrop on
set display mode 1024,768,32
set window size 1024,768
#constant backgroundimage 11
#constant backgroundimage2 11
set image colorkey 255, 0, 255
load image "databackground.bmp",backgroundimage,1
load image "databackground.bmp",backgroundimage2,1
load image "dataplayersoramovement.bmp", 1
create animated sprite 1, "dataplayersoramovement.bmp", 9, 3, 1
sprite 1, 150, 150, 1
Do
REM VARIABLE SET UP
CurrentX = sprite X(1)
CurrentY = sprite Y(1)
REM JUMP
if UpKey()=1
endif
movecase=0
if LeftKey()=1
movecase = 1
endif
if RightKey()=1
movecase = 3
endif
if LeftKey()=0 and RightKey()=0
if playerdir = 0
movecase = 2
else
movecase = 4
endif
endif
REM MOVE CASES
select movecase
case 0
endcase
case 1
REM MOVE LEFT
play sprite 1, 2, 9, 50
currentX = currentX-4
playerdir = 0
endcase
case 2
play sprite 1, 1, 1, 1
endcase
case 3
REM MOVE RIGHT
play sprite 1, 11, 18, 50
currentX = currentX+4
playerdir = 1
endcase
case 4
play sprite 1, 10, 10, 1
endcase
endselect
REM ATTACK
if ShiftKey()=1
endif
paste image backgroundimage,backgroundx,currenty-500
paste image backgroundimage,-1024+backgroundx,currenty-500
paste image backgroundimage,-1024+backgroundx,currenty-1524
paste image backgroundimage,backgroundx,currenty-1524
backgroundx=backgroundx+1
if backgroundx>1024 then backgroundx=0
sprite 1, CurrentX, CurrentY, 1
sync
loop
Now the problem is that fact that if I press the right arrow button the character goes right with perfect animations and eveything, but if I press left the character just stands there aimlessly.
Download media here
I would like to learn how to code:
3rd person in the style of MGS, 1st/3rd person interchangeable modes in the style of MGS2