TGC Codebase Backup



HONOUR by Anonymous Coder

28th Nov 2003 16:53
Summary

crafts war between egypt and israel



Description



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    disable escapekey
rem the introduction
hide mouse
load music "sound\boss.mid",1
loop music 1
cls
load bitmap "bmp\mubarak.bmp",1
load bitmap "bmp\sharon.bmp",2
set current bitmap 1
get image 1,0,0,208,239
delete bitmap 1
set current bitmap 2
get image 2,0,0,197,299
delete bitmap 2
paste image 1,50,90
wait 1500
ink rgb(250,10,20),0
set text font "comic sans ms"
set text size 80
center text 320,240,"VS"  
wait 1700
paste image 2,400,75
wait 2000
x=480
y=800
repeat
sync on
sync rate 300
cls
ink rgb(250,25,25),0
set text size 40
center text 320,x,"Those who lead must be brave,"
center text 320,x+40,"but the aims of people and religions"
center text 320,x+80,"are never the same, that is why"
center text 320,x+120,"there will be always wars."
center text 320,x+160,"However those who are practising"
center text 320,x+200,"these wars must have honour"
center text 320,x+240,"and this is our wars aim"
ink rgb(200,200,25),0
center text 320,x+300,"*****HONOUR*****"
ink rgb(240,214,215),0
center text 320,x+390,"To start mission press space"
x=x-3
until x<20
if x<20 then x=20
suspend for key

rem the game
rem loading soundand music
load music "sound\music.mid",1
load sound "sound\machinegun.wav",1
load sound "sound\explosion.wav",2
load sound "sound\rubble.wav",3
loop music 1 
rem hide mouse
hide mouse
rem loading bitmaps
load bitmap "bmp\egypt_craft2.bmp",1
load bitmap "bmp\israel_craft2.bmp",2
load bitmap "bmp\missile2.bmp",31
rem getting images
set current bitmap 1
get image 1,300,200,450,450
set current bitmap 2
get image 2,300,200,450,450
set current bitmap 31
get image 31,300,200,420,380
rem deleting bitmaps
delete bitmap 1
delete bitmap 2
delete bitmap 31
rem definition of x y parameters
x=240
y=300
a=x-4
b=y-70
v=-80
newv=-320
newb=y-50
timer=10
s=-20
rem begin main loop
do
rem Clear screen
cls
set cursor 50,30
print "score is ",s
set cursor 450,30
print "maximum score is 1000 "
rem making mirror israelian crafts 
h=RND(50)
v=v+3
newv=newv+3

sprite 2,h-50,v,2
sprite 4,h+100,v,2
sprite 5,h+250,v,2
sprite 6,h+400,v,2
sprite 7,h+20,newv,2
sprite 8,h+170,newv,2
sprite 9,h+320,newv,2
sprite 10,h+470,newv,2
if v>320 then v=-30 : show all sprites
if newv>320 then newv=-30 : show all sprites 

rem position of israel craft

	rem Record old position
	oldx=x
	oldy=y
rem relation between egyptcraft and missile
a=x-4


	rem Control position with cursors
	if upkey()=1 then y=y-20
	if downkey()=1 then  y=y+20
	if leftkey()=1 then x=x-20 
	if rightkey()=1 then  x=x+20
rem conserving borders
if y>340 then y=340
if y<-62 then y=-62
if x>497 then x=497
if x<-33 then x=-33 

	rem draw the sprites at the new position
	sprite 1,x,y,1
   sprite 31,a,b,31
   sprite 30,a,newb,31
rem 10getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(10))*(sprite x(31)-sprite x(10))+(sprite y(31)-sprite y(10))*(sprite y(31)-sprite y(10)))<100 then hide sprite 31 : hide sprite 10
if sqrt((sprite x(30)-sprite x(10))*(sprite x(30)-sprite x(10))+(sprite y(30)-sprite y(10))*(sprite y(30)-sprite y(10)))<100 then hide sprite 30 : hide sprite 10
if sqrt((sprite x(1)-sprite x(10))*(sprite x(1)-sprite x(10))+(sprite y(1)-sprite y(10))*(sprite y(1)-sprite y(10)))<20 then hide sprite 1 : hide sprite 10 : s=s-20

rem 2getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(2))*(sprite x(31)-sprite x(2))+(sprite y(31)-sprite y(2))*(sprite y(31)-sprite y(2)))<100 then hide sprite 31 : hide sprite 2
if sqrt((sprite x(30)-sprite x(2))*(sprite x(30)-sprite x(2))+(sprite y(30)-sprite y(2))*(sprite y(30)-sprite y(2)))<100 then hide sprite 30 : hide sprite 2
if sqrt((sprite x(1)-sprite x(2))*(sprite x(1)-sprite x(2))+(sprite y(1)-sprite y(2))*(sprite y(1)-sprite y(2)))<20 then hide sprite 1 : hide sprite 2 : s=s-20

rem 9getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(9))*(sprite x(31)-sprite x(9))+(sprite y(31)-sprite y(9))*(sprite y(31)-sprite y(9)))<100 then hide sprite 31 : hide sprite 9
if sqrt((sprite x(30)-sprite x(9))*(sprite x(30)-sprite x(9))+(sprite y(30)-sprite y(9))*(sprite y(30)-sprite y(9)))<100 then hide sprite 30 : hide sprite 9
if sqrt((sprite x(1)-sprite x(9))*(sprite x(1)-sprite x(9))+(sprite y(1)-sprite y(9))*(sprite y(1)-sprite y(9)))<20 then hide sprite 1 : hide sprite 9 : s=s-20

rem 4getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(4))*(sprite x(31)-sprite x(4))+(sprite y(31)-sprite y(4))*(sprite y(31)-sprite y(4)))<100 then hide sprite 31 : hide sprite 4
if sqrt((sprite x(30)-sprite x(4))*(sprite x(30)-sprite x(4))+(sprite y(30)-sprite y(4))*(sprite y(30)-sprite y(4)))<100 then hide sprite 30 : hide sprite 4
if sqrt((sprite x(1)-sprite x(4))*(sprite x(1)-sprite x(4))+(sprite y(1)-sprite y(4))*(sprite y(1)-sprite y(4)))<20 then hide sprite 1 : hide sprite 4 : s=s-20

rem 5getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(5))*(sprite x(31)-sprite x(5))+(sprite y(31)-sprite y(5))*(sprite y(31)-sprite y(5)))<100 then hide sprite 31 : hide sprite 5
if sqrt((sprite x(30)-sprite x(5))*(sprite x(30)-sprite x(5))+(sprite y(30)-sprite y(5))*(sprite y(30)-sprite y(5)))<100 then hide sprite 30 : hide sprite 5
if sqrt((sprite x(1)-sprite x(5))*(sprite x(1)-sprite x(5))+(sprite y(1)-sprite y(5))*(sprite y(1)-sprite y(5)))<20 then hide sprite 1 : hide sprite 5 : s=s-20

rem 6getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(6))*(sprite x(31)-sprite x(6))+(sprite y(31)-sprite y(6))*(sprite y(31)-sprite y(6)))<100 then hide sprite 31 : hide sprite 6
if sqrt((sprite x(30)-sprite x(6))*(sprite x(30)-sprite x(6))+(sprite y(30)-sprite y(6))*(sprite y(30)-sprite y(6)))<100 then hide sprite 30 : hide sprite 6
if sqrt((sprite x(1)-sprite x(6))*(sprite x(1)-sprite x(6))+(sprite y(1)-sprite y(6))*(sprite y(1)-sprite y(6)))<20 then hide sprite 1 : hide sprite 6 : s=s-20

rem 7getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(7))*(sprite x(31)-sprite x(7))+(sprite y(31)-sprite y(7))*(sprite y(31)-sprite y(7)))<100 then hide sprite 31 : hide sprite 7
if sqrt((sprite x(30)-sprite x(7))*(sprite x(30)-sprite x(7))+(sprite y(30)-sprite y(7))*(sprite y(30)-sprite y(7)))<100 then hide sprite 30 : hide sprite 7
if sqrt((sprite x(1)-sprite x(7))*(sprite x(1)-sprite x(7))+(sprite y(1)-sprite y(7))*(sprite y(1)-sprite y(7)))<20 then hide sprite 1 : hide sprite 7 : s=s-20

rem 8getting horizontal & vertical position of crafts and hiding them if less than 5
if sqrt((sprite x(31)-sprite x(8))*(sprite x(31)-sprite x(8))+(sprite y(31)-sprite y(8))*(sprite y(31)-sprite y(8)))<100 then hide sprite 31 : hide sprite 8
if sqrt((sprite x(30)-sprite x(8))*(sprite x(30)-sprite x(8))+(sprite y(30)-sprite y(8))*(sprite y(30)-sprite y(8)))<100 then hide sprite 30 : hide sprite 8
if sqrt((sprite x(1)-sprite x(8))*(sprite x(1)-sprite x(8))+(sprite y(1)-sprite y(8))*(sprite y(1)-sprite y(8)))<20 then hide sprite 1 : hide sprite 8 : s=s-20

rem hide messile
show sprite 1
hide sprite 31
hide sprite 30


rem play sound if missile is on	
if scancode()=29 
 play sound 1  
rem fire missiles
repeat
show sprite 31 
inc b,-60
sprite 31,a,b,31
inc newb,-35
sprite 30,a,newb,31
if b<300 then show sprite 30 else hide sprite 30
if b<-200 then b=sprite y(1) : hide sprite 31
if newb<-200 then newb=sprite y(1)+50 :hide sprite 30
until b<50

endif

	rem Check for initial impact
if sprite hit(31,0)>0 then play sound 3 : play sound 2 :s=s+20 : ink 0,rgb(255,25,25) else ink rgb(255,255,255),0
	rem Check for mpact with egyptian craft positionif sprite hit(1,0)>0 then play sound 1 : ink 0,rgb(255,225,25) else ink rgb(255,255,255),0
rem sync
	sync on
	rem Update screen
	sync rate 30
rem perfect player
if s>1000
cls
hide all sprites
set text font "comic sans ms"
set text size 50
center text 320,110, "*************************"
center text 320,140, "*****you are perfect*****"
center text 320,180, "*************************"
center text 320,300, "press space to continue"
suspend for key
s=-20
endif
loop