Home | Rules and Guide | Sign In/Create Account | Write a Post | Donate | #ludumdare on irc.afternet.org (Info)

Ludum Dare 23 — April 20th-23rd, 2012 — 10 Year Anniversary!

Ludum Dare 22 :: December 16th-19th, 2011 :: Theme: Alone

[ Results: Top 50 Compo, Jam | Top 25 Categories | View My Entry ]

[ View All (Compo, Jam) | Warmup ]


LD14 Basecode

Posted by of Platymuus (twitter: @SpaceManiacX)
April 17th, 2009 2:11 pm

With PlatyGame in hand, I’ve got some simplified basecode ready.

#include <PlatyGame.h>
using namespace PlatyGame;

int main (int argc, char* argv[]) {
if (!initialize())
return 1;
atexit(shutdown);
if (!initText())
return 2;
atexit(shutdownText);
if (!initSound())
return 3;
atexit(shutdownSound);

bool fullscreen = false;
if(argc > 1) {
if(strcmp(argv[1], “fullscreen”) == 0) {
fullscreen = true;
}
}

Screen screen(800, 600, “Game”, fullscreen);
if (!screen.good())
return 4;

Sound snd(“snd/platymuus.wav”);
BitmapSprite splash(“gfx/platymuus.png”);
splash_run(screen, splash, snd, 4);

return 0;
}

Tags: , , ,

Leave a Reply

You must be logged in to post a comment.


All posts, images, and comments are owned by their creators.

[fcache: storing page]