heh heh heres my entry,100 % code,no media needed.
i even finished early.
remstart
Davids dark physics competition room
interactive room by David A H
uses 100% code,no media :)
started aug 11,06 :)
finished aug 22,06
worked off & on during 11 days.please vote for
David iz cool :)
thanks for trying! ;)
remend
`start up code------------------------------------------
set display mode 640,480,32 : set window on
set window layout 0,0,0
set window size 640,480 : set window position 200,100
sync rate 60 : sync on
autocam off : position camera 0,16,5
gosub make_world
`------------------------------------------------------
do
gosub game
phy update
sync
loop
`********************** gosubs *******************
game:
`*ball states*
`ball rests
if ball=0
position object 39,40,2,-38
if object collision(39,46) then ball=9
endif
`1st get ball
if ball=9
position object 39,0,0,0
ball=10
endif
`have ball
if ball=10
glue object to limb 39,20,4
text 200,430,"you have the ball."
text 200,440,"press t to throw it."
if keystate(20) then ball=19
endif
`throw ball
if ball=19
unglue object 39
yrotate object 39,object angle y(20)
position object 39,object position x(20),object position y(20)+2,object position z(20)
ball=20
endif
`ball flys
if ball=20
move object 39,0.8
move object down 39,0.04
inc balltimer
if balltimer>2000
ball=0
balltimer=0
endif
endif
`*title + instructions at beginning only*
ink rgb(0,200,0),0
if t<1200
inc t
text 50,60,"Davids physics room challenge entry :)"
text 250,150,"move camera around as usual."
text 250,175,"move camera up & down by mouseclicking"
text 250,200,"move player around with arrowkeys+controlkey"
text 250,300,"there is a ball in the corner."
text 250,320,"move to it to pick it up."
text 250,340,"press t when have it to throw it."
text 150,400,"have fun!be cool & please vote for David iz cool! :)"
endif
`camera watches player
`point camera object position x(20),object position y(20),object position z(20)
`position hidden dynamic object with player
phy set rigid body position 100,object position x(20),object position y(20)+1,object position z(20)
`position hidden ball with viewable ball
phy set rigid body position 43,object position x(39),object position y(39),object position z(39)
`hidden box to collide with ball
position object 46,object position x(20),0.5,object position z(20)
if controlkey()=1
`*animation for player*
if upkey() or downkey() or leftkey() or rightkey()
inc a
if a<20 and a>0
`r arm
rotate limb 20,4,40,0,0
offset limb 20,4,3.7,0,-2
`l arm
rotate limb 20,5,-40,0,0
offset limb 20,5,-3.7,0,2
`r leg
rotate limb 20,6,-20,0,0
offset limb 20,6,1.8,-6.4,1.5
`l leg
rotate limb 20,7,20,0,0
offset limb 20,7,-1.8,-6.4,-1.5
endif
if a<40 and a>20
`r arm
rotate limb 20,4,-40,0,0
offset limb 20,4,3.7,0,2
`l arm
rotate limb 20,5,40,0,0
offset limb 20,5,-3.7,0,-2
`r leg
rotate limb 20,6,20,0,0
offset limb 20,6,1.8,-6.4,-1.5
`l leg
rotate limb 20,7,-20,0,0
offset limb 20,7,-1.8,-6.4,1.5
endif
if a>40 then a=0
else
`r arm
rotate limb 20,4,0,0,0
offset limb 20,4,3.2,0,0
`l arm
rotate limb 20,5,0,0,0
offset limb 20,5,-3.2,0,0
`r leg
rotate limb 20,6,0,0,0
offset limb 20,6,1.8,-7.4,0
`l leg
rotate limb 20,7,0,0,0
offset limb 20,7,-1.8,-7.4,0
endif
`*move player*
if upkey() then move object 20,0.5
if downkey() then move object 20,-0.5
if leftkey() then yrotate object 20,object angle y(20)-1
if rightkey() then yrotate object 20,object angle y(20)+1
endif
`del later--------------------------------------------
`*edit*
if controlkey()=0 then control camera using arrowkeys 0,1,2
if mouseclick()=1 then position camera camera position x(),camera position y()-0.07,camera position z()
if mouseclick()=2 then position camera camera position x(),camera position y()+0.07,camera position z()
return`end of game gosub*******************************
make_world:
`*1st get images used as textures :)*
for n=1 to 500
ink rgb(rnd(255),rnd(255),rnd(255)),0
circle rnd(640),rnd(480),rnd(5)
next n
get image 1,0,0,640,480
cls
for n2=1 to 500
ink rgb(rnd(255),rnd(255),rnd(255)),rnd(255)
line rnd(1000),rnd(900),rnd(1200),rnd(1200)
next n2
get image 2,320,320,640,480
cls
`*build room*
`floor
make object box 1,100,1,100 : color object 1,rgb(200,0,0)
`left wall
make object box 2,2,10,100 : position object 2,-50,5,0
make object box 3,2,20,35 : position object 3,-50,20,-32
instance object 4,3 : position object 4,-50,20,32
for n=2 to 4
color object n,rgb(0,0,90)
next n
`ceiling
clone object 5,1 : position object 5,0,30,0 : color object 5,rgb(192,192,192)
`back wall
make object box 6,100,30,2 : position object 6,0,15,-50
color object 6,rgb(0,0,90)
`right wall
instance object 7,2 : position object 7,50,5,0
instance object 8,3 : position object 8,50,20,-32
instance object 9,3 : position object 9,50,20,32
for n=7 to 9
color object n,rgb(0,0,90)
next n
`front wall
make object box 10,40,30,2 : position object 10,-30,15,50
instance object 11,10 : position object 11,30,15,50
for n=10 to 11
color object n,rgb(0,0,90)
next n
`door
make object box 12,18.5,29,2 : position object 12,0,15,50
color object 12,rgb(128,90,20)
`window sills
make object box 13,4,4,35 : position object 13,-50,10,0
instance object 14,13 : position object 14,50,10,0
`windows
make object box 15,4,18,30 : position object 15,-50,21,0
make object box 16,4,18,30 : position object 16,50,21,0
for n=15 to 16
color object n,rgb(0,50,190)
ghost object on n
next n
`*player*
`head
make object sphere 17,4
`hair
make object cube 18,3.5 : xrotate object 18,40
`neck
make object cube 19,1 : position object 19,0,-2,0
color object 19,rgb(255,180,145)
`torso
make object box 20,3.2,6,2.5 : position object 20,0,11.7,0
color object 20,rgb(50,90,190)
`right arm
make object box 21,1.2,7,1.2 : zrotate object 21,30
`left arm
make object box 22,1.2,7,1.2 : zrotate object 22,-30
`right leg
make object box 23,1.4,10,2 : zrotate object 23,10
`left leg
make object box 24,1.4,10,2 : zrotate object 24,-10
`skeleton
make mesh from object 1,20`torso mesh
make mesh from object 2,17`head
make mesh from object 3,18`hair
make mesh from object 4,21`right arm
make mesh from object 5,22`left arm
make mesh from object 6,23`right leg
make mesh from object 7,24`left leg
`torso
add limb 20,1,1 : hide limb 20,1
`head
add limb 20,2,2 : offset limb 20,2,0,5.5,-0.4 : color limb 20,2,rgb(255,180,145)
`hair
add limb 20,3,3 : offset limb 20,3,0,6.5,-1.2 : color limb 20,3,rgb(128,80,10)
`neck
glue object to limb 19,20,2
`right arm
add limb 20,4,4 : offset limb 20,4,3.2,0,0 : color limb 20,4,rgb(255,180,145)
`left arm
add limb 20,5,5 : offset limb 20,5,-3.2,0,0 : color limb 20,5,rgb(255,180,145)
`right leg
add limb 20,6,6 : offset limb 20,6,1.8,-7.4,0 : color limb 20,6,rgb(200,220,190)
`left leg
add limb 20,7,7 : offset limb 20,7,-1.8,-7.4,0 : color limb 20,7,rgb(200,220,190)
`delete unused objects & meshes
delete object 17 : delete object 18
for del=21 to 24
delete object del
next del
for del=1 to 7
delete mesh del
next del
`*interactive stuff*
`picture1
make object box 24,15,13,1 : position object 24,27,15,48
texture object 24,1
`picture 2
clone object 25,24 : texture object 25,2 : position object 25,0,15,-47
`table
make object box 26,30,2,20 : position object 26,-30,10,-20
color object 26,rgb(55,28,0)
`legs
make object box 27,2,8,2 : position object 27,-40,4.7,-28
color object 27,rgb(128,64,0)
instance object 28,27 : position object 28,-40,4.7,-11
instance object 29,27 : position object 29,-19,4.7,-11
instance object 30,27 : position object 30,-19,4.7,-28
`chair
make object box 31,7,2,7 : position object 31,-23,4.85,-37
make object box 32,1,3.2,1 : position object 32,-26,2.2,-40
instance object 33,32 : position object 33,-21,2.2,-40
instance object 34,32 : position object 34,-23,2.2,-34
make object box 35,8,8,2 : position object 35,-23,10,-40
for n=31 to 35
color object n,rnd(90000)
next n
`small table
make object cube 36,5 : position object 36,35,3.2,35
make object box 37,10,1,10 : position object 37,35,6.2,35
make object box 38,3,9,3 : position object 38,35,11.4,35
color object 36,rnd(90000)
color object 37,rgb(0,0,120) : ghost object on 37
color object 38,rnd(90000)
`ball to pickup & (throw) ;p
make object sphere 39,3 : position object 39,40,2,-38
color object 39,rnd(120000)
`statics to hold curtains
make object box 40,1,5,11 : position object 40,-48,30,13
instance object 41,40 : position object 41,48,30,-13
`hidden dynamic to attach to ball
make object sphere 43,3 : position object 43,40,2,-38
hide object 43
`statics to hold pictures up
make object box 44,18,0.5,15 : position object 44,27,8.1,54
instance object 45,44 : position object 45,0,8.2,-54
`hidden object for colliding with ball
make object cube 46,3 : hide object 46
`*lighting*
color ambient light 0
make light 1 : set point light 1,-25,25,25
`*outside scenery*
make object box 5000,1000,2,1000 : position object 5000,0,-2,0
color object 5000,rgb(0,200,0)
`tree1
make object box 5001,15,150,18 : position object 5001,-180,0,10
color object 5001,rgb(128,64,0)
make object sphere 5002,90 : position object 5002,-180,60,10
color object 5002,rgb(0,240,0) : scale object 5002,120,30,110
`tree 2
instance object 5003,5001 : position object 5003,180,0,-10
instance object 5004,5002 : position object 5004,180,57,-10
scale object 5004,130,40,135
`door hinge :p
make object sphere 101,5 : position object 101,-10,15,50
`*set up physics*
phy start
`main building
for n=1 to 11
phy make rigid body static box n
next n
`door
phy make rigid body dynamic box 12
`interactive stuff
for n=24 to 38
phy make rigid body dynamic box n
next n
`curtain holders
for n=40 to 41
phy make rigid body static box n
next n
`curtains :)
phy make cloth 42
phy set cloth dimensions 42,31,10,1
phy set cloth position 42,-48,30,6.5
`completely copied this part from tgc demo
`so i dont deserve any credit for this part
phy set cloth friction 42,0.5
phy set cloth tearing 42,1
phy set cloth tear factor 42,2.2
phy set cloth bending 42,1
phy set cloth two way collision 42,1
`------------------------------------
phy build cloth 42
phy attach cloth to shape 42,40,1
color object 42,rgb(200,128,40)
`hidden dynamic ball
phy make rigid body dynamic sphere 43
`holds pictures up
for n=44 to 45
phy make rigid body static box n
hide object n
next n
`players collision box :)
make object cube 100,5 : position object 100,0,5,0
hide object 100
phy make rigid body dynamic box 100
`door code
phy make revolute joint 1,10,12,0,10,0,-10,15,50
return
`******************** end of gosubs ******************
`end of code--------------