TGC Codebase Backup



The wall by Brux

11th Jun 2013 6:06
Summary

Simple arcade game, where you must to shoot down men who attempt to climb the wall. **Sorry for the mistake I wrote 'high' instead of '' hight ' *** and now 'correct.



Description

the wall. simple game where you have to shoot down the men who
attempt to climb the wall, until you reach the top where the game
will end 'with your defeat, From time to time the speed'
Rise of the men will increase 'more and more'. Try to stop them if you can



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    sync on:sync rate 0
dim px(35)
dim py(35)
dim frame(35)
dim flag(35)
dim hightscore(1)
score=0
hightscore(1)=100
speed=20
enemy=10
vel#=5.0
max#=30.0
for s=1 to 300
 set sprite s,0,1
next s

load array "hight",hightscore(0)
load sound "destroy.wav",1
load sound "lancio.wav",2
load sound "sirena.wav",3
load image "thewall.jpg",1
load image "s2.bmp",2
load image "s3.bmp",3
load image "mirino.bmp",5
load image "bullet.bmp",10
randomize timer()
hide mouse
rem Initialize position enemies
for i=1 to 35
px(i)=rnd(600)+10
py(i)=500
frame(i)=rnd(1)+2
flag(i)=0
next i
Rem Main

do
paste image 1,0,0
mx=mousex()
my=mousey()
sprite 250,mx,10,5
for i=1 to enemy
sprite i,px(i),py(i),frame(i)
flag(i)=flag(i)+1
if flag(i)>max#
  flag(i)=0
  frame(i)=frame(i)+1
  if max#<5 then max#=5
if frame(i)>3
 frame(i)=2
endif
  py(i)=py(i)-vel#
endif
u=u+1
if u>1000
 max#=max#-0.1:vel#=vel#+0.1:u=0
endif
if py(i)<3
 play sound 3
 set text font "arialblack"
 set text size 45
 center text 320,200,"YOU LOST!"
 sprite 300,-100,-100,10
 set text size 14
 gosub panel_score
 sync
 wait key
 save array "hight",hightscore(0):wait 50
 end
endif
next i
gosub panel_score
if mouseclick()=1 and bullet=0
bullet=1
endif
if bullet=1
  gosub fire
endif
sync
loop

panel_score:
ink rgb(255,0,0),0
if score>hightscore(1)
  hightscore(1)=score
endif

text 80,8,right$(str$(score+100000),5)
text 265,8,right$(str$(hightscore(1)+100000),5)
text 425,8,right$(str$(speed+1000),3)
text 575,8,right$(str$(enemy+1000),3)
sync
return

 fire:
if fire_bullet=0
 play sound 1
 fire_bullet=1
endif
if bullet=1
ye=ye+40
sprite 300,mx,ye,10
endif
e=sprite collision(300,0)
if e>0 and e<250
 if esplosione=0
    esplosione=1
    inc score,2*enemy
 endif
play sound 2
wait 100
 sprite e,-100,-100,1
  px(e)=rnd(600)+10
  py(e)=500
  countenemy=countenemy+1
  if countenemy=5 then enemy=enemy+1 : countenemy=0:inc speed
  if enemy>35 then enemy=35
endif
if ye>450
 ye=0
 bullet=0
 fire_bullet=0
 esplosione=0
endif
return