TGC Codebase Backup



3D Screensaver by Daygamer

6th Mar 2009 14:18
Summary

Watch the boxes bounce around in the giant cube. No Media!



Description

Yo, how's it going? I think this program could be a screensaver. The program is several colorful boxes bouncing off the walls of a big cube. You can watch different boxes or make the boxes move really fast by using the number keys. Have a nice day!



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    sync on : sync rate 60
hide mouse
camera = 0
make object cube 1,0.1
make object cube 11,0.1
make object cube 12,0.1
make object cube 13,0.1
make object cube 14,0.1
make object cube 15,0.1
make object cube 16,0.1
make object cube 17,0.1
color object 1,rgb(850000,100000,850000)
color object 12,rgb(1000,10,10)
color object 13,rgb(500,500,0)
color object 14,rgb(10,10,1000)
color object 15,rgb(10,1000,10)
color object 16,0
point object 11,0,0,-5
point object 12,0,-5,0
point object 13,0,5,0
point object 14,5,0,0
point object 15,-5,0,0
point object 16,5,5,5
point object 17,-5,-5,-5
make object box 2,10,10,1
position object 2,0,0,-5
color object 2,rgb(1000,10,10)
make object box 3,1,10,10
position object 3,-5,0,0
color object 3,rgb(500,500,0)
make object box 4,10,10,1
position object 4,0,0,5
color object 4,rgb(10,10,1000)
make object box 5,1,10,10
position object 5,5,0,0
color object 5,rgb(10,1000,10)
make object box 6,10,1,10
position object 6,0,5,0
make object box 7,10,1,10
position object 7,0,-5,0
color object 7,0
make object box 10,1,1,1
set object collision to boxes 10
camera = 1

do
move object 1,0.04
move object 11,0.04
move object 12,0.04
move object 13,0.04
move object 14,0.04
move object 15,0.04
move object 16,0.04
move object 17,0.04
if inkey$()="9" then move object 1,1 : move object 11,1 : move object 12,1 : move object 13,1 : move object 14,1 : move object 15,1 : move object 16,1 : move object 17,1

if object collision(1,2) or object collision(1,3) or object collision(1,4) or object collision(1,5) or object collision(1,6) or object collision(1,7) or object collision(1,10) then point object 1,rnd(5),rnd(5),rnd(5)
if object collision(11,2) or object collision(11,3) or object collision(11,4) or object collision(11,5) or object collision(11,6) or object collision(11,7) or object collision(11,10) then point object 11,rnd(5),rnd(5),rnd(5)
if object collision(12,2) or object collision(12,3) or object collision(12,4) or object collision(12,5) or object collision(12,6) or object collision(12,7) or object collision(12,10) then point object 12,rnd(5),rnd(5),rnd(5)
if object collision(13,2) or object collision(13,3) or object collision(13,4) or object collision(13,5) or object collision(13,6) or object collision(13,7) or object collision(13,10) then point object 13,rnd(5),rnd(5),rnd(5)
if object collision(14,2) or object collision(14,3) or object collision(14,4) or object collision(14,5) or object collision(14,6) or object collision(14,7) or object collision(14,10) then point object 14,rnd(5),rnd(5),rnd(5)
if object collision(15,2) or object collision(15,3) or object collision(15,4) or object collision(15,5) or object collision(15,6) or object collision(15,7) or object collision(15,10) then point object 15,rnd(5),rnd(5),rnd(5)
if object collision(16,2) or object collision(16,3) or object collision(16,4) or object collision(16,5) or object collision(16,6) or object collision(16,7) or object collision(16,10) then point object 16,rnd(5),rnd(5),rnd(5)
if object collision(17,2) or object collision(17,3) or object collision(17,4) or object collision(17,5) or object collision(17,6) or object collision(17,7) or object collision(17,10) then point object 17,rnd(5),rnd(5),rnd(5)

center text 320,10,"DAY GAMES 3D SCREEN SAVER"
center text 320,30,"Press the number keys 1-8 to watch different cubes"
center text 320,50,"Hold down 9 to make the cubes go crazy"
if inkey$()="1" then Camera = 1
if inkey$()="2" then Camera = 2
if inkey$()="3" then Camera = 3
if inkey$()="4" then Camera = 4
if inkey$()="5" then Camera = 5
if inkey$()="6" then Camera = 6
if inkey$()="7" then Camera = 7
if inkey$()="8" then Camera = 8
if Camera = 1 then X1# = Object position x(1) : Z1# = Object position z(1) : Y1# = Object position y(1)
if Camera = 2 then X1# = Object position x(11) : Z1# = Object position z(11) : Y1# = Object position y(11)
if Camera = 3 then X1# = Object position x(12) : Z1# = Object position z(12) : Y1# = Object position y(12)
if Camera = 4 then X1# = Object position x(13) : Z1# = Object position z(13) : Y1# = Object position y(13)
if Camera = 5 then X1# = Object position x(14) : Z1# = Object position z(14) : Y1# = Object position y(14)
if Camera = 6 then X1# = Object position x(15) : Z1# = Object position z(15) : Y1# = Object position y(15)
if Camera = 7 then X1# = Object position x(16) : Z1# = Object position z(16) : Y1# = Object position y(16)
if Camera = 8 then X1# = Object position x(17) : Z1# = Object position z(17) : Y1# = Object position y(17)

color object 17,rgb(rnd(1000),rnd(1000),rnd(1000))

Position Camera 0,0,0
Point camera X1#,Y1#,Z1#
sync
loop