when i load up and run its not as smooth as i want it does anyone know why?
`/////////////////////////////////////////////////////////////////
`/////////////////////Set up the screen ressolution //////////////
`/////////////////////////////////////////////////////////////////
rem check for screen res
if check display mode(640,480,32)=1
set display mode 640,480,32
else
set display mode 640,480,16
endif
sync on
sync rate 0
color backdrop 0
hide mouse
`********************************************************************
`***************************Load in all the graphics*****************
`********************************************************************
load image "gfx\craft\craft4.bmp",1
load image "gfx\alien\alienship.bmp",2
load image "gfx\craft\greenlazer.bmp",4
load image "gfx\craft\yellowlazer.bmp",5
load image "gfx\exp\exp1.bmp",6
load image "gfx\exp\exp2.bmp",7
load image "gfx\exp\exp3.bmp",8
load image "gfx\exp\exp4.bmp",9
load image "gfx\exp\exp5.bmp",10
load image "gfx\exp\exp6.bmp",11
`**********images for level one**
load image "gfx\level1\f1.bmp",13
load image "gfx\level1\f2.bmp",14
load image "gfx\level1\f3.bmp",15
load image "gfx\level1\f4.bmp",17
load image "gfx\level1\f5.bmp",18
load image "gfx\level1\f6.bmp",19
load image "gfx\level1\f7.bmp",20
load image "gfx\level1\f8.bmp",21
load image "gfx\level1\f9.bmp",22
load image "gfx\level1\f10.bmp",23
load image "gfx\level1\f11.bmp",24
load image "gfx\level1\f12.bmp",25
load image "gfx\level1\f13.bmp",26
load image "gfx\level1\f14.bmp",27
load image "gfx\level1\f15.bmp",28
load image "gfx\level1\f16.bmp",29
load image "gfx\level1\f17.bmp",30
load image "gfx\level1\f18.bmp",31
load image "gfx\level1\f19.bmp",32
load image "gfx\level1\f20.bmp",33
load image "gfx\level1\f21.bmp",34
load image "gfx\level1\f22.bmp",35
load image "gfx\level1\f23.bmp",36
`**********images for level two***
load image "gfx\level2\f24.bmp",37
load image "gfx\level2\f25.bmp",38
load image "gfx\level2\f26.bmp",39
load image "gfx\level2\f27.bmp",40
load image "gfx\level2\f28.bmp",41
load image "gfx\level2\f29.bmp",42
load image "gfx\level2\f30.bmp",43
load image "gfx\level2\f31.bmp",44
load image "gfx\level2\f32.bmp",45
load image "gfx\level2\f33.bmp",46
load image "gfx\level2\f34.bmp",47
load image "gfx\level2\f35.bmp",48
load image "gfx\level2\f36.bmp",49
load image "gfx\level2\f37.bmp",50
load image "gfx\level2\f38.bmp",51
load image "gfx\level2\f39.bmp",52
load image "gfx\level2\f40.bmp",53
load image "gfx\level2\f41.bmp",54
load image "gfx\level2\f42.bmp",55
load image "gfx\level2\f43.bmp",56
load image "gfx\level2\f44.bmp",57
load image "gfx\level2\f45.bmp",58
load image "gfx\level2\f46.bmp",59
load image "gfx\level2\f47.bmp",60
load image "gfx\level2\f48.bmp",61
load image "gfx\level2\f49.bmp",62
load image "gfx\level2\f50.bmp",63
load image "gfx\level2\f51.bmp",64
load image "gfx\level2\f52.bmp",65
load image "gfx\level2\f53.bmp",66
`**********images for the screen**
load image "gfx\craft\score.bmp",198
load image "gfx\craft\life1.bmp",199
load image "gfx\screen\stars.bmp",200
load image "gfx\screen\title.bmp",201
load image "gfx\screen\Level_1_Mark.bmp",202
load image "gfx\screen\Level_2_Mark.bmp",203
load image "gfx\screen\Level_3_Mark.bmp",204
load image "gfx\screen\Level_Change.bmp",205
`********************************************************************
`***************************Load in all the Sounds*******************
`********************************************************************
LOAD SOUND "sounds\phaser03.wav",1
LOAD SOUND "sounds\boom2.wav",2
load music "sounds\space.wav",1
play music 1
`********************************************************************
`***************************Setup a 3D plain for stars***************
`********************************************************************
MAKE OBJECT PLAIN 4,600,56
ghost object on 4
POSITION OBJECT 4,0,-4,80
TEXTURE OBJECT 4,200
LOCK OBJECT ON 4
color backdrop rgb(0,0,0)
`********************************************************************
`***************************Variable List****************************
`********************************************************************
` Set the weapon fired
pf=0
` Score
score=0
` Lives
lives=3
` Spacseship co-ordinates
craftx=50
crafty=200
`
sbu=0
` Number of Explosions
noe=6:gs=0
`********************************************************************
`***************************Setup Walls******************************
`********************************************************************
`Here a Loop sets up the wall tiles so that they do not over lap when
`they are placed on screen.
`*************Setup the floor tiles
bs=10
x=-200
y=300
for t=1 to 199
read im
`*************First level floor
if im<=70 then x=x+112
if im=13 or im=14 or im=15 or im=16 or im=17 or im=18 or im=19 or im=20 then x=x:y=y-79
if im=21 or im=22 or im=23 or im=24 or im=25 or im=26 or im=27 or im=28 then x=x:y=y-79
if im=29 or im=30 or im=31 or im=32 or im=33 or im=34 or im=35 or im=36 then x=x:y=y-79
`**************Second level floor
if im=37 or im=38 or im=39 or im=40 or im=41 or im=42 or im=43 or im=44 then y=y-137
if im=45 or im=46 or im=47 or im=48 or im=49 or im=50 or im=51 or im=52 then y=y-137
if im=53 or im=54 or im=55 or im=56 or im=57 or im=58 or im=59 or im=60 then y=y-137
if im=61 or im=62 or im=63 or im=64 or im=65 or im=66 then y=y-137
sprite bs,x,y,im
bs=bs+1:y=300
next t
`*************Setup the roof tiles
x=2092:y=350
for t=1 to 66
read im
if im<=24 then x=x+112
if im=12 then x=x+5
if im=14 then x=x+5
if im=18 or im=19 then x=x+2
sprite bs,x,y,im:FLIP SPRITE bs
bs=bs+1:y=100
next t
`***** Place the 3 Invisiable level flags *******************
sprite 111,3080,60,205
sprite 112,6400,60,205
`***** Place the Guns and Tanks on screen *******************
sprite 113,2500,320,16
sprite 114,2550,305,16
sprite 115,4300,305,16
`////////////////////////////////////////////////////////////
`//////////////// Start of Main Loop ////////////////////////
`////////////////////////////////////////////////////////////
do
`Load The Level Marker
sprite 202,240,70,202
`Load Title to the screen
sprite 201,210,10,201
`Load score
sprite 198,480,420,198
` Prints out score etc....
set cursor 490,440: Print "SCORE:";score
`Load the lives on the Screen
sprite 116,50,440,199
sprite 117,70,440,199
sprite 118,90,440,199
`**************************************************************
`************** KEY DIRECTION AND FIRE FUNCTIONS **************
`**************************************************************
REM Upkey to move space ship Up
if UPKEY()=1 and crafty>100
dec crafty,10
endif
REM Downkey to move space ship Down
if DOWNKEY()=1 and crafty<350
inc crafty,10
endif
REM Leftkey to move space ship Up
if LEFTKEY()=1 and craftx>10
dec craftx,10
endif
REM Rightkey to move space ship Down
if RIGHTKEY()=1 and craftx<600
inc craftx,10
endif
if inkey$()="z" and pf=0 then gosub shoot:pf=1
`*****************************************************************
`******************* COLLISION DETECTION *************************
`*****************************************************************
`****************** Collision between lazer and other objects
if SPRITE EXIST(2)=1
if SPRITE HIT(2,0)>1 then PLAY SOUND 2:sbu=1
endif
`If the lazer hits an object blow it up
if sbu=1 then gosub blowitup
`******************* Collision between craft and invisible marker
if SPRITE EXIST(1)
if SPRITE COLLISION(1,111)=1 then gosub change_level1
endif
if SPRITE EXIST(1)
if SPRITE COLLISION(1,112)=1 then gosub change_level2
endif
`*****************************************************************
`******************** UPDATE OBJECTS *****************************
`*****************************************************************
`Just update your players sprite, stars and your lazer
`IF you fired it of cause.
sprite 1,craftx,crafty,1
if sbu=0 then gosub moveall
gosub movestars
`********************************************
`Move all boundry sprites (For-Next loop)
`Deletes objects when they leave screen
`********************************************
for t=10 to 115
bsx=SPRITE X(t):bsy=SPRITE Y(t):bsi=SPRITE IMAGE(t)
bsx=bsx-2
sprite t,bsx,bsy,bsi
if bsx<-200 then delete sprite t
next t
sync
loop
`////////////////////////////////////////////////////////////
`//////////////// End of Main Loop //////////////////////////
`////////////////////////////////////////////////////////////
`////////////////////////////////////////////////////////////
`//////////////// Start of GoSub Functions //////////////////
`////////////////////////////////////////////////////////////
`***************Scroll Stars
movestars:
SCROLL OBJECT TEXTURE 4,0.01,0.0
return
`***************Fire Lazer
shoot:
sprite 2,lx,ly,4
PLAY SOUND 1
return
`***************Change Level 1 Display
change_level1:
DELETE SPRITE 202
sprite 203,240,70,203
return
`***************Change Level 2 Display
change_level2:
DELETE SPRITE 202
sprite 204,240,70,204
return
`***************Move your lazer if its on screen
moveall:
if SPRITE EXIST(2)=1
If sprite X(2)<640
lx=lx+45
sprite 2,lx,ly,4
endif
endif
if SPRITE EXIST(2)=1
If sprite X(2)>=640
pf=0
lx=SPRITE X(1)+20
ly=SPRITE Y(1)+10
endif
endif
return
`**************Cycle for the Explosions, check last exp 11 to loop.
blowitup:
sprite 2,lx,ly,noe
if noe<11
inc noe
return
endif
if noe>=11
noe=6
lx=SPRITE X(1)+20
ly=SPRITE Y(1)+10
sprite 2,640,ly,4
pf=0:sbu=0
return
endif
`////////////////////////////////////////////////////////////
`////////////////// End of GoSub Functions //////////////////
`////////////////////////////////////////////////////////////
`////////////////////////////////////////////////////////////
`////////////////// Data Blocks to build layout//////////////
`////////////////////////////////////////////////////////////
`**************level 1 floor
data 13,13,13,13,13,14,15,15,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36
`**************level 2 floor
data 37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66
data
data