Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Games

Name: Anonymous 2007-11-05 10:50

// main.cpp
//

#include "game.hpp"

int main()
{
    Game * game = Game::instance();
    game.initialize();
    while( game.end == false )
    {
        game.control();
        game.handle();
        game.draw();
    }
}

Hey /prog/, when you code the main function of a game, what does it look like?
Do you know some good sourcecode of a game where I could learn from?

Name: Anonymous 2007-11-05 10:51

whoops did a mistake with the pointer:

int main()
{
    Game * game = Game::instance();
    game->initialize();
    while( game->end == false )
    {
        game->control();
        game->handle();
        game->draw();
    }
}

Name: Anonymous 2007-11-05 10:51

THIS IS HOW WE CODE GAMES AT EXPERTSVILLE, SATORI:

||
||
||
||
||

Name: Anonymous 2007-11-05 11:00

(defun main-loop ()
  (loop
     (draw-screen)
     (do-keyboard)
     (if *quit-to-repl*
     (progn (setf *quit-to-repl* nil)
        (return)))
     (update-viewport)))

Name: Anonymous 2007-11-05 17:32

Op here is the proper way(Yes this is equivalent, except I put in printf's instead of function calls):

#include <stdio.h>

int main(char foo){
   switch(foo){
      case ('b' - 'a' + 1):
         {
        printf("Init\n");
     }
     goto HELLO;
      case 'a'*2/('c' - 'a'):
         printf("Controls\n");
     break;
      case 0x1 + 0x1 + 0x1:
           goto HELLO;
   }

   if( foo == 99  && printf("Handle\n") && printf("Draw\n"));
HELLO:  
   main(++foo );
}

Name: Anonymous 2007-11-06 5:50

Serialized code FTL, unicore faggots.

Name: Anonymous 2007-11-06 6:57

Her'es my game of magic:
(loop (print (eval (read))))
you can cast all sorts of spels

Name: Anonymous 2007-11-06 7:30

>>7
Win, except for misspeling spells

Name: Anonymous 2007-11-06 7:42

>>8
CASTINGS SPELS IN LISP YOU FAGGOT

Name: Anonymous 2007-11-06 10:11

>>9
how do i spel corectly?

Name: Anonymous 2007-11-06 11:22

>>10
Do you really need to have it SPELed out?

http://www.lisperati.com/casting.html

Name: Anonymous 2011-02-02 23:18

Name: Anonymous 2011-02-03 3:13

Name: Anonymous 2013-01-19 0:09

/prog/ will be spammed continuously until further notice. we apologize for any inconvenience this may cause.

Don't change these.
Name: Email:
Entire Thread Thread List