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

C Game Logic

Name: Anonymous 2012-03-22 6:28

How should I setup my game logic in C?  I'm not entirely sure how I can set it up without using classes.

For example, in C++ it works like:
MainMenuWorld and LevelWorld both extend WorldBase class.

WorldBase *TargetWorld;

TargetWorld = new MainMenuWorld();
//or
TargetWorld = new LevelWorld();

Then, for the logic:

TargetWorld -> input(event);
...
TargetWorld -> draw();
...
TargetWorld -> update();

Should I use a variable to determine what to render? i.e. 1 = MainMenuWorld, 2 = LevelWorld, etc. That feels like it might be a bit of a performance problem though, so I'm not exactly sure. I'm also using C because the psp homebrew compiler doesn't like C++.

I was thinking having methods that work like "ChangeWorld(Worlds::MainMenu);" but I'm not really sure what I should have the method do.

Name: Anonymous 2013-03-02 11:19

`
* progrider 's face when he realizes the unicode spammer was dropping base-110117 encoded bins all over the place this whole time.

Name: Anonymous 2013-03-02 11:20

>>32
Oh fuck.

Name: Anonymous 2013-03-02 12:01

>>32

Oh fuck.

Name: Anonymous 2013-03-02 12:33

>>32
Oh fuck.

Name: Anonymous 2013-03-02 12:37

>>32

Oh fuck.

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