CodeBase - Lecon 1 pour 3d

Return to the CodeBase listing

Category: Complete Applications

Version: 1.0

0
0

Information

Uploaded: 1st Mar 2005 00:26

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 `--------------------------- `Limit Rush `Lesson 01 `--------------------------- `http://www.binarymoon.co.uk `Ben aka Mop `--------------------------- `-------- `INCLUDES `-------- `include the MatEdit LoadMatrix files #include "LoadMatrix.dba" `------ `ARRAYS `------ `declare the MatEdit variables Dim BigMatrix(600,600,1) Dim StartLoc_X(1): Dim StartLoc_Z(1):Dim Info(2) Dim TArrayX(1): Dim TArrayZ(1): Dim FKey(10,1) Dim ColData(100): Dim ZoneData(100): Dim Tiles(500,500) Dim OverTexture$(100): Dim OverName$(20): Dim ReplaceTex(100) Dim MOffsetX(25): Dim MOffsetY(25) Dim MWire(20): Dim MGhost(20): Dim Lock(20) Dim MatX#(20): Dim MatY#(20): Dim MatZ#(20) Dim MatWidth#(20): Dim MatHeight#(20) Dim TilesX(20): Dim TilesZ(20) Dim MatHi#(20): Dim MatLo#(20) `set up the program sync on sync rate 40 hide mouse `load the matrix LoadMatrix("map",1) `--------- `MAIN LOOP `--------- main: do `the following is temporary. There will be more but it will made later `get keyboard input for movement if upkey()=1 then move camera 4 if downkey()=1 then move camera -4 if leftkey()=1 then yrotate camera wrapvalue(camera angle y()-4) if rightkey()=1 then yrotate camera wrapvalue(camera angle y()+4) `sort out the camera height x#=camera position x() z#=camera position z() y#=get ground height(1,x#,z#)+10 `position the camera position camera x#,y#,z# `update the screen sync 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 /> `---------------------------<br /> `Limit Rush<br /> `Lesson 01<br /> `---------------------------<br /> `http://www.binarymoon.co.uk<br /> `Ben aka Mop<br /> `---------------------------<br /> <br /> `--------<br /> `INCLUDES<br /> `--------<br /> `include the MatEdit LoadMatrix files<br /> #include &quot;LoadMatrix.dba&quot;<br /> <br /> `------<br /> `ARRAYS<br /> `------<br /> `declare the MatEdit variables<br /> Dim BigMatrix(600,600,1)<br /> Dim StartLoc_X(1): Dim StartLoc_Z(1):Dim Info(2)<br /> Dim TArrayX(1): Dim TArrayZ(1): Dim FKey(10,1)<br /> Dim ColData(100): Dim ZoneData(100): Dim Tiles(500,500)<br /> Dim OverTexture$(100): Dim OverName$(20): Dim ReplaceTex(100)<br /> Dim MOffsetX(25): Dim MOffsetY(25)<br /> Dim MWire(20): Dim MGhost(20): Dim Lock(20)<br /> Dim MatX#(20): Dim MatY#(20): Dim MatZ#(20)<br /> Dim MatWidth#(20): Dim MatHeight#(20)<br /> Dim TilesX(20): Dim TilesZ(20)<br /> Dim MatHi#(20): Dim MatLo#(20)<br /> <br /> `set up the program<br /> sync on<br /> sync rate 40<br /> hide mouse<br /> <br /> `load the matrix<br /> LoadMatrix(&quot;map&quot;,1)<br /> <br /> `---------<br /> `MAIN LOOP<br /> `---------<br /> main:<br /> do<br /> `the following is temporary. There will be more but it will made later<br /> `get keyboard input for movement<br /> if upkey()=1 then move camera 4<br /> if downkey()=1 then move camera -4<br /> if leftkey()=1 then yrotate camera wrapvalue(camera angle y()-4)<br /> if rightkey()=1 then yrotate camera wrapvalue(camera angle y()+4)<br /> <br /> `sort out the camera height<br /> x#=camera position x()<br /> z#=camera position z()<br /> y#=get ground height(1,x#,z#)+10<br /> <br /> `position the camera<br /> position camera x#,y#,z#<br /> <br /> `update the screen<br /> sync<br /> loop

Comments

No comments yet.