how woul di make my game run faster it looks all mest up because it is so slow and jerks alot can somone help.
rem -------------------------
rem March 2006
rem Shooting Gallery Game/Program
rem -------------------------
sync on
sync rate 60
DIM SpriteHit(20)
DIM SpriteTimer(1)
hide mouse
SpriteTimer(1) = 0
load image "crosshair.bmp",25
LoadTargetAnims()
rem initalize all sprites
for x = 2 to 20
sprite X,-100,68,5
set sprite x,1,1
SpriteHit(x) = 0
next X
rem set mouse cursor sprite
sprite 1,320,240,1
set sprite 1,1,1
rem set up the lines in the background
set current bitmap 0
Green = RGB(0,255,0)
Red = RGB(255,0,0)
Black = RGB(0,0,0)
White = RGB(255,255,255)
INK Green,Black
Box 0,98,639,102
INK Red,Black
BOX 0,100,639,100
INK White,Black
inum = 5
rem play the game until the escape key is hit
WHILE ESCAPEKEY()=0
ProcessSprites()
ControllerHandler()
sync
ENDWHILE
END
rem this moves the crosshair to were the mouse moves:)
FUNCTION ControllerHandler()
SPRITE 1, MOUSEX(), MOUSEY(), 25
if mouseclick()=1
for X = 2 to 20
if sprite collision(1,x)
SpriteHit(x) = 1
endif
next X
endif
ENDFUNCTION
rem this does all the sprite collision processing
FUNCTION ProcessSprites()
SpriteTimer(1) = SpriteTimer(1) - 1
if SpriteTimer(1) <= 0 then MoveNewSprite()
for X = 2 to 20
if sprite X(X) > 704
sprite X, -100,68,5
endif
if SpriteHit(X)
sprite X,sprite x(x)+5,sprite Y(x), sprite image(x)+1
if sprite image(x) >=15
sprite x,-100,68,5
SpriteHit(X) = 0
endif
else
if sprite X(X) >= -64
sprite X,sprite X(x)+5,sprite Y(x), 5
endif
endif
next X
ENDFUNCTION
rem moves out a new sprite
FUNCTION MoveNewSprite()
for X = 2 to 20
if sprite x(x) <= -100
sprite x , -64, sprite y(X),5
endif
next X
SpriteTimer(1) = 30
ENDFUNCTION
rem loads the target animations.:0
FUNCTION LoadTargetAnims()
load bitmap "target.bmp",1
inum = 5
fadestep = 100
set current bitmap 1
for X = 0 to 10
fade bitmap 1,90
get image inum,0,0,64,64
inum = inum + 1
next X
delete bitmap 1
set current bitmap 0
ENDFUNCTION
Check out my site!(unfinished)
http://www.freewebs.com/dbnewbie/