after more than 2 false starts in C++ and 1 false start in liberity basic i have finaly found a language that i can learn in.. and have even made a game in.....
now that im done dancing
would the l33t profs of this board tell me a how i can make this better(faster exicution, ect)
here is the code:
rem Load character into hidden bitmap
LOAD BITMAP "runner.bmp",1
rem Grab images for character animation
FOR y=0 to 1
FOR x=0 TO 6
GET IMAGE 1+x+(y*7),(x*89),(y*120),(x*89)+89,(y*120)+120
NEXT x
NEXT y
rem Delete character bitmap
DELETE BITMAP 1
rem Set player variables
xpos=0
ypos=30
image=1
rem Activate manual syncronization
SYNC ON
rem init drift chage rate
z=1
rem make end game lines
line 0,20,640,20
line 0,460,640,460
rem ------------------
NewestS=2
OldestS=3
RndN=50
rem Load a bitmap on to the screen
load bitmap "face.bmp"
rem Grab image 1 from bitmap
get image 1,32,52,152,170
rem ------------------
rem Begin Loop
DO
rem make rock -------------
if rnd(rndN)=0
newestS=NewestS+1
rockypos=Rnd(480)
sprite newestS,660,rockypos,1
scale sprite newestS,25
rndN=rndN/1.001
endif
rem make rock -------------
rem sprite moving ----------------
activeS=oldestS
for activeS=oldestS to NewestS
oldxpos=sprite x(activeS)
oldypos=sprite y(activeS)
sprite activeS,oldxpos-6,oldypos,1
If oldypos640
xpos=-44
z=z+1
endif
rem add one to score
points=points+1
rem add drift to ypos
ypos=ypos-drift
rem check for end of game
If ypos=380 then goto ending
Rem Animate runner and wrap
image=image+1 : IF image>12 THEN image=2
rem Update sprite
sprite 1,xpos,ypos,image
rem -----
rem Check for initial impact
rem if sprite hit(1,4)>0 then goto ending
rem -----
rem Refresh screen now
SYNC : SLEEP 20
rem End Loop
LOOP
Ending:
print "Game over"
print "your score was "; points
input "press enter to quit"; quit$
end
thanks for your time