Hello all.
Me, and my friend, Kieran, have been playing around with some code, where he sends some code, I add to it, then I send it back and he adds to it, and the cycle goes on, and on. (Its really fun, you guys should try it some time
)
Anyways, this is the result from it. Nothing too crazy.
REM Project: Code Game Project 1
REM Created: 2/3/2007 12:17:05 PM
REM
REM ***** Main Source File *****
REM
init_game()
do
control_cube()
control_camera()
control_particles()
control_swords()
fastsync
loop
function init_game()
start darktwilight
color backdrop 0
sync on : sync rate 60
init_variables()
init_cube()
init_platforms()
init_particles()
endfunction
function init_variables()
global r as float
global time as integer
r = 0
time = 75
endfunction
function init_cube()
make light 1
color light 1,randcol()
position light 1,60,70,80
make object sphere 3,-500
set object wireframe 3,1
make object plain 2,500,500
pitch object up 2,90
move object 2,-200
make object pyramid 1,50
color object 1,randcol()
endfunction
function init_platforms()
load object "sword.dbo",8
load object "sword.dbo",9
load object "sword.dbo",10
load object "sword.dbo",11
make object box 4,200,3,200
make object box 5,200,3,200
make object box 6,200,3,200
make object box 7,200,3,200
position object 4,-300,20,0 : position object 8,-300,60,0
position object 5,0,20,-300 : position object 9,0,60,-300
position object 6,300,20,0 : position object 10,300,60,0
position object 7,0,20,300 : position object 11,0,60,300
endfunction
function init_particles()
make particles 1,1,1,100
position particles 1,0,100,0
color particles 1,rnd(255),rnd(255),rnd(255)
endfunction
function control_cube()
r = r + 1
time = time + 1
if time > 75
color object 1,randcol()
time = 0
endif
rotate object 1,r,r,r
if upkey()=1 then move object 1,2
if downkey()=1 then move object 1,-2
endfunction
function control_particles()
color particles 1,rnd(255),rnd(255),rnd(255)
endfunction
function control_camera()
turn camera right 90
move camera 3
x#=object position x(1)
y#=object position y(1)
z#=object position z(1)
point camera x#,y#,z#
point light 1,x#,y#,z#
text 2,2,"FPS: "+str$(screen fps())
text 2,22,"POLY: "+str$(get polygon count())
text 2,42,"OBJ: "+str$(statistic(5))
endfunction
function control_swords()
s# = 1.7
turn object left 8,s#
turn object left 9,s#
turn object left 10,s#
turn object left 11,s#
endfunction
function randcol()
c=rgb(rnd(255),rnd(255),rnd(255))
endfunction c
You will need to provide your own sword model though, I'm sorry. Attatched is the compiled program.
Cheers,
-db