CodeBase - Water snake

Return to the CodeBase listing

Category: Complete Applications

Version: 1.0

0
0

Information

Uploaded: 1st Mar 2005 00:36

Modified: 1st Jan 1970 01:00

Author:  Anonymous Coder

Summary

` This code was downloaded from The Game Creators ` It is reproduced here with full permission ` http://www.thegamecreators.com ` WaterSnake by Neil Houlden ` I haven't finished this yet, but take a look: `Show the title screen: center text screen width()/2,6, " __ ____ ___ __ " center text screen width()/2,18, "========== / / /_/ / /_ /_/ ==========" center text screen width()/2,30, "========== /_/_/ / / / /__ / | ==========" center text screen width()/2,40, " " center text screen width()/2,50, " ###### ## ## ### ## ## #######" center text screen width()/2,60, "## ## ### ## ## ## ## ## ## " center text screen width()/2,70, "## #### ## ## ## ## ## ## " center text screen width()/2,80, " ###### ## ## ## ## ## #### #######" center text screen width()/2,90, " ## ## #### ######### ## ## ## " center text screen width()/2,100, "## ## ## ### ## ## ## ## ## " center text screen width()/2,110, " ###### ## ## ## ## ## ## #######" center text screen width()/2,120, " " center text screen width()/2,130, " ============================================= " center text screen width()/2,150, " By Neil Houlden www.neilsdemo.tk " center text screen width()/2,170, " ============================================= " center text screen width()/2,280, "Use you're mouse to control the Water Snake." center text screen width()/2,290, "Press any key to Continue" center text screen width()/2,400, " - neilio_omnipotent@yahoo.co.uk -" wait key cls input "enter the length of the snake (I usually use 300): " ,bodylength `set Frame Rate sync rate 20 `hide the mouse hide mouse `make ground (So I can see how fast I'm going) make object plain 1,100,100 xrotate object 1,90 set object wireframe 1,1 `make the head make object sphere 2,4 color object 2,rgb(0,255,50) `Prepare to make body parts t=3 partcolor=1 `The body part making loop for t=3 to bodylength `Make a body part make object sphere t,3 ` color it if partcolor=1 partcolor=2 color object t,rgb(0,100,0) else partcolor=1 color object t,rgb(0,255,50) endif next t ` game loop do `Control the way the head faces by moving the mouse yrotate object 2,object angle y(2)+ (mousemovex()/2) xrotate object 2,object angle x(2)+ (mousemovey()/2) if object angle x(2)<-90 xrotate object 2,object angle x(2)-object angle x(2) xrotate object 2,-90 endif if object angle x(2)>90 xrotate object 2,object angle x(2)-object angle x(2) xrotate object 2,90 endif ` position the bits t=bodylength for a=4 to bodylength position object t,object position x(t-1),object position y(t-1),object position z(t-1) t=t-1 next a `this want's to be outside the loop because the last body part has to be attatched to the head. position object 3, object position x(2),object position y(2),object position z(2) `move the head in the direction it's facing move object 2,1 `put the camera in the right place. set camera to follow object position x(2),object position y(2),object position z(2),object angle y(2),50,object position y(2)+10,5,1 point camera object position x(2),object position y(2),object position z(2) loop

Full Description

` This code was downloaded from The Game Creators<br /> ` It is reproduced here with full permission<br /> ` http://www.thegamecreators.com<br /> <br /> ` WaterSnake by Neil Houlden<br /> ` I haven't finished this yet, but take a look:<br /> <br /> `Show the title screen:<br /> center text screen width()/2,6, &quot; __ ____ ___ __ &quot;<br /> center text screen width()/2,18, &quot;========== / / /_/ / /_ /_/ ==========&quot;<br /> center text screen width()/2,30, &quot;========== /_/_/ / / / /__ / | ==========&quot;<br /> center text screen width()/2,40, &quot; &quot;<br /> center text screen width()/2,50, &quot; ###### ## ## ### ## ## #######&quot;<br /> center text screen width()/2,60, &quot;## ## ### ## ## ## ## ## ## &quot;<br /> center text screen width()/2,70, &quot;## #### ## ## ## ## ## ## &quot;<br /> center text screen width()/2,80, &quot; ###### ## ## ## ## ## #### #######&quot;<br /> center text screen width()/2,90, &quot; ## ## #### ######### ## ## ## &quot;<br /> center text screen width()/2,100, &quot;## ## ## ### ## ## ## ## ## &quot;<br /> center text screen width()/2,110, &quot; ###### ## ## ## ## ## ## #######&quot;<br /> center text screen width()/2,120, &quot; &quot;<br /> center text screen width()/2,130, &quot; ============================================= &quot;<br /> center text screen width()/2,150, &quot; By Neil Houlden www.neilsdemo.tk &quot;<br /> center text screen width()/2,170, &quot; ============================================= &quot;<br /> center text screen width()/2,280, &quot;Use you're mouse to control the Water Snake.&quot;<br /> center text screen width()/2,290, &quot;Press any key to Continue&quot;<br /> center text screen width()/2,400, &quot; - neilio_omnipotent@yahoo.co.uk -&quot;<br /> wait key<br /> cls<br /> input &quot;enter the length of the snake (I usually use 300): &quot; ,bodylength<br /> <br /> <br /> `set Frame Rate<br /> sync rate 20<br /> <br /> `hide the mouse<br /> hide mouse<br /> <br /> `make ground (So I can see how fast I'm going)<br /> make object plain 1,100,100<br /> xrotate object 1,90<br /> set object wireframe 1,1<br /> <br /> `make the head<br /> make object sphere 2,4<br /> color object 2,rgb(0,255,50)<br /> <br /> `Prepare to make body parts<br /> t=3<br /> partcolor=1<br /> <br /> `The body part making loop<br /> for t=3 to bodylength<br /> `Make a body part<br /> make object sphere t,3<br /> ` color it<br /> if partcolor=1<br /> partcolor=2<br /> color object t,rgb(0,100,0)<br /> else<br /> partcolor=1<br /> color object t,rgb(0,255,50)<br /> endif<br /> next t<br /> <br /> <br /> ` game loop<br /> do<br /> `Control the way the head faces by moving the mouse<br /> yrotate object 2,object angle y(2)+ (mousemovex()/2)<br /> xrotate object 2,object angle x(2)+ (mousemovey()/2)<br /> if object angle x(2)&lt;-90<br /> xrotate object 2,object angle x(2)-object angle x(2)<br /> xrotate object 2,-90<br /> endif<br /> if object angle x(2)&gt;90<br /> xrotate object 2,object angle x(2)-object angle x(2)<br /> xrotate object 2,90<br /> endif<br /> <br /> ` position the bits<br /> t=bodylength<br /> for a=4 to bodylength<br /> position object t,object position x(t-1),object position y(t-1),object position z(t-1)<br /> t=t-1<br /> next a<br /> <br /> <br /> `this want's to be outside the loop because the last body part has to be attatched to the head.<br /> position object 3, object position x(2),object position y(2),object position z(2)<br /> <br /> `move the head in the direction it's facing<br /> move object 2,1<br /> `put the camera in the right place.<br /> set camera to follow object position x(2),object position y(2),object position z(2),object angle y(2),50,object position y(2)+10,5,1<br /> point camera object position x(2),object position y(2),object position z(2)<br /> loop

Comments

No comments yet.