TGC Codebase Backup



walk through a park of falling rocks by blood scent

10th Apr 2006 18:36
Summary

I remmed the media so don't worry, if i forgot anything that i was supposed to rem just diy. the media comes with dark basicpro, so just drag it into the program to enjoy full the



Description

Please email me with your high scores. (frankietheg123@yahoo.com)



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    REM Project: walk through the park of falling rocks
REM Created: 8/19/2005 7:01:29 PM
REM ***** Main Source File *****
REM
REM Project: created bitmap
REM Created: 8/17/2005 8:05:15 PM
REM
REM ***** Main Source File *****
REM
REM Project: created bitmap
REM Created: 8/17/2005 8:05:15 PM
REM
REM ***** Main Source File *****
setupsprites()
animate()
end

rem setup game
function setupsprites()
rem initialize
randomize timer()
set text size 50
hide mouse
sync on : sync rate 100
remstart
load sound "impactsow.wav",1
load sound "impactsexplosion.wav",2
load sound "impactsla.wav",3
load music "mp3music triumph.mp3",1
loop music 1
remend
rem draw the figures
create bitmap 2,70,70
set current bitmap 2
ink rgb(255,255,255),rgb(15,204,14)
rem sync : cls : sync
sync
rem head
box 10,0,20,10

rem body
line 15,10,15,35

rem left leg
line 15,35,4,55

rem right leg
line 15,35,26,55

rem get image for sprite
get image 1,4,0,26,55

cls
rem head

box 10,0,20,10
rem body

line 15,10,15,35
rem unileg

line 15,35,15,55
get image 2,9,0,21,55
cls rgb(0,0,0)
ink rgb(10,0,0),rgb(0,0,0)
cls rgb(0,0,0)
circle 10,10,10
get image 3,0,0,20,20
set current bitmap 0
ink rgb(255,255,255),rgb(255,0,0)
sync : cls rgb(0,0,0) : sync
rem make sprite

sprite 1,screen width()-50,screen height()-110,1
hide sprite 1
sprite 2,screen width()-45,screen height()-110,2
line 0,screen height()-55,screen width()+100,screen height()-55
sync
endfunction

rem animation function
function animate()

rem if switch =1 show sprite 1,if 2, show spite 2
switch=2

rem setup positions
x#=screen width()-50
x2#=screen width()-45
posx#=rnd(screen width()-50)

rem color screen
ink rgb(255,255,255),rgb(0,0,0)
sync : sync
loop sound 3
rem main game loop
do

rem ptint steps taken to screen
text screen width()/2-100,0,str$(walk#)
ink rgb(255,255,255),rgb(0,0,0)
sync
box screen width()/2-100,0,50,50
sync

rem open or close legs
if switch=2
walk#=walk#+1
hide sprite 1
show sprite 2
sleep 180
sync
text screen width()/2-100,0,str$(walk#)
ink rgb(255,255,255),rgb(0,0,0)
sync
box screen width()/2-100,0,50,50
sync
switch=1
else
show sprite 1
hide sprite 2
switch=2
sleep 180
sync
text screen width()/2-100,0,str$(walk#)
ink rgb(255,255,255),rgb(0,0,0)
sync
box screen width()/2-100,0,50,50
sync
endif

rem logic to control movement
if x#<=0 and w=0
w=1
x#=x#+5
x2#=x2#+5
endif
if x#<screen width()-35 and w=1
x#=x#+5
x2#=x2#+5
endif
if x#>=screen width()-35 and w=1
w=0
x#=x#-5
x2#=x2#-5
endif
if x#>0 and w=0
x#=x#-5
x2#=x2#-5
endif

rem position sprites
sprite 1,x#,screen height()-110,1
sprite 2,x2#,screen height()-110,2
sprite 3,xpos#,ypos#,3
sync

rem make falling rocks positions
ypos#=ypos#+35
if ypos#>screen height()-85
rem play sound 2
ypos#=0
xpos#=rnd(screen width()-35)
endif

rem check for collision
if sprite hit(3,1)
rem pause sound 3
rem play spound if rock hits player
rem play sound 1
rem print steps taken in middle of screen
set cursor screen width()/2-50,screen height()/2-50
print "";walk#;" steps taken"
sync
rem wait for key,then end
wait key
end
endif
rem end check


rem print steps to screen
text screen width()/2-100,0,str$(walk#)
ink rgb(255,255,255),rgb(0,0,0)
sync
box screen width()/2-100,0,50,50
sync
rem go back to do
loop
endfunction