i was just about to say do you want to see the code haha i was going to edit the post but forgot
and it is working its just kinda frusterating as i can't put anything after the movement code.
Gosub set_up_screen
Gosub Images
Gosub Variables
do
Set Cursor 200,0
Print spriteY#
Set cursor 200,20
if start=0
endif
Gosub SetupSprites
Gosub Move_screen
Gosub Collision
Gosub Gravity
Gosub Movement
GCount=Gcount+1
If gcount>10
Gcount=0
GNum#=Gnum#+1
If Gnum#>21
Gnum#=17
endif
endif
if spacekey()
spriteX#=50
spriteY#=400
endif
Start=0
sync
loop
Images:
Load Image "anim.bmp",10
Paste image 10,0,0
Get image 1,0,0,30,50
Get image 2,30,0,60,100
Get image 15,60,0,90,150
paste image 2,200,200
cls
Box 0,0,40,10
Get image 14,0,0,10,10
Box 0,0,15,30
Get image 15,0,0,15,30
cls
Get image 16,0,0,20,20
dim Water(3)
Load image "Ground/Ground.bmp",17
Load image "Ground/Ground 2.bmp",18
Load image "Ground/Ground 3.bmp",19
Load image "Ground/Ground 4.bmp",20
Load image "Ground/Ground 5.bmp",21
load image "ground/ground 6.bmp",22
return
Variables:
Sprite#=1
Ground#=3
GroundX#=0
GroundY#=-150
Gnum#=17
Pipe#=4
Cold#=8
ColR#=9
COlL#=10
PipeX#=200
MoveL#=5
MoveR#=5
start=1
Left=1
Dim Way(2)
Way(1)=455
Way(2)=80
Water(1)=GroundX#+300
Water(2)=GroundX#+450
Water(3)=170
SpriteX#=50
spriteY#=400
return
Set_Up_Screen:
sync on
sync rate 60
Backdrop on
Color backdrop RGB(0,0,0)
return
setupsprites:
Sprite sprite#,spriteX#,SpriteY#,Sprite#
Sprite Ground#,GroundX#,GroundY#,Gnum#
Sprite ColD#,SpriteX#+12,SpriteY#+40,14
Sprite ColL#,SpriteX#,SpriteY#+5,15
Sprite COlR#,SpriteX#+20,SpriteY#+5,15
Sprite 16,350,295,16
Print sprite collision(sprite#,16)
For X=8 to 10
hide sprite X
next X
return
Move_Screen:
If SpriteX#>Screen Width()-200 and rightkey()
GroundX#=GroundX#-7
PipeX#=PipeX#-7
SpriteX#=Screen width()-201
lock=1
water(1)=Water(1)-7
Water(2)=Water(2)-7
else
if lock<2
Lock=0
MoveR#=5
endif
endif
If lock=1
MoveR#=0
endif
IF SpriteX#<200 and leftkey() and GroundX#<-1
GroundX#=GroundX#+7
PipeX#=PipeX#+7
SpriteX#=201
lock=2
water(1)=Water(1)-7
Water(2)=Water(2)-7
else
IF lock>1
Lock=0
MoveL#=5
endif
endif
If lock=2
MoveL#=0
endif
return
Collision:
If sprite COllision(Coll#,Ground#) and Falling#=0
MoveL#=0
endif
If sprite Collision(COlr#,Ground#) and falling#=0
MoveR#=0
endif
Return
Gravity:
If Sprite collision(ColD#,Ground#)=0
Grav#=Grav#+0.5
Falling=1
jump=0
endif
If grav#>6
Grav#=5
Endif
If sprite collision(ColL#,Ground#)=0
moveL#=5
endif
If sprite collision(ColR#,Ground#)=0
MoveR#=5
endif
If upkey() and Falling=0
IF stop=0
Oldy#=SpriteY#
Jump=1
Stop=1
endif
endif
If Upkey()=0 then Stop=0
If Jump=1 and falling=0
Grav#=0
Grav#=-12
Move#=3
endif
If falling=1
Move#=3
endif
If Grav#>-1
Jump=0
endif
If jump=1 or falling=1
GroundY#=GroundY#+grav#*-1
endif
If sprite collision(ColD#,0)
Falling=0
endif
return
Movement:
If Rightkey() or Leftkey()
Hold#=Hold#+1
endif
if rightkey()=1
iF lstop=0
SpriteX#=SpriteX#+MoveR#
endif
If Hold#=10
Delete sprite Sprite#
Sprite#=Sprite#+1
HOld#=0
endif
If sprite#>2
Sprite#=1
endif
endif
If leftkey()=1
if rstop=0
SpriteX#=SpriteX#-MoveL#
endif
If hold#=10
delete Sprite Sprite#
Sprite#=SPrite#+1
Hold#=0
endif
If Sprite#>2
Sprite#=1
endif
endif
return
there you go.