~~~ENTRYS~~~
That1Smart Guy
sync on : randomize timer()
autocam off
ink rgb(255,255,255),0
circle 10,10,10
get image 1,0,0,22,22
cls
gosub setup
gosub nextlevel
set text size 30
StartTime=timer()
do
if mouseclick()=1
if fireflag=0
angle=wrapvalue(-1*atanfull(mousex()-320,mousey()-240) )
yrotate object Oplayer,angle
yrotate object Oattack,angle
position object Oattack,320+cos(angle+90)*225,0,-1*(240+sin(angle+90)*225)
show object Oattack
fireflag=1
if object collision(Oattack,0)>0
delete object object collision(2,0)
gosub findnextenemy
endif
else
hide object Oattack
endif
else
hide object Oattack
fireflag=0
endif
if enemycountdown<=0
enemycountdown=enemyrate
gosub spawnenemy
endif
if activeenemy>0
e=100
repeat
inc e
if object exist(e) then move object e,3
until e=100+activeenemy
endif
if timer()-T>=leveltime then gosub nextlevel
if object collision(1,0)>2 then gosub gameover
score=timer()-StartTime
text 640-text width(str$(score)),0,str$(score)
sync
dec enemycountdown, timer()-lasttime
lasttime=timer()
loop
`-------------------------------------------------
`SUBROUTINES
`-------------------------------------------------
setup:
rem vars/arrays
nextenemy=101
rem player object
make object plain 1,5,50
rotate object 1,90,0,0
fix object pivot 1
Oplayer=1
position object Oplayer,320,0,-240
rem attack ray object
make object box 2,3,3,450
Oattack=2
rotate object Oattack,90,0,0
fix object pivot Oattack
position object Oattack,320,0,-240
hide object Oattack
rem camera
position camera 320,400,-240
xrotate camera 90
return
nextlevel:
inc currentlevel
enemycount=7*currentlevel
leveltime=500*currentlevel+10000
enemyrate=leveltime/enemycount
T=timer()
return
spawnenemy:
inc activeenemy
make object box nextenemy,rnd(20)+20,.1,rnd(20)+20
xrotate object nextenemy,90
fix object pivot nextenemy
enemyangle=rnd(360)
position object nextenemy,320+cos(enemyangle)*(rnd(50)+430),0,-1*(240+sin(enemyangle)*(rnd(50)+425))
point object nextenemy,320,0,-240
texture object nextenemy,1
ghost object on nextenemy
gosub findnextenemy
return
findnextenemy:
o=100
repeat
inc o
until object exist(o)=0
nextenemy=o
return
gameover:
set camera view 0,0,1,1
cls
set text size 40
ink rgb(255,255,255),0
center text 320,0,"You Survived For:"
center text 320,100,str$(timer()-StartTime)
center text 320,200,"milliseconds, not bad!"
end
return
`------------------------------------------------------
`FUNCTIONS
`------------------------------------------------------
function DupObject(oldobj,newobj)
if object exist(oldobj)
make mesh from object 10,oldobj
make object newobj,10,1
position object newobj,object position x(oldobj),object position y(oldobj),object position z(oldobj)
rotate object newobj,90,0,0 : fix object pivot newobj
rotate object newobj,object angle x(oldobj),object angle y(oldobj),object angle z(oldobj)
ghost object on newobj
endif
endfunction
Dark Dragon
REM DARKSUVIVAL
REM BY DD a.k.a StanasDude =======================================
REM ========================================
Rem NESSICARY CRAP.....
Sync on
Sync Rate 0
sync
Randomize Timer()
`autocam off
REM DIM, VARIABLES,ETC.
Dim Cubes#(51,6)
rem Cubes(1000,1) = cube exist
rem Cubes(1000,2) = posx
rem Cubes(1000,3) = posy
rem Cubes(1000,4) = velx
rem Cubes(1000,5) = vely
rem Cubes(1000,6) = ???
Dim Player#(1,15)
rem Player(1,1) = Velx
rem Player(1,2) = Vely
rem Player(1,3) = ???
rem Player(1,4) = ???
rem Player(1,5) = ???
rem Player(1,6) = ???
Dim Score(1)
State = 0
menuselc = 0
Start#=0.001
Current#=0.0
Max#=0.02
REM -----------Main Loop--------
do
select state
case 0 : gosub _dataload : endcase
case 1 : gosub _intro : endcase
case 2 : gosub _Mainmenu : endcase
case 3 : gosub Setup_Game: gosub Play_Game : endcase
case 4 : gosub _GameOptions : endcase
endselect
sync
loop
_dataload:
if file exist("dynablaster_l3.mid")=1 then load music "dynablaster_l3.mid",2
if file exist("chain.wav")=1 then load sound "chain.wav",1
rem build texture....
for x=1 to 50000
rem the red part of the color
myred=rnd(115)+50
rem the green part of the color
mygreen=95
rem the blue part of the color
myblue=85
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 101,0,0,64,64
cls
rem build texture....
for x=1 to 60000
rem the red part of the color
myred=18+rnd(40)
rem the green part of the color
mygreen=200+rnd(50)
rem the blue part of the color
myblue=rnd(50)+200
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 102,0,0,64,64
cls
rem build texture....
for x=1 to 60000
rem the red part of the color
myred=68+rnd(70)
rem the green part of the color
mygreen=82+rnd(80)
rem the blue part of the color
myblue=rnd(80)+80
ink rgb(myred,mygreen,myblue),1
Dot Rnd(64),Rnd(64)
next x
rem grab texture....
get image 103,0,0,64,64
rem state change
state = 2
return
_intro:
make object sphere 1000,2
texture object 1000,101
findarnd=0
sclx#=0
scly#=0
repeat
if findarnd=0 then sclx#=Rnd(120)+30 : scly#=Rnd(120)+30 : findarnd=1
actualx#=curvevalue(sclx#,actualx#,6)
actualy#=curvevalue(scly#,actualy#,6)
if actualx# = sclx# then findarnd=0
if actualy# = scly# then findarnd=0
inc timer
if timer > 20 then findarnd=0: timer=0
inc timer2
if timer2 > 620 then f=1
scale object 1000,actualx#,actualy#,100
Ink RGB(255,255,255),1
CenteR TexT 250,270,"Yeah.........This games is by Stanas, a.k.a DD!"
sync
until f=1
delete object 1000
state = 2
return
_Mainmenu:
autocam off
make object cube 1000,6
color object 1000,Rgb(145,125,200)
ghost object on 1000
make object cube 1001,5
texture object 1001,102
make object cube 1002,5
texture object 1002,102
make object cube 1003,5
texture object 1003,102
make object cube 1004,5
texture object 1004,102
position object 1001,-18,0,0
position object 1002,-9,0,0
position object 1003,0,0,0
position object 1004,9,0,0
position camera 0,5,-25
point camera 0,0,0
camx#=0
camy#=5
camz#=-25
h#=100000
Repeat
h#=curvevalue(0,h#,8)
if leftkey()=1
if lftflg=0
dec menuselc
endif
lftflg=1
else
lftflg=0
endif
if rightkey()=1
if rgtflg=0
inc menuselc
endif
rgtflg=1
else
rgtflg=0
endif
if menuselc < 0 then menuselc=0
if menuselc > 3 then menuselc=3
if object exist(menuselc+1001)=1
objx#=object position x(menuselc+1001)
objy#=object position y(menuselc+1001)
objz#=object position z(menuselc+1001)
endif
dstx#=curvevalue(objx#,dstx#,6)
dsty#=curvevalue(objy#,dsty#,6)
dstz#=curvevalue(objz#,dstz#,6)
position object 1000,dstx#,dsty#,dstz#
camx#=curvevalue(objx#,camx#,6)
position camera camx#,camy#,camz#
point camera object position x(1000),0+h#,object position z(1000)
coll=object collision(1000,0)
select coll
case 1001 : Header$="Play" : Describe$="Play the Game!" : endcase
case 1002 : Header$="Options" : Describe$="Edit the Game options." : endcase
case 1003 : Header$="View" : Describe$="View High Scores!" : endcase
case 1004 : Header$="Exit" : Describe$="Exit The Game...." : endcase
endselect
if returnkey()=1
select coll
case 1001
state = 3
des=1
endcase
case 1002
state = 4
des=1
endcase
case 1003
end
endcase
case 1004
end
endcase
endselect
endif
Text 50,20,"Stanazi's........DARKSURVIVAL!"
Center Text 270,320,Header$
Center Text 269,350,Describe$
sync
until des=1
des=0
return
Setup_Game:
For w=1 to 5000
if object exist(w)=1
delete object w
endif
next w
autocam off
if object exist(1)=0
rem Create player........
Make object sphere 1,1
texture object 1,101
position object 1,-18,3,0
endif
Player#(1,4)=3
Player#(1,3)=-18
position object 1,Player#(1,3),Player#(1,4),0
Player#(1,15)=0
REM Create Walls.....
Make object cube 1000,5
scale object 1000,400,70,50
position object 1000,-18,-1,0
texture object 1000,102
Make object cube 1001,5
scale object 1001,400,70,50
position object 1001,-27,3,0
zrotate object 1001,93
texture object 1001,102
`fix object pivot 1001
Make object cube 1002,5
scale object 1002,400,70,50
position object 1002,-8,3,0
zrotate object 1002,87
texture object 1002,102
position camera -18,5,-12
point camera object position x(1),object position y(1),object position z(1)
rem create and place cubes......
for c=1 to 50
cx#=RND(15)-25:cy#=RND(200)+25:vx#=0:vy#=(RND(9)+6)*0.01:vy#=vy#*-1:ize#=(RND(12)+2)*0.1
Create_Cube(c,cx#,cy#,vx#,vy#,ize#)
set object collision to boxes c+2000
next c
rotx#=270
return
Play_Game:
if piano=1 and music exist(2)=1 then loop music 2:wait 1:pause music 2:resume music 2:loop music 2
if piano=0 and music exist(2)=1 then loop music 2
timerz=0
repeat
incr=0
incr=Control_Player(current#,1)
if incr=>1 then current#=curvevalue(Max#,current#,140)
if incr=0 then current#=curvevalue(Start#,current#,2)
set cursor 1,1
`print incr
` print Player#(1,4)
for c=1 to 50
Control_Cubes(c)
next c
destx#=0
if controlkey()=1 then destx#=300
if rightkey()=1 and destx#=0 then destz#=20
if leftkey()=1 and destx#=0 then destz#=340
if rightkey()=0 and leftkey()=0 then destz#=0
rotz#=curveangle(destz#,rotz#,9)
zrotate camera rotz#
rotx#=curveangle(destx#,rotx#,9)
xrotate camera rotx#
inc timerz:Display_Stats(timerz)
if Player#(1,4) < -0.5 then done=1:state=2
sync
until done=1
done=0
if music exist(2)=1 then stop music 2
For w=1000 to 1003
if object exist(w)=1
delete object w
endif
next w
return
_GameOptions:
For w=1000 to 2000
if object exist(w)=1
delete object w
endif
next w
wait 200
autocam off
MUSTYP$="OFF"
make object cube 1000,6
color object 1000,Rgb(145,125,200)
ghost object on 1000
make object cube 1001,5
texture object 1001,102
make object cube 1002,5
texture object 1002,102
make object cube 1003,5
texture object 1003,102
make object cube 1004,5
texture object 1004,102
position object 1001,-18,0,0
position object 1002,-9,0,0
position object 1003,0,0,0
position object 1004,9,0,0
position camera 0,5,-25
point camera 0,0,0
camx#=0
camy#=5
camz#=-25
h#=100000
Repeat
h#=curvevalue(0,h#,8)
if leftkey()=1
if lftflg=0
dec menuselc
endif
lftflg=1
else
lftflg=0
endif
if rightkey()=1
if rgtflg=0
inc menuselc
endif
rgtflg=1
else
rgtflg=0
endif
if menuselc < 0 then menuselc=0
if menuselc > 3 then menuselc=3
if object exist(menuselc+1001)=1
objx#=object position x(menuselc+1001)
objy#=object position y(menuselc+1001)
objz#=object position z(menuselc+1001)
endif
dstx#=curvevalue(objx#,dstx#,6)
dsty#=curvevalue(objy#,dsty#,6)
dstz#=curvevalue(objz#,dstz#,6)
position object 1000,dstx#,dsty#,dstz#
camx#=curvevalue(objx#,camx#,6)
position camera camx#,camy#,camz#
point camera object position x(1000),0+h#,object position z(1000)
coll=object collision(1000,0)
select coll
case 1001 : Header$="Toggle Piano-style" : Describe$="If on, Plays Music In Piano! "+ MUSTYP$ : endcase
case 1002 : Header$="Option2" : Describe$=".........." : endcase
case 1003 : Header$="Option3" : Describe$=".........." : endcase
case 1004 : Header$="exit" : Describe$="Exit The Menu...." : endcase
endselect
if returnkey()=1
if retkeyflg=0
select coll
case 1001
if piano=1 then piano=0 : MUSTYP$="OFF" else piano=1 :MUSTYP$="ON"
retkeyflg=1
endcase
case 1002
endcase
case 1003
endcase
case 1004
state = 2
des=1
endcase
endselect
endif
else
retkeyflg=0
endif
Text 50,20,"==Options Menu=="
Center Text 270,320,Header$
Center Text 269,350,Describe$
sync
until des=1
des=0
wait 400
For w=1 to 5000
if object exist(w)=1
delete object w
endif
next w
return
Function Control_Player(sensitivitiy#,gravity)
Rem First get all input========
rite=0
left=0
move=0
If Rightkey()=1 then rite=1 : move=1
If leftkey()=1 then left=1 : move=1
Player#(1,3)=object position x(1)
Player#(1,4)=object position y(1)
Player#(1,13)=object position x(1)
Player#(1,14)=object position y(1)
if rite=1
Player#(1,1)=Player#(1,1)+sensitivitiy#
Player#(1,5)=Player#(1,5)-3
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
if left=1
Player#(1,1)=Player#(1,1)-sensitivitiy#
Player#(1,5)=Player#(1,5)+3
Player#(1,5)=Wrapvalue(Player#(1,5))
endif
stopx#=Player#(1,1)
stopx#=curvevalue(0,stopx#,20)
Player#(1,1)=stopx#
if Player#(1,1) <> 0 and rite+left=0
if Player#(1,1) > 0.005 then Player#(1,5)=Player#(1,5)-2
if Player#(1,1) < -0.005 then Player#(1,5)=Player#(1,5)+2
endif
Player#(1,5)=Wrapvalue(Player#(1,5))
fall=1
coll= object collision(1,0)
if coll = 1000 and player#(1,15) < 6 then fall=0 :Player#(1,2)=abs(Player#(1,2)/1.2) : player#(1,7)=40 :player#(1,15)=player#(1,15)+1 :if sound exist(1)=1 then play sound 1
if coll = 1000 and player#(1,15) => 6 then fall=0 :Player#(1,2)=abs(Player#(1,2)/2) : player#(1,7)=100
if coll > 1999 then fall=1
Dist#=Sqrt( (Object position x(1001) - player#(1,3))^2 + (Object position y(1001) - player#(1,4))^2 + (Object position z(1001) - 0)^2 )
if Dist# < 3 then Player#(1,1)=abs(Player#(1,1)/1) : bckflg=1 :player#(1,8)=100 :if sound exist(1)=1 then play sound 1
Dist#=Sqrt( (Object position x(1002) - player#(1,3))^2 + (Object position y(1002) - player#(1,4))^2 + (Object position z(1002) - 0)^2 )
if Dist# < 3 then Player#(1,1)=Player#(1,1)*-1 : bckflg=1 : player#(1,8)=100 :if sound exist(1)=1 then play sound 1
for c=2000 to 2050
if object exist(c)=1
cull = object collision(1,c)
if cull = 1 then fall=1
endif
next c
if fall=1 then Player#(1,2)=Player#(1,2)-0.009
if bckflg=1 then Player#(1,3)=Player#(1,13) :Player#(1,4)=Player#(1,14)
Player#(1,3)=Player#(1,3)+player#(1,1)
Player#(1,4)=Player#(1,4)+Player#(1,2)
player#(1,7)=curvevalue(100,player#(1,7),15)
player#(1,8)=curvevalue(100,player#(1,8),2)
scale object 1,player#(1,8),player#(1,7),100
Position object 1,Player#(1,3),Player#(1,4),0
zrotate object 1,Player#(1,5)
endfunction move
function Control_Cubes(cube)
if Cubes#(cube,1) = 1
if Cubes#(cube,3) < -2 then Cubes#(cube,1) = 0: Score(1)=Score(1)+1
Cubes#(cube,2) = Cubes#(cube,2) + Cubes#(cube,4)
Cubes#(cube,3) = Cubes#(cube,3) + Cubes#(cube,5)
position object cube+2000,Cubes#(cube,2),Cubes#(cube,3),0
else
cx#=RND(15)-25:cy#=RND(200)+25:vx#=0:vy#=(RND(9)+6)*0.01:vy#=vy#*-1:ize#=(RND(12)+2)*0.1
Create_Cube(cube,cx#,cy#,vx#,vy#,ize#)
endif
endfunction
function Create_Cube(cubeno,posx#,posy#,velx#,vely#,size#)
if object exist(cubeno+2000)=0
Make object cube cubeno+2000,size#
endif
position object cubeno+2000,posx#,posy#,posz
texture object cubeno+2000,103
`ghost object on cubeno+2000
Cubes#(cubeno,1) = 1
Cubes#(cubeno,2) = posx#
Cubes#(cubeno,3) = posy#
Cubes#(cubeno,4) = velx#
Cubes#(cubeno,5) = vely#
endfunction
function Display_Stats(t)
ink RGB(0,0,0),1
if t < 200
set text size 30
if t < 150 then Center Text 250,250,"Are you Ready?!"
if t > 170 and t < 200 then Center Text 250,250,"GO!!!"
else
if Score(1) => 0 and Score(1) < 10 then rating$="N00B"
if Score(1) > 10 and Score(1) <25 then rating$="So-so Player..."
if Score(1) > 25 and Score(1) < 40 then rating$="..Good Player.."
if Score(1) > 40 and Score(1) < 60 then rating$="Semi-Pro.."
if Score(1) > 60 and Score(1) < 80 then rating$="Skillz havin' Guy.."
if Score(1) > 80 and Score(1) < 105 then rating$="Professinal Tilter!"
if Score(1) > 105 and Score(1) < 130 then rating$="Addicted Tiltist!"
if Score(1) > 130 and Score(1) < 170 then rating$="F.r.e.a.k!"
if Score(1) > 170 and Score(1) < 200 then rating$="Dude on Fire!"
if Score(1) > 200 and Score(1) < 2000 then rating$="MANIAC!!!"
set text size 10
Center Text 390,20,"Skill Level "
Line 350,35,430,35
Center Text 390,35,rating$
Center Text 370,380,"You Dodged " + sTr$(Score(1)) + " Cubes!"
endif
endfunction
TheComet
rem circle wars
rem by TheComet
rem names
input "please enter a name for player 1>",name1$
if name1$="" then name1$="Player 1"
if len(name1$)>30 then name1$=left$(name1$,30)
print "Welcome, "+name1$+", you will be the red circle and you stear with the arrow keys"
print
input "please enter a name for player 2>",name2$
if name2$="" then name2$="Player 2"
if len(name2$)>30 then name2$=left$(name2$,30)
print "Welcome, "+name2$+", you will be playing with the yellow circle and you stear with a,d,w"
print
input "press enter to start...",e$
rem setup screen
set display mode 1024,768,32
set camera view 0,0,screen width(),screen height()
sync on
sync rate 60
backdrop off
color backdrop 0
autocam off
position camera 100000,100000,10000
hide mouse
rem load music
if file exist("game.xm") then load music "game.xm",1
update_loading(24,0)
if file exist("pause.xm") then load music "pause.xm",2
update_loading(48,1)
if file exist("menu.xm") then load music "menu.xm",3
update_loading(72,1)
rem load instructions
create bitmap 1,600,436
ink rgb(0,0,255),0
box 6,56,274,101
box 6,106,274,190
box 6,195,274,329
box 6,336,274,434
box 281,56,595,160
box 281,168,595,285
ink 0,0
box 7,57,273,100
box 7,107,273,189
box 7,196,273,328
box 7,337,273,433
box 282,57,594,159
box 282,169,594,284
ink rgb(255,0,0),0
for t=1 to 11
x=rnd(30)+10
y=rnd(35)+60
dot x,y
next t
set text size 30
center text 300,10,"INSTRUCTIONS"
set text size 20
text 60,64,"=FOOD"
set text size 10
text 10,200,"Player 1 : UP=MOVE"
text 10,217," LEFT=TURN LEFT"
text 10,234," RIGHT=TURN RIGHT"
text 136,350,"FRONT OF SHIP"
text 283,57,"THE BIGGER CIRCLES EAT THE SMALLER"
text 283,74,"ONES. TRY AND GET AS BIG AS YOU CAN."
text 283,91,"YOU WILL EXPLODE WHEN YOU GET REALLY"
text 283,108,"BIG, INSTANTLY KILLING EVERYONE. (THAT"
text 283,125,"IS GOOD). FOOD SPEEDS YOU UP, ENEMIES"
text 283,142,"SLOW YOU DONW. HAVE FUN! :)"
text 382,174,"IF YOU GET HIT BY A TURRET,"
text 382,191,"YOU WILL SHRINK, AND"
text 382,208,"YOUR SPEED WILL INCREASE."
text 344,240,"TURRET"
text 299,265,"BULLET"
line 366,235,348,199
line 318,259,302,206
line 180,367,106,389
circle 39,238,15
line 39,238,54,238
ink rgb(255,255,0),0
text 10,270,"Player 2 : W=MOVE"
text 10,287," A=TURN LEFT"
text 10,304," D=TURN RIGHT"
circle 39,306,15
line 39,306,54,306
circle 53,388,42
line 53,388,95,388
ink rgb(255,0,255),0
circle 343,193,12
line 343,193,318,192
line 343,193,321,205
circle 303,205,4
ink rgb(0,255,0),0
circle 343,193,21
ink rgb(0,255,255),0
circle 45,149,37
circle 122,145,28
circle 175,146,16
circle 203,153,8
line 45,149,82,146
line 122,145,149,145
line 175,146,190,149
line 203,153,210,156
get image 1,0,0,600,436
delete bitmap 1
update_loading(96,1)
rem make rock textures
create bitmap 1,128,128
for t=1 to 60000
ink rgb(rnd(40)+42,rnd(30)+47,rnd(10)+10),0
dot rnd(128),rnd(128)
next t
get image 2,0,0,128,128
delete bitmap 1
rem load rocks
make object sphere 1,4:texture object 1,2
update_loading(174,1)
make object sphere 2,2:texture object 2,2
update_loading(175,1)
make object sphere 5,3:texture object 5,2
update_loading(176,0)
delete image 2
rem scale rocks
load=176
for t=1 to 5
if t<3 or t=5 then scale object t,300,300,300:inc load:update_loading(load,1)
next t
rem load and make backdrop
create bitmap 1,300,350
ink 0,0
box 0,0,299,249
ink rgb(255,255,255),0
for t=1 to 100
dot rnd(300),rnd(350)
next t
get image 2,0,0,300,350
delete bitmap 1
update_loading(180,1)
make object plain 3,1200,1000
update_loading(181,1)
position object 3,0,0,700
update_loading(182,1)
update_loading(183,1)
set object 3,1,0,0
update_loading(184,1)
ghost object on 3
update_loading(185,1)
make object plain 4,1200,1000
update_loading(186,1)
position object 4,0,0,710
update_loading(187,1)
update_loading(188,1)
set object 4,1,0,0
update_loading(189,1)
ghost object on 4
update_loading(190,1)
texture object 3,2
texture object 4,2
update_loading(191,1)
scale object texture 3,2,2
scale object texture 4,2,2
fade object 3,0
fade object 4,0
update_loading(192,0)
lock object on 3
lock object on 4
backdrop on
rem variables
enemymax=15
food=60
turrets=3
music_state$="ON"
steer1$="up=move, left and right to steer"
steer2$="up=move, left and right to steer"
rem menu
color backdrop 0
start:
sel=1
if music_state$="ON" and music exist(3) then loop music 3
do
rem control backdrop
scroll object texture 3,0.001,0.0005
scroll object texture 4,0.0005,0.0002
rem control rocks
inc sine,rnd(2)
inc sine2#,0.125
s#=sin(sine)*nmz#/1.5
c#=cos(sine)*nmz#/1.5
sz#=sin(sine2#)*100
nmx#=curvevalue(s#,nmx#,30)
nmy#=curvevalue(s#,nmx#,30)
nmz#=sz#+120
position object 1,nmx#,nmy#/3,nmz#
position object 2,0-(nmx#/4),nmy#/2,nmz#/2
position object 5,0-nmx#,nmy#/3,nmz#
for t=1 to 5
if t<3 or t=5 then rotate object t,wrapvalue(object angle x(t)+5),wrapvalue(object angle y(t)+3),wrapvalue(object angle z(t)+4)
next t
rem instructions
paste image 1,212,300
rem box with lines around writing
ink rgb(0,0,255),0
box 206,103,818,290
box 106,50,918,97
ink 0,0
box 207,104,817,289
box 107,51,917,96
rem move
if moving=0
if upkey()=1 then dec sel
if downkey()=1 then inc sel
if sel>8 then sel=8
if sel<1 then sel=1
moving=1
endif
if upkey()=0 and downkey()=0 then moving=0
rem list menu
ink rgb(255,255,255),0
center text 512,60,"Welcome to TheComet`s Circle Wars"
center text 512,80,"Up and down arrow keys to select, use left and right arrow keys to change and press enter to start"
if sel=1 then ink rgb(255,0,0),0
if sel=1 then center text 512,120,"1 Player <---¦":ink rgb(255,255,255),0 else center text 512,120,"1 Player"
if sel=2 then ink rgb(255,0,0),0
if sel=2 then center text 512,140,"2 Player <---¦":ink rgb(255,255,255),0 else center text 512,140,"2 Player"
if sel=3 then ink rgb(255,0,0),0
if sel=3 then center text 512,160,"Enemies : "+str$(enemymax)+" <---¦":ink rgb(255,255,255),0 else center text 512,160,"Enemies : "+str$(enemymax)
if sel=4 then ink rgb(255,0,0),0
if sel=4 then center text 512,180,"Food : "+str$(food)+" <---¦":ink rgb(255,255,255),0 else center text 512,180,"Food : "+str$(food)
if sel=5 then ink rgb(255,0,0),0
if sel=5 then center text 512,200,"Music : "+music_state$+" <---¦":ink rgb(255,255,255),0 else center text 512,200,"Music : "+music_state$
if sel=6 then ink rgb(255,0,0),0
if sel=6 then center text 512,220,"Turrets : "+str$(turrets)+" <---¦":ink rgb(255,255,255),0 else center text 512,220,"Turrets : "+str$(turrets)
if sel=7 then ink rgb(255,0,0),0
if sel=7 then center text 512,240,"Steering type Player 1 : "+steer1$+" <---¦":ink rgb(255,255,255),0 else center text 512,240,"Steering type Player 1 : "+steer1$
if sel=8 then ink rgb(255,0,0),0
if sel=8 then center text 512,260,"Steering type Player 2 : "+steer2$+" <---¦":ink rgb(255,255,255),0 else center text 512,260,"Steering type Player 2 : "+steer2$
rem change enemies
if sel=3
if rightkey()=1 then inc enemymax
if leftkey()=1 then dec enemymax
if enemymax<2 then enemymax=2
endif
rem change food
if sel=4
if rightkey()=1 then inc food
if leftkey()=1 then dec food
if food<0 then food=0
endif
rem change music
if sel=5
if rightkey()=1 or leftkey()=1
if mmoving=0
if music exist(3)
if music_state$="ON" then music_state$="OFF":if music playing(3)=1:stop music 3:endif else music_state$="ON":if music playing(3)=0 then loop music 3
endif
mmoving=1
endif
endif
endif
rem change turret amount
if sel=6
if rightkey()=1 and mmoving=0 then inc turrets:mmoving=1
if leftkey()=1 and mmoving=0 then dec turrets:mmoving=1:if turrets<0 then turrets=0
endif
rem change steering type player 1
if sel=7
if rightkey()=1 or leftkey()=1
if mmoving=0
if steer1$="up=move, left and right to steer" then steer1$="up=up, down=down, left=left, right=right" else steer1$="up=move, left and right to steer"
mmoving=1
endif
endif
endif
rem change steering type player 2
if sel=8
if rightkey()=1 or leftkey()=1
if mmoving=0
if steer2$="up=move, left and right to steer" then steer2$="up=up, down=down, left=left, right=right" else steer2$="up=move, left and right to steer"
mmoving=1
endif
endif
endif
rem reset mmoving
if leftkey()=0 and rightkey()=0 then mmoving=0
rem exit
if sel=1 or sel=2:if returnkey()=1:exit:endif:endif
rem refresh screen
sync
rem end of main loop
loop
repeat:until returnkey()=0
backdrop off:cls:sync
rem loading
update_loading(0,0)
rem dimensions
dim esize(enemymax)
update_loading(12,1)
dim ex#(enemymax)
update_loading(24,1)
dim ez#(enemymax)
update_loading(36,1)
dim speed#(enemymax)
update_loading(48,1)
dim fx(food)
update_loading(60,1)
dim fz(food)
update_loading(72,1)
dim tx#(turrets)
update_loading(84,1)
dim tz#(turrets)
update_loading(96,1)
dim ta#(turrets)
update_loading(108,1)
dim dta#(turrets)
update_loading(120,1)
dim bx#(turrets)
update_loading(132,1)
dim bz#(turrets)
update_loading(144,1)
dim ba#(turrets)
update_loading(150,1)
dim dba#(turrets)
update_loading(156,1)
dim bullet_life(turrets)
update_loading(162,1)
dim time_to_shoot(turrets)
update_loading(168,1)
backdrop on
rem music
if music exist(3) then stop music 3
if music_state$="ON" and music exist(1) then loop music 1
rem randomize
reset:
for t=0 to enemymax-1
esize(t)=rnd(4)+3
ex#(t)=rnd(screen width())
ez#(t)=rnd(screen height())
speed#(t)=2
next t
for t=0 to food-1
fx(t)=rnd(screen width())
fz(t)=rnd(screen height())
next t
for t=0 to turrets-1
tx#(t)=rnd(screen width())
tz#(t)=rnd(screen height())
next t
rem set time for how long names are displayed
name1time=320
name2time=320
rem main loop
score1=0
score2=0
position camera 0,0,0
point camera 0,0,100
do
rem control backdrop
scroll object texture 3,0.001,0.0005
scroll object texture 4,0.0005,0.0002
rem control rocks
inc sine,rnd(2)
inc sine2#,0.125
s#=sin(sine)*nmz#/1.5
c#=cos(sine)*nmz#/1.5
sz#=sin(sine2#)*100
nmx#=curvevalue(s#,nmx#,30)
nmy#=curvevalue(s#,nmx#,30)
nmz#=sz#+120
position object 1,nmx#,nmy#/3,nmz#
position object 2,0-(nmx#/4),nmy#/2,nmz#/2
position object 5,0-nmx#,nmy#/3,nmz#
for t=1 to 5
if t<3 or t=5 then rotate object t,wrapvalue(object angle x(t)+5),wrapvalue(object angle y(t)+3),wrapvalue(object angle z(t)+4)
next t
rem scores
text 50,0,name1$+" : "+str$(score1)
if sel=2 then text screen width()-len(name2$)-180,0,name2$+" : "+str$(score2)
rem move around turret and point at biggest circle
if turrets>0
size=0
for b=0 to enemymax-1:if esize(b)>size:size=esize(b):destination_object=b:endif:next b
for t=0 to turrets-1
dta#(t)=atanfull(ex#(destination_object)-tx#(t),ez#(destination_object)-tz#(t))
ta#(t)=curveangle(dta#(t),ta#(t),15)
tx#(t)=newxvalue(tx#(t),ta#(t),0.1+(t*0.1))
tz#(t)=newzvalue(tz#(t),ta#(t),0.1+(t*0.1))
ink rgb(0,255,0),0
circle tx#(t),tz#(t),20
ink rgb(255,0,255),0
circle tx#(t),tz#(t),12
ink rgb(150,0,150),0
line tx#(t),tz#(t),tx#(t)+(sin(ta#(t)-15)*25),tz#(t)+(cos(ta#(t)-15)*25)
line tx#(t),tz#(t),tx#(t)+(sin(ta#(t)+15)*25),tz#(t)+(cos(ta#(t)+15)*25)
rem shoot bullet out of turret
if bullet_life(t)<0
bx#(t)=-5
bz#(t)=-5
time_to_shoot(t)=time_to_shoot(t)+1
if time_to_shoot(t)>100 then bx#(t)=tx#(t):bz#(t)=tz#(t):ba#(t)=ta#(t):bullet_life(t)=120:time_to_shoot(t)=0
endif
bullet_life(t)=bullet_life(t)-1
if bullet_life(t)>0
dba#(t)=atanfull(ex#(destination_object)-bx#(t),ez#(destination_object)-bz#(t))
ba#(t)=curveangle(dba#(t),ba#(t),50)
bx#(t)=newxvalue(bx#(t),ba#(t),5)
bz#(t)=newzvalue(bz#(t),ba#(t),5)
ink rgb(255,0,255),0
circle bx#(t),bz#(t),5
dot bx#(t),bz#(t)
endif
next t
endif
rem move around player 1
if steer1$="up=move, left and right to steer"
if upkey()=1 then ex#(0)=newxvalue(ex#(0),a1#,speed#(0)):ez#(0)=newzvalue(ez#(0),a1#,speed#(0))
if leftkey()=1 then inc a1#,2
if rightkey()=1 then dec a1#,2
else
player_move1=0
if upkey()=1 then da1#=180:player_move1=1
if leftkey()=1 then da1#=270:player_move1=1
if rightkey()=1 then da1#=90:player_move1=1
if downkey()=1 then da1#=0:player_move1=1
if upkey()=1 and leftkey()=1 then da1#=225:player_move1=1
if leftkey()=1 and downkey()=1 then da1#=315:player_move1=1
if downkey()=1 and rightkey()=1 then da1#=45:player_move1=1
if rightkey()=1 and upkey()=1 then da1#=135:player_move1=1
a1#=curveangle(da1#,a1#,10)
if player_move1=1 then ex#(0)=newxvalue(ex#(0),a1#,speed#(0)):ez#(0)=newzvalue(ez#(0),a1#,speed#(0))
endif
a1#=wrapvalue(a1#)
ink rgb(255,0,0),0
circle ex#(0),ez#(0),esize(0)
line ex#(0),ez#(0),ex#(0)+sin(a1#)*esize(0),ez#(0)+cos(a1#)*esize(0)
dec name1time
if name1time>0 then center text ex#(0),ez#(0)-esize(0)-20,name1$
rem move around player 2
if sel=2
if steer2$="up=move, left and right to steer"
if keystate(17)=1 then ex#(1)=newxvalue(ex#(1),a2#,speed#(1)):ez#(1)=newzvalue(ez#(1),a2#,speed#(1))
if keystate(30)=1 then inc a2#,2
if keystate(32)=1 then dec a2#,2
else
player_move2=0
if keystate(17)=1 then da2#=180:player_move2=1
if keystate(30)=1 then da2#=270:player_move2=1
if keystate(32)=1 then da2#=90:player_move2=1
if keystate(31)=1 then da2#=0:player_move2=1
if keystate(17)=1 and keystate(30)=1 then da2#=225:player_move2=1
if keystate(30)=1 and keystate(31)=1 then da2#=315:player_move2=1
if keystate(31)=1 and keystate(32)=1 then da2#=45:player_move2=1
if keystate(32)=1 and keystate(17)=1 then da2#=135:player_move2=1
a2#=curveangle(da2#,a2#,10)
if player_move2=1 then ex#(1)=newxvalue(ex#(1),a2#,speed#(1)):ez#(1)=newzvalue(ez#(1),a2#,speed#(1))
endif
a2#=wrapvalue(a2#)
ink rgb(255,255,0),0
circle ex#(1),ez#(1),esize(1)
line ex#(1),ez#(1),ex#(1)+sin(a2#)*esize(1),ez#(1)+cos(a2#)*esize(1)
dec name2time
if name2time>0 then center text ex#(1),ez#(1)-esize(1)-20,name2$
endif
rem control enemies
rem AI : find smallest circle and point at it, else find food. if no food then point randomly
if sel=2
for t=2 to enemymax-1
found=0
for g=0 to enemymax-1:if esize(g)<esize(t):found=1:exit:endif:next g
if found=1
ea#=atanfull(ex#(g)-ex#(t),ez#(g)-ez#(t))
else
if food=1
ea#=atanfull(fx(t)-ex#(t),fz(t)-ez#(t))
else
ea#=rnd(360)
endif
endif
ex#(t)=newxvalue(ex#(t),ea#,speed#(t))
ez#(t)=newzvalue(ez#(t),ea#,speed#(t))
ink rgb(0,255,255),0
circle ex#(t),ez#(t),esize(t)
line ex#(t),ez#(t),ex#(t)+sin(ea#)*esize(t),ez#(t)+cos(ea#)*esize(t)
next t
else
for t=1 to enemymax-1
for g=0 to enemymax-1:if esize(g)<esize(t):exit:endif:next g
ea#=atanfull(ex#(g)-ex#(t),ez#(g)-ez#(t))
ex#(t)=newxvalue(ex#(t),ea#,speed#(t))
ez#(t)=newzvalue(ez#(t),ea#,speed#(t))
ink rgb(0,255,255),0
circle ex#(t),ez#(t),esize(t)
line ex#(t),ez#(t),ex#(t)+sin(ea#)*esize(t),ez#(t)+cos(ea#)*esize(t)
next t
endif
rem collision
for t=0 to enemymax-1
for g=0 to enemymax-1
if sqrt((ex#(g)-ex#(t))^2+(ez#(g)-ez#(t))^2)<esize(t)+esize(g)
if esize(t)>esize(g)
if g=0 then name1time=320:if esize(0)>30 then inc score1,esize(0)
if g=1 then name2time=320:if esize(1)>30 then inc score2,esize(1)
esize(t)=esize(t)+(esize(g)/5)
esize(g)=rnd(4)+3
ex#(g)=rnd(screen width())
ez#(g)=rnd(screen height())
speed#(g)=2
speed#(t)=curvevalue(0.1,speed#(t),30)
if t=0 then inc score1,esize(g)*2
if t=1 then inc score2,esize(g)*2
endif
if esize(g)>esize(t)
if t=0 then name1time=320:if esize(0)>30 then inc score1,esize(0)
if t=1 then name2time=320:if esize(1)>30 then inc score2,esize(1)
esize(g)=esize(g)+(esize(t)/5)
esize(t)=rnd(4)+3
ex#(t)=rnd(screen width())
ez#(t)=rnd(screen height())
speed#(t)=2
speed#(t)=2
speed#(g)=curvevalue(0.1,speed#(g),30)
if g=0 then inc score1,esize(t)*2
if g=1 then inc score2,esize(t)*2
endif
endif
next g
rem collision with bullets
for g=0 to turrets-1
if sqrt((ex#(t)-bx#(g))^2+(ez#(t)-bz#(g))^2)<esize(t)+5
if esize(t)>5 then esize(t)=esize(t)-1:speed#(t)=speed#(t)+0.1
endif
next g
next t
rem draw food
ink rgb(255,0,0),0
for t=0 to food-1
dot fx(t),fz(t)
next t
rem collision with food
for t=0 to enemymax-1
for g=0 to food-1
if sqrt((fx(g)-ex#(t))^2+(fz(g)-ez#(t))^2)<esize(t)
esize(t)=esize(t)+1
fx(g)=rnd(screen width())
fz(g)=rnd(screen height())
speed#(t)=speed#(t)+0.05
if t=0 then inc score1,1
if t=1 then inc score2,1
endif
next g
next t
rem make sure players and enemies don`t leave screen
for t=0 to enemymax-1
if ex#(t)<0 then ex#(t)=0
if ez#(t)<0 then ez#(t)=0
if ex#(t)>screen width() then ex#(t)=screen width()
if ez#(t)>screen height() then ez#(t)=screen height()
next t
rem enemies and players explode
for t=0 to enemymax-1
if esize(t)>2000
esize(t)=5
speed#(t)=2
if t=0 then inc score1,2000:player1time=120:rem dec turrets,2:if turrets<0 then turrets=0:dec enemymax,5:if enemymax<2 then enemymax=2
if t=1 then inc score2,2000:player2time=120:rem dec turrets,2:if turrets<0 then turrets=0:dec enemymax,5:if enemymax<2 then enemymax=2
endif
next t
rem win
if enemymax=1 and turrets=0
for t=1 to 120
center text screen width()/2,screen height()/2,"WINNER!! ENTERING NEXT LEVEL..."
sync
next t
undim esize(enemymax)
undim ex#(enemymax)
undim ez#(enemymax)
undim speed#(enemymax)
undim fx(food)
undim fz(food)
undim tx#(turrets)
undim tz#(turrets)
undim ta#(turrets)
undim dta#(turrets)
undim bx#(turrets)
undim bz#(turrets)
undim ba#(turrets)
undim dba#(turrets)
undim bullet_life(turrets)
undim time_to_shoot(turrets)
goto reset
endif
rem reset game
center text 512,0,"Press Enter to pause"
if returnkey()=1
repeat:until returnkey()=0
insel=1
if music exist(1) and music exist(2)
if music playing(1)=1 then stop music 1
if music_state$="ON" then loop music 2
endif
do
rem control backdrop
scroll object texture 3,0.001,0.0005
scroll object texture 4,0.0005,0.0002
rem control rocks
inc sine,rnd(2)
inc sine2#,0.125
s#=sin(sine)*nmz#/1.5
c#=cos(sine)*nmz#/1.5
sz#=sin(sine2#)*100
nmx#=curvevalue(s#,nmx#,30)
nmy#=curvevalue(s#,nmx#,30)
nmz#=sz#+120
position object 1,nmx#,nmy#/3,nmz#
position object 2,0-(nmx#/4),nmy#/2,nmz#/2
position object 5,0-nmx#,nmy#/3,nmz#
for t=1 to 5
if t<3 or t=5 then rotate object t,wrapvalue(object angle x(t)+5),wrapvalue(object angle y(t)+3),wrapvalue(object angle z(t)+4)
next t
rem box with lines around writing
ink rgb(0,0,255),0
box 206,93,818,230
ink 0,0
box 207,94,817,229
rem move
if moving=0
if upkey()=1 then dec insel
if downkey()=1 then inc insel
if insel>6 then insel=6
if insel<1 then insel=1
moving=1
endif
if upkey()=0 and downkey()=0 then moving=0
rem print menu
ink rgb(255,255,255),0
if insel=1 then ink rgb(255,0,0),0
if insel=1 then center text 512,100,"Continue <---¦":ink rgb(255,255,255),0 else center text 512,100,"Continue"
if insel=2 then ink rgb(255,0,0),0
if insel=2 then center text 512,120,"Back to Menu <---¦":ink rgb(255,255,255),0 else center text 512,120,"Back to Menu"
if insel=3 then ink rgb(255,0,0),0
if insel=3 then center text 512,140,"Reset Game <---¦":ink rgb(255,255,255),0 else center text 512,140,"Reset Game"
if insel=4 then ink rgb(255,0,0),0
if insel=4 then center text 512,160,"Music : "+music_state$+" <---¦":ink rgb(255,255,255),0 else center text 512,160,"Music : "+music_state$
if insel=5 then ink rgb(255,0,0),0
if insel=5 then center text 512,180,"Steering type Player 1 : "+steer1$+" <---¦":ink rgb(255,255,255),0 else center text 512,180,"Steering type Player 1 : "+steer1$
if insel=6 then ink rgb(255,0,0),0
if insel=6 then center text 512,200,"Steering type Player 2 : "+steer2$+" <---¦":ink rgb(255,255,255),0 else center text 512,200,"Steering type Player 2 : "+steer2$
rem change music
if insel=4
if rightkey()=1 or leftkey()=1
if mmoving=0
if music_state$="ON" then music_state$="OFF" else music_state$="ON"
mmoving=1
if music exist(2)
if music_state$="ON" and music playing(2)=0 then loop music 2
if music_state$="OFF" and music playing(2)=1 then stop music 2
endif
endif
endif
endif
if leftkey()=0 and rightkey()=0 then mmoving=0
rem change steering type player 1
if insel=5
if rightkey()=1 or leftkey()=1
if mmoving=0
if steer1$="up=move, left and right to steer" then steer1$="up=up, down=down, left=left, right=right" else steer1$="up=move, left and right to steer"
mmoving=1
endif
endif
endif
rem change steering type player 2
if insel=6
if rightkey()=1 or leftkey()=1
if mmoving=0
if steer2$="up=move, left and right to steer" then steer2$="up=up, down=down, left=left, right=right" else steer2$="up=move, left and right to steer"
mmoving=1
endif
endif
endif
rem exit
if returnkey()=1 then exit
sync
loop
repeat:until returnkey()=0
rem music
if music exist(1) and music exist(2)
if music playing(2)=1 then stop music 2
if music_state$="ON" then loop music 1
endif
rem reset
if insel=3 then goto reset
rem back to main menu
repeat:until returnkey()=0
if insel=2
if music exist(1)
if music playing(1)=1 then stop music 1
endif
undim esize(enemymax)
undim ex#(enemymax)
undim ez#(enemymax)
undim speed#(enemymax)
undim fx(food)
undim fz(food)
undim tx#(turrets)
undim tz#(turrets)
undim ta#(turrets)
undim dta#(turrets)
undim bx#(turrets)
undim bz#(turrets)
undim ba#(turrets)
undim dba#(turrets)
undim bullet_life(turrets)
undim time_to_shoot(turrets)
goto start
endif
endif
rem refresh screen
sync
rem end of main loop
loop
function update_loading(p,s)
text 400,300,"Loading..."
ink rgb(128,128,128),0
box 400,330,594,340
ink 0,0
box 401,331,593,339
ink rgb(255,255,255),0
box 401,331,401+p,339
if s=1 then sync else sleep 1000
endfunction
4-61 ,5-52 ,6-63 ,7-94 ,8-46 ,9-??
What's the next number?