Wednesday, March 21, 2012

And now I live on BlogSpot

I was using Tumblr, but I couldn't make it do the things I wanted to. In particular, I couldn't make it format code the way I wanted it to be formatted.

1:  //Scribbles.cpp  
2:  //if some one knows how to quote code better than this, I would be very happy  
3:  //http://www.mediafire.com/?ba62kkx78ft8p <-Scribbles.cpp and Scribbles.exe  
4:  //most of my code for now will probably use DarkGDK for now. it’s a very simple  
5:  //free c++ engine  
6:  #include “DarkGDK.h”   
7:  #define SCREENX 640  
8:  #define SCREENY 480  
9:  void Render()  
10:  {  
11:       dbText(0,0,”Press Space!”);  
12:       dbSync();  
13:  }  
14:  void DarkGDK ( void )  
15:  {  
16:       dbSyncOn  ( );  
17:       dbSyncRate ( 0 );  
18:       int x = dbRND(SCREENX);  
19:       int y = dbRND(SCREENY);  
20:       int LOOPS = 0;  
21:       // our main loop  
22:       while ( LoopGDK ( ) )  
23:       {  
24:            LOOPS++;  
25:            if(LOOPS == 60)  
26:            {  
27:                 Render();  
28:                 dbClear(0,0,0);  
29:                 LOOPS = 0;  
30:            }  
31:            int newX = x;  
32:            int newY = y;  
33:            x = dbRND(SCREENX);  
34:            y = dbRND(SCREENY);  
35:            dbInk(dbRGB(dbRND(256),dbRND(256),dbRND(256)),dbRGB(0,0,0));  
36:            dbLine(x,y,newX,newY);  
37:            if(dbKeyState(57))  
38:            {  
39:                 Render();  
40:            }  
41:       }  
42:       return;  
43:  }  

No comments:

Post a Comment