(I changed the code since I've been working on it)
Help! I'm trying to make a 2D scrolling game and have things under control for the most part except I don't know how to make a sprite jump. Also, when I'm able to jump, how do you make a mario-type attack were the enemies are destroyed only when you hit the top of them.
Here's my code:
sync on
sync rate 40
a=4
b=100
c=500
d=345
x=0
y=0
load sound "world1.wav",2
load image "level1w1.bmp",1
load image "squid3.bmp",2
load image "robosquid.bmp",3
load image "healthbar.bmp",5
load image "squidhealth.bmp",4
load image "gameover.bmp",6
Sprite 1,x,y,1
Size Sprite 1,2500,500
Set Sprite 1,1,1
Sprite 3,500,345,3
Size Sprite 3,100,110
Set Sprite 3,1,1
Sprite 2,50,345,2
Size Sprite 2,100,110
Set Sprite 2,1,1
Sprite 4,0,0,4
Size Sprite 4,80,90
Set Sprite 4,1,1
Sprite 5,75,27,5
Size Sprite 5,b,30
Set Sprite 5,1,1
SET CURSOR 560,2
print "Lives="
SET CURSOR 610,2
print a
play sound 2
loop sound 2
Do
Sprite 2,50,d,2
Size Sprite 2,100,110
Set Sprite 2,1,1
If x>0:x=0:endif
If b=0
Sprite 6,270,190,6
Size Sprite 6,100,30
Set Sprite 6,1,1
stop sound 2
Sleep 3000
GOTO Label2
ENDIF
if sprite hit(2,3) > 0
dec b,10
Sprite 5,75,27,5
Size Sprite 5,b,30
Set Sprite 5,1,1
ENDIF
if sprite y(2) > sprite y(3)
hide sprite 3
ENDIF
if upkey()=1 then d=300
if downkey()=1 then y=y+0
if leftkey()=1 then x=x+3
if leftkey()=1 then c=c+3
if rightkey()=1 then x=x-3
if rightkey()=1 then c=c-3
Sprite 1,x,y,1
Size Sprite 1,2500,500
Set Sprite 1,1,1
Sprite 3,c,345,3
Size Sprite 3,100,110
Set Sprite 3,1,1
sync
loop
Rook Takes Pawn Productions... "Now if only we could get that accursed bishop!"