To BennyII:
My games never take very long to make.
If they start taking too long, I give up.
I just do it for fun basically.
The games maybe took a total of 12 hours each, at the most.
Here is the code for The Towers if you want to look at it.
It's 315 lines.
sync on
sync rate 40
autocam off
gosub build_world
gosub build_varaibles
gosub set_camera
do
gosub world_action
if win<1
gosub mouse_action
gosub moves_action
endif
gosub win_game
sync
loop
mouse_action:
if mouseclick()=0 and click=1 then click=0
if mouseclick()=1 and ring=0 and click=0
moves=moves+1
if mousex()<230
if Acount>0
ring=Atower((10-Acount)+1)
position object ring,object position x(ring),160,0
Atower((10-Acount)+1)=0
Acount=Acount-1
click=1
play sound 3
endif
endif
if mousex()>229 and mousex()<421
if Bcount>0
ring=Btower((10-Bcount)+1)
position object ring,object position x(ring),160,0
Btower((10-Bcount)+1)=0
Bcount=Bcount-1
click=1
play sound 3
endif
endif
if mousex()>420
if Ccount>0
ring=Ctower((10-Ccount)+1)
position object ring,object position x(ring),160,0
Ctower((10-Ccount)+1)=0
Ccount=Ccount-1
click=1
play sound 3
endif
endif
endif
if ring>0
hide mouse
xx#=mousex()
if xx#<134 then xx#=134
if xx#>504 then xx#=504
ox#=(320-xx#)/1.24
position object ring,ox#,160,0
endif
if ring>0 and mouseclick()=1 and click=0
click=1
if mousex()<230
if Acount>0
if ring<Atower((10-Acount)+1)
position object ring,150,120-(10*((10-Acount))),0
Acount=Acount+1
Atower((10-Acount)+1)=ring
ring=0
show mouse
play sound 2
endif
else
Acount=Acount+1
position object ring,150,120-(10*((10-Acount)+1)),0
Atower(10)=ring
ring=0
show mouse
play sound 2
endif
endif
if mousex()>229 and mousex()<421
if Bcount>0
if ring<Btower((10-Bcount)+1)
position object ring,0,120-(10*((10-Bcount))),0
Bcount=Bcount+1
Btower((10-Bcount)+1)=ring
ring=0
show mouse
play sound 2
endif
else
Bcount=Bcount+1
position object ring,0,120-(10*((10-Bcount)+1)),0
Btower(10)=ring
ring=0
show mouse
play sound 2
endif
endif
if mousex()>420
if Ccount>0
if ring<Ctower((10-Ccount)+1)
position object ring,-150,120-(10*((10-Ccount))),0
Ccount=Ccount+1
Ctower((10-Ccount)+1)=ring
ring=0
show mouse
play sound 2
endif
else
Ccount=Ccount+1
position object ring,-150,120-(10*((10-Ccount)+1)),0
Ctower(10)=ring
ring=0
show mouse
play sound 2
endif
endif
endif
return
moves_action:
if moves<10000
if oldmoves<moves
m$=str$(moves)
l=len(m$)
set current bitmap 10
for a=1 to l
v=val(mid$(m$,a))
v=v+1
v=v*50
get image 500+(a-1),v-50,0,v,45
texture object 400+a,500+(a-1)
next a
endif
endif
set current bitmap 0
oldmoves=moves
return
world_action:
scroll object texture 201,.0001,-.001
scroll object texture 200,.0001,-.001
if ring>0 then yrotate object ring,wrapvalue(object angle y(ring)+1)
if instructions=0
set cursor 510,445
print "By Randi Middleton"
set cursor 400,380
if win>0
print "Press any key to play again"
else
print "Press [I] for instructions"
endif
if inkey$()="i" or inkey$()="I"
hide object 301
hide mouse
texture object 300,410
instructions=1
endif
else
if inkey$()<>"" and inkey$()<>"i" and inkey$()<>"I"
show object 301
show mouse
texture object 300,300
instructions=0
endif
endif
return
win_game:
if win=0
if Atower(1)>0 or Ctower(1)>0 then win=1
endif
if win=1
play sound 4
texture object 301,400
set sound volume 1,70
win=2
endif
if win=2
if inkey$()<>""
win=3
endif
endif
if win=3
set sound volume 1,60
texture object 301,301
for a=1 to 10
yrotate object a,rnd(360)
position object a,0,120-(10*a),0
Atower(a)=0
Btower(a)=a
Ctower(a)=0
if a<5
texture object 400+a,110
endif
next a
Acount=0
Bcount=10
Ccount=0
ring=0
click=0
moves=0
oldmoves=-1
win=0
endif
return
set_camera:
position camera 0,100,330
point camera 0,60,0
fog on
fog color rgb(200,200,200)
fog distance 3000
ink 0,0
set text font "verdana"
set text size 12
set current bitmap 0
return
build_varaibles:
Acount=0
Bcount=10
Ccount=0
dim Atower(10)
dim Btower(10)
dim Ctower(10)
for a=1 to 10
Atower(a)=0
Btower(a)=a
Ctower(a)=0
next a
ring=0
click=0
moves=0
oldmoves=-1
win=0
instructions=0
return
build_world:
load object "media/platform.x",100
position object 100,0,0,0
clone object 100,104
scale object 104,100,5,110
position object 104,0,0,0
load image "media/black.bmp",110
texture object 104,110
load object "media/pole.x",101
position object 101,0,78,0
clone object 101,102
position object 102,-150,78,0
clone object 101,103
position object 103,150,78,0
load image "media/water.bmp",100
load image "media/sphere.bmp",101
make object plain 200,3000,3000
texture object 200,100
scale object texture 200,2,2
set sphere mapping on 200,101
xrotate object 200,90
set object fog 200,1
load image "media/sky.bmp",102
make object sphere 201,2000
position object 201,0,0,50
scale object 201,100,75,150
set object cull 201,0
texture object 201,102
for a=1 to 10
load object "media/"+str$(a)+".x",a
yrotate object a,rnd(360)
position object a,0,120-(10*a),0
next a
make light 1
set point light 1,0,300,300
set normalization on
load image "media/border.bmp",300
make object plain 300,310,238
position object 300,0,78,140
xrotate object 300,7
yrotate object 300,180
texture object 300,300
set object transparency 300,1
disable object zdepth 300
load image "media/title.bmp",301
make object plain 301,150,30
position object 301,0,165,140
yrotate object 301,180
xrotate object 301,7
texture object 301,301
set object transparency 301,1
disable object zdepth 301
load image "media/moves.bmp",302
make object plain 302,50,20
position object 302,100,-10,140
yrotate object 302,180
xrotate object 302,7
texture object 302,302
set object transparency 302,1
disable object zdepth 302
load bitmap "media/numbers.bmp",10
for a=1 to 4
make object plain 400+a,13,13
position object 400+a,75-(a*13),-10,140
yrotate object 400+a,180
xrotate object 400+a,7
texture object 400+a,110
set object transparency 400+a,1
disable object zdepth 400+a
next a
load image "media/congrats.bmp",400
load image "media/instructions.bmp",410
load sound "media/music.wav",1
set sound volume 1,60
loop sound 1
load sound "media/hit.wav",2
set sound volume 2,70
load sound "media/get.wav",3
set sound volume 3,70
load sound "media/win.wav",4
set sound volume 4,80
return
Bug Killer took less amount of time and has fewer lines of code, but not by much.
282 lines of code.
sync on
sync rate 40
autocam off
randomize timer()
gosub load_parts
gosub load_sounds
gosub set_camera
gosub set_variables
goto title_screen
start_game:
do
if start=1
gosub handle_movement
gosub move_bug
set cursor 0,0
print "Your Score = "+ str$(score)
else
set cursor 270,200
print "Press [ENTER]"
if returnkey()=1 then start=1
endif
noise=rnd(100)
if noise>90 and sound playing(6)=0 then play sound 6
noise=rnd(1000)
if noise<2 and sound playing(7)=0 then play sound 7
if noise>998 and sound playing(8)=0 then play sound 8
sync
loop
move_bug:
if time>2
move=rnd(4)
goPoop=rnd(100)
if goPoop>poopTime and poop=0 and drop=0
poop=1
show object 5
endif
time=0
endif
zrotate object 1,0
yrotate object 1,0
if drop=0
if move=1
if sound playing(1)=0 then play sound 1
position object 1,object position x(1)-speed#,object position y(1),0
zrotate object 1,10
yrotate object 1,10
endif
if move=2
if sound playing(1)=0 then play sound 1
position object 1,object position x(1)+speed#,object position y(1),0
zrotate object 1,350
yrotate object 1,350
endif
if move=3
if sound playing(1)=0 then play sound 1
position object 1,object position x(1),object position y(1)-speed#,0
xrotate object 1,350
endif
if move=4
position object 1,object position x(1),object position y(1)+speed#,0
xrotate object 1,10
endif
if object position y(1)>180
position object 1,object position x(1),180,0
endif
if object position y(1)<-50
position object 1,object position x(1),-50,0
endif
if object position x(1)>250
position object 1,250,object position y(1),0
endif
if object position x(1)<-250
position object 1,-250,object position y(1),0
endif
else
if drop=1
drop=2
xrotate object 1,180
stop object 1
set object frame 1,5
stop sound 1
endif
position object 1,object position x(1),object position y(1)-10,0
if object position y(1)<-200
play sound 5
speed#=speed#+.2
poopTime=poopTime-1
xrotate object 1,0
position object 1,object position x(1),150,0
loop object 1
score=score+10
drop=0
endif
endif
time=time+1
if poop>0
if poop=1
play sound 4
position object 5,object position x(1),object position y(1)-10,0
endif
if poop>1
position object 5,object position x(5),object position y(5)-8,0
endif
poop=poop+1
if object position y(5)<-180
poop=0
hide object 5
endif
if object position y(5)>object position y(2)-30 and object position y(5)<object position y(2)+30
if object position x(5)>object position x(2)-30 and object position x(5)<object position x(2)+30
die=1
endif
endif
endif
return
handle_movement:
if die=0
if leftkey()=1
position object 2,object position x(2)-5,-180,0
endif
if rightkey()=1
position object 2,object position x(2)+5,-180,0
endif
if object position x(2)>250
position object 2,250,object position y(2),0
endif
if object position x(2)<-250
position object 2,-250,object position y(2),0
endif
if spacekey()=1 and smoke=0
show object 3
position object 3,object position x(2),-135,0
smoke=1
play sound 3
endif
else
position object 2,object position x(2),object position y(2)-8,0
if die=1
play sound 2
die=2
endif
if object position y(2)<-400
die=0
lifes=lifes+1
position object 2,0,-180,0
if lifes<3
hide object 7+lifes
else
hide object 5
lifes=0
poop=0
speed#=4
lifes=0
start=0
die=0
score=0
poopTime=90
position object 1,0,180,0
show object 8
show object 9
endif
endif
endif
if smoke=1
position object 3,object position x(3),object position y(3)+10,0
if object position y(3)>280 then smoke=0
yrotate object 3,wrapvalue(object angle y(3)+1)
scroll object texture 3,0,.05
if object position x(3)>object position x(1)-20 and object position x(3)<object position x(1)+20
if object position y(3)>object position y(1)-20 and object position y(3)<object position y(1)+20
drop=1
hide object 3
smoke=0
endif
endif
endif
scroll object texture 7,0,-.0005
return
set_variables:
score=0
drop=0
smoke=0
move=3
newMove=5
time=0
poop=0
speed#=4
lifes=0
start=0
die=0
poopTime=90
return
set_camera:
position camera 0,0,-400
point camera 0,0,0
set ambient light 70
fog on
fog color rgb(30,30,30)
fog distance 2200
hide mouse
return
load_parts:
load object "media/fly.x",1
set object 1,1,1,1,1,1,0
position object 1,0,180,0
xrotate object 1,345
fix object pivot 1
set object speed 1,100
loop object 1
disable object zdepth 1
load object "media/can.x",2
set object 2,1,1,1,1,1,0
position object 2,0,-180,0
disable object zdepth 2
load object "media/smoke.x",3
set object 3,1,1,1,1,1,0
position object 3,0,-100,0
hide object 3
disable object zdepth 3
load object "media/porch.x",4
position object 4,0,0,-300
make object plain 5,40,40
load image "media/poop.bmp",1
texture object 5,1
set object 5,1,0,1,1,1,0
position object 5,0,170,0
disable object zdepth 5
hide object 5
make object plain 6,2000,2000
xrotate object 6,90
load image "media/grass.bmp",2
texture object 6,2
scale object texture 6,3,3
position object 6,-1,-100,200
make object plain 7,3700,1500
set object 7,1,1,0
load image "media/sky.bmp",3
texture object 7,3
position object 7,-5,250,1300
xrotate object 7,310
make object plain 8,15,35
set object 8,1,0,1
load image "media/cans.bmp",4
texture object 8,4
position object 8,250,-220,0
disable object zdepth 8
make object plain 9,15,35
set object 9,1,0,1
texture object 9,4
position object 9,270,-220,0
disable object zdepth 9
make object plain 10,15,35
set object 10,1,0,1
texture object 10,4
position object 10,290,-220,0
disable object zdepth 10
load image "media/title.bmp",20
sprite 1,0,0,20
hide sprite 1
return
load_sounds:
load sound "media/fly.wav",1
load sound "media/can.wav",2
load sound "media/spray.wav",3
load sound "media/poop.wav",4
load sound "media/splat.wav",5
load sound "media/cricket.wav",6
set sound volume 6,40
load sound "media/dog.wav",7
set sound volume 7,40
load sound "media/locust.wav",8
set sound volume 8,40
load sound "media/open.wav",9
set sound volume 9,40
return
title_screen:
loop sound 9
show sprite 1
suspend for key
hide sprite 1
stop sound 9
goto start_game
Their you go.
That's how I did it.
Randi