Posts Tagged ‘C++’
Let’s make this one the best we’ve had thus far.
Alright. So this’ll be my real first official LD. Last time, I was a noob coder, had no engine or other code-base, had only 3 hours, blah blah blah.
This time it’s going down.
Tools:
Music – FL Studio 10
Language – C++
Libraries – SFML 2.0 and possibly Box2D, along with a small quick-prototype code-base.
Art – Photoshop CS5 and maybe my camera
Sound Effects – Audacity + Microphone
(Will link the code-base here when it’s finished.)
Let’s do this, and do it right.
I’m in.
~ BurnZeZ
Still standing!
Hey. I’ve decided that for my game I might just go back to the roots of games like ZORK and Colossal Cave Adventure.
Expect hardcore getch() action!
Yet another first-timer
Well, let me add myself to the giant list of new folks for the upcoming LD #20. I dropped by the IRC room last night and got some nice advice on useful tools and whatnot… thanks everyone. A snag though! I realized this morning that I’m actually moving that weekend! This might not be as big a deal as it initially seems, though, as I’m only moving to the other side of the same building I’m already in, and I’m already pretty well packed up; it just means some valuable time is going to be eaten up by lugging boxes. I still plan to compete!
I plan on using a SDL-based sprite framework that I’ve been working on lately… right now it’s in an unusable state though (being moved from using SDL blitting to sprites as textures in OpenGL). Assuming it’s fixed in time for the competition, I’ll post the code somewhere for y’all so that I’m within the rules and whatnot.
Uuuhh… yup! Nice to meet you all! Let’s have us some fun!
EDIT: Aaand… that SDL->OpenGL conversion I mentioned? I think I’ gonna abort it and instead move to SFML. I’ve been reading about it some today and it really seems like the way to go. There’re benefits to working with SDL and learning how things like blitting work, of course, but if the API for SFML is as much better than SDL as people are making it seem, it would really speed things up for me… in addition to saving me from having to link in extra libraries for some of the stuff I’m doing. I’m pretty sure this is one of the useful things someone told me about last night on IRC, but I never managed to get around to looking at it at the time because I was too busy playing with bfxr! I should have listened to y’all better! Belated thanks!
You can count on me!
I’m in… and I’m not sure what kind of framework or language I’ll be using. I was planning to go with html5 and made some smaller tests, but giving that I couldn’t get sound working in a working state for the stable version of my main browser(the firefox 4 beta is awesome!) I’ll go with the tried and tested. This means, in my case, C++ if I get my current framework to a working state or flixel if not.
Foreach in c++
Hi
I created simple helper that might help few of you who use c++ with STL. It adds foreach to the c++ that traverses over all of the STL container, so the code is more readable, like in this example:
#include <cstdio>
#include <vector>
#include "foreach.h"
int main()
{
// make int vector and fill it
vector<int> k;
for (int i=0; i<10; ++i) k.push_back(i);
// show what the upper loop filled
foreach_ (it, k) printf("%i ",(*it));
printf("\n");
// show all the data, but get rid of 4
// http://en.wikipedia.org/wiki/Tetraphobia![]()
foreachdel_ (it, k)
{
if (*it == 4) it=k.erase(it);
printf("%i ",(*it));
}
printf("\n");
return 0;
}
Will result in following:
0 1 2 3 4 5 6 7 8 9
0 1 2 3 5 6 7 8 9
More on my blog: http://pleasanthacking.com/2010/06/17/foreach-in-cpp/
I hope some of you will find it useful during compos
Isaiah Mustafa – The man your game could smell like. 2hr mini mini pre-LD18
Okay, inspired by the 2hr warm up game idea from IRC, I made a 2hr game based on the best (but sadly downvoted into oblivion) theme “Isaiah Mustafa – The man your game could smell like”.
It was made in a little over 2 hours since I was a bit distracted and getting it all to package up took some finagling (good test of my pipeline though), but here it is:
Windows (Linux may come later)
The goal is very simple (and not terribly fun); avoid the green “Double Rainbow Body Wash” boxes, and collect the red Old Spice ones to reach 100%.


My Secret Weapon for LD #18
I’ve spent a little time creating some template code for the next LD event, after failing at LD #17. I wanted to share this, in case any other Linux devs can benefit.
My template doesn’t do much, which is sort of the point given the nature of Ludum Dare. I wanted to gather up some basic functionality that I consider to be fair to use, and probably already available to many other LD’ers using existing game engines like OGRE, etc. Using this I hope to be able to get a quicker start during the events.
I’m using Linux, C++, CMake, SFML, GLee, OpenGL, and OpenAL. Here are the features I’m going for:
- Get a window up on the screen. Admittedly, this isn’t too hard thanks to SFML.
- Load music / sound files from disk, and play them.
- Load UV texture-mapped 3D objects exported from Blender (http://blender.org/) and display them using OpenGL VBOs. The Blender export script I’ve created is included.
- Render bitmapped fonts using image files loaded from disk.
- Build either a Linux or Windows executable by changing a CMake flag (I have a mingw32 cross compilation set up, installed).
You can download my template here: ld48_template.tar.gz
If you can use this, or have time to build the sample app and give me some feedback, that would be awesome. Thanks!
-Windsor
P.S. I just read PoV’s post about packaging Linux applications. I’ll have to put some of those techniques to use in the next version of my template.

Take 2…
So I tried LD last time and didn’t quite finish my project in time (my failure post), and I’m going to have another go at it this time…
As before I’ll be making something 3D and using C++. I’ll be using Ogre for rendering, irrKlang for audio, OIS for input, Bullet for collision detection/physics and maybe Chaiscript for some scripting goodness.
Last time I used the beginnings of an engine I was writing, but it became sort of a hassle to work with something meant for a much larger project, so I’m starting from scratch this time; though I will probably hack up a quick bit of base code tonight.
Also, I just cleaned up my workspace, so here’s a ‘before’ pic:
(Note the sexy desk (made of 2×4′s and particle board) and 15 year old keyboard…)

Good luck everyone!
Thoughts on tech for LD15
I spent a hunk of time today hacking myself up a proper library and deciding on what I’ll be using for LD #15, should I not wuss out at the last moment.
I am leaning towards things which I have used for the longest, this is to reduce the amount of figuring-out I have to do.
As tempting as it is to use python/pygame/macos, I have one half the experience with that, so it is best to stick to ancient and familiar technology, despite its limitations.
To implement:
- C/C++, sloppy and mixed. The way I like it!
- 2d vector graphics where possible, otherwise rotated/scaled sprites.
- Win32 (though, I would like to have it compile/run on MacOS as well. This shouldn’t be a huge problem.)
Libraries:
- SDL (sound, graphics, and input)
- OpenGL (strictly 2D and orthographic, unless I drink too many trappists and decide otherwise)
- mmgr.cpp/mmgr.h by Paul Nettle
- vector2d and related math templates by Bill Perone (I can’t seem to find a link right now!)
- MT19937 Mersenne Twister random number generator
To create:
- Photoshop for Graphics
- SFXR for Sound
- SciTE for Text
- Visual C++ 6.0 for Code
- SVN for revision control / backup
To eat:
- Water
- Trappist Beer
- Cola
- Food with nutritional content yet to be determined
Random thoughts:
I have a feeling I may regret my choice to use a gamepad/keyboard for input. But for now I will.
- Con: Mouse games have a lot of instant-appeal. Easier to get interaction “feeling right”
- Pro: Keyboard/gamepad is oldschool and works on consoles.
- Pro: Leaning back in a chair with a gamepad is more relaxing then hunching over a mouse.
I can do sound. SFXR is freaking cool. I spent a few minutes playing with it today and fell in love. This saves me from making corny sound effects into a microphone during the last minutes of the compo! Thank you DrPetter
All of the libraries, save for my starting template are freely available online. None of them resemble a game library / engine, so they are squeaky clean.
At some point I will post my starting source up for anyone interested. Hopefully there is something useful in there to be pilliaged by others during this compo, or future projects.
I’m curious to see what other people are using, or who else is using a similar (fairly heavyweight, rusty, and old) setup.
Right in at the deep end!
Hello everyone,
First time LD’er here, looking forwards to seeing what odd combination of themes combine to inspire us to greatness this time! I’ve got a long weekend free (it’s a Bank Holiday – woo!) and nothing to get in the way but my own procrastination. I’m intending to do my entry in XNA/C#, if that’s allowed, using SketchUp with a .X exporter for any 3d graphics I may happen to need. Of course, never having used XNA or C# in anger before, it should be a hell of a learning experience – hence the title of this post!
In real life I’m a professional Level Designer – which usually means I know a bit of scripting, and a bit of art – but not that much of either! Wish me luck, as I wish you all the same!
StarFerret 48h, final
Hiiii,
Here it iiis:
Windows version: http://www.raschke.de/julian/temp/ld14_final_win_jlnr.zip
Mac version: http://www.raschke.de/julian/temp/ld14_final.zip
Source code: http://www.raschke.de/julian/temp/ld14_src.zip
Not much content—sorry—I lacked direction and worked much more iteratively than before. Only really worked productively during the last hours. But I managed to do some nice little tricks using just a 2D lib
Enjoy!
(Reuploaded the next day because the original wording was unintentionally offensive in one instance. Didn’t touch the rest.)
First sneak preview demo thingie…
Here it goes, Mac-only and without source so far:
http://www.raschke.de/julian/temp/ld14_demo.zip
This is my moment of triumph. I fear the level design will show that my concept is not THAT well thought out
Food- and screenshots!
Last night I wasn’t too happy with my mockup:

But I even switched to C++ because it allowed me to add some features that I wanted to do for a while. Also, I ate delicious tempeh burgers:

And suddenly, my game looked a lot better! I also had some ideas for more interesting gameplay last night, so today I’ll hopefully be more productive:

LD14 Basecode
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;
}
LD14 – My tools
Well, I’m ready and roaring for a great LD14 weekend. I’m going to break my programming-vacation for 48 hours and have myself at some code.
I’ll be using:
IDE: Code::Blocks
Language: C++
Libraries: SDL, SDL_image, SDL_ttf, and SDL_mixer, all rolled into one big PlatyGame (which I wrote myself), and possibly libcurl if internet is needed.
Art: GIMP and a little Paint.
Audio (if I do any): Musagi, SFXR, and Sound Recorder.
PlatyGame source and object files can be downloaded here:
http://www.platymuus.com/goods/PlatyGame.zip
Also, does anyone have any idea how to cut down on the number of DLLs I need to include with my application?
Balloon Game Update
Thanks to pekuja for compiling Balloon Game! It should work for everybody now. I also included SDL.dll in the zip. No changes have been made to the code or graphics. Get the new version here.
See old post at http://www.ludumdare.com/compo/2009/01/10/balloon-game/
Balloon Game!
It’s amazing! It’s wonderful! It has potatoes.
Get it here. Uses C++ and SDL. Written & compiled in MSVC++ 2008 Express edition. MS Paint & GIMP for graphics. SFXr & Musagi for the sound & music that didn’t make it in.
Note: this is the Debug build because for some reason the Release build refuses to compile.
EDIT: See new post (http://www.ludumdare.com/compo/2009/01/11/balloon-game-update) for version that should actually work.
Mini-LD #6 – Balloon!
I have chosen the theme Balloon!. I think my color is going to be yellow. I’m itching to start coding even though I’m not supposed to yet. Normally I use C++ and SDL, but I’m considering using Flash as its capabilites might be better suitied to my project, though I’m not sure how to go about it.
If I do use C++ and SDL I’ll use my special library, which I am releasing right now here, if it’s not too late to be official. Please respond if you know for a fact this is valid or invalid! This is my own library, PlatyGame version something or other.
EDIT: I just realized this, apparently the compo already started.
Nearing the end of Day 1
Collisions
I need help with collision code. I want to keep the player from falling through floors, pretty much. Help?
EDIT: Okay, I’ve got some good collision detection, but there’s something wrong with my moving code.
bool checkCollision(SDL_Rect &movable, double &vx, double &vy, SDL_Rect solid, bool move) {
int moveLeft = movable.x;
int moveTop = movable.y;
int moveRight = moveLeft + movable.w;
int moveBottom = moveTop + movable.h;int solidLeft = solid.x;
int solidTop = solid.y;
int solidRight = solidLeft + solid.w;
int solidBottom = solidTop + solid.h;int clipLeft = max(moveLeft, solidLeft);
int clipTop = max(moveTop, solidTop);
int clipRight = min(moveRight, solidRight);
int clipBottom = min(moveBottom, solidBottom);if(clipLeft == clipRight || clipTop == clipBottom)
return false;if(!move)
return true;int clipWidth = clipRight – clipLeft;
int clipHeight = clipBottom – clipTop;if(clipWidth solidX) {
// moving to right
movable.x += solidRight – moveLeft;
} else {
// moving to left
movable.x -= moveRight – solidLeft;
}
} else {
// moving along y axis
vy = 0;
int moveY = moveTop + movable.h / 2;
int solidY = solidLeft + solid.h / 2;
if(moveY > solidY) {
// moving to bottom
movable.y += solidBottom – moveTop;
} else {
// moving to top
movable.y -= moveBottom – solidTop;
}
}return true;
}
Please help! If you’re interested in seeing what’s happening, here’s the program: http://files.chocoboheaven.com/uploads/Guests/files/85267_PaintWorld.zip





