The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
gfdg
Posted by: fdsaf | March 14, 2010 @ 1:27pm
C++ Code
[
Download
]
#include "DarkGDK.h" #include "Gui.H" void DarkGDK ( void ) { dbSyncOn ( ); dbSyncRate ( 60 ); dbSetCameraRange ( 1, 1000000 ); dbRandomize ( dbTimer ( ) ); ////Temp reference object int stuff = 1; dbMakeObjectSphere (stuff, 10); dbColorObject(stuff,dbRgb(255,255,0)); dbPositionObject(stuff, 0,0,0); ////Camera and GUI stuff dbPositionCamera(0,0,0); dbSetCursor (0,30); LoadGui(); ////Variable Definitions //Position double x = 0; double y = 0; double z = 0; //Thrust double cT = 0; double xT = 0; double yT = 0; double zT = 0; //Speed double cS = 0; double xS = 0; double yS = 0; double zS = 0; //More Speed double sx; double sy; double sz; //More Speed double xs; double ys; double zs; //Camera Angles double aX; double aY; double aZ; //Vectors int Vxyz; int Vs; dbMakeVector4(Vxyz); dbMakeVector4(Vs); while ( LoopGDK ( ) ) { ////Speed Readouts //* dbSetCursor(0,30); dbPrint(cS); dbPrint(xS); dbPrint(yS); dbPrint(zS); dbPrint(cT); dbPrint(xT); dbPrint(yT); dbPrint(zT); dbPrint(aY); dbPrint(aZ); //*/ //Get Camera Angle aX = dbCameraAngleX(); aY = dbCameraAngleY(); aZ = dbCameraAngleZ(); ////Place Camera dbPositionCamera(x,y,z); ////Controls //Reference //dbKeyState () - Check if key defined by scancode is pressed //dbScanCode () - Print Scancode of pressed key if ( dbKeyState (44) ) cT += 0.2; if ( dbKeyState (45) ) cT -= 0.2; if ( dbSpaceKey() ) cT = 0; if ( dbKeyState (30 ) ) dbTurnCameraLeft(1); if ( dbKeyState ( 32 ) ) dbTurnCameraRight(1); if ( dbKeyState (31) ) dbPitchCameraUp(1); if (dbKeyState (17) ) dbPitchCameraDown(1); if ( dbShiftKey () ) dbMoveObject (stuff,0.1); ////Speed Limits ////Vector Stuff dbSetVector3( Vs, dbCameraAngleX() ,dbCameraAngleY() ,dbCameraAngleZ() ); ////Movement dbSync ( ); } return; }
Syntax Highlighting
[
Open in new window
]
Author Comments
none
Rating
4.32 / 8
53 Votes
http://codebin.yi.org/548
page generated in 0.00 seconds