Platform Game


hisaki

Still Fresh
Joined
Sep 9, 2007
Messages
56
I'm working on a simple platform game using C++ and SDL. Figured this would be an easier way of getting in to C++ than my other idea (the music generator thing).

So far the player can walk around a level, jump on platforms, collect coins, fall in pits. The graphics are absolutely horrid though as I'm no graphic artist.

It plays quite ok in my opinion though, barring some issues. Like, when you jump, all the force is calculated at the start of the jump. So it doesn't matter how long you hold the jump button for, the jump will be the same height each time. There are some other issues, my colleague at work calls the game "hovercraft boy". I'm not sure if that effect is entirely unwanted as it makes the game a little more challenging.

If anyone wants to give it a go, I've compiled it for Windows and GP2X (only tested on an F100). If anyone wants me to, I'll see if I can do mac or linux builds too.

http://queenofbuckets.com/SDL_Game.zip (Windows and GP2X)

Controls:
Windows: arrow keys (left/right) z = run, x = jump
GP2X: X = run, B = jump, Start = exit

If you dig around the resources you'll find some XML files. Not everything is loaded from these yet, but you can edit the level in level1.xml.

It's all pretty early and very much work in progress. The end goal is combining it with a website where people can make their own little platform game. I don't know how feasible that is, but it sounds like a nice way to avoid having to do the art myself :)

Edit:
Forgot to pack some libraries, updated the archive
 
seems to play well enough on windows :) jumping and falling feel a bit weird, but that probably needs some getting used to.

Graphics could do with some updating as you mentioned, but i'm even worse at it than you ;)

And wondering: Toevallig vlaams?

Cheers!

MarkoeZ
 
MarkoeZ said:
seems to play well enough on windows :) jumping and falling feel a bit weird, but that probably needs some getting used to.

Graphics could do with some updating as you mentioned, but i'm even worse at it than you ;)

Thanks for testing it :D

Yeah the game physics are a little off compared to other games. I still haven't really decided what to do with that though. I think on one hand it adds some personality and could work well if the levels are designed for it. But on the other hand if I want to make it more like an engine people can easily make games with, I should maybe make it behave more like other games.

I guess ideally I should do some more testing and come up with some variables people can set themselves :)

The graphics are awful yeah. Your game looks really awesome. Finding artists to work on the graphics for my game has been on my mind too. But I have a horrible track record of starting things and not finishing them. I don't want to waste people's time having them make graphics for a game I might never finish. So I came up with the idea of just making the engine, and a website where people can easily make a platform game themselves.



MarkoeZ said:
And wondering: Toevallig vlaams?

ooh, the "menneke" gifs? I'm from the south of the Netherlands (Brabant). A colleague of mine has a pretty heavy accent and it's sort of like a running gag at work to talk like that :)
 
Last edited by a moderator:
Well to keep it in English, seems i live in the same province as hisaki, and the Netherlands is not that big. Multiplayer Pandora!!! ;)

Yeah the game physics are a little off compared to other games. I still haven't really decided what to do with that though. I think on one hand it adds some personality and could work well if the levels are designed for it. But on the other hand if I want to make it more like an engine people can easily make games with, I should maybe make it behave more like other games.

I guess ideally I should do some more testing and come up with some variables people can set themselves :) SNIP So I came up with the idea of just making the engine, and a website where people can easily make a platform game themselves.

Sounds like a nice project. there will probably be lots of people that like to easily build and play their own stuff on the Pandora, without diving into the code immediately :)

Cheers!

MarkoeZ

p.s. and indeed credits to the artists of Panjoust!! they made the game to what it is.
 
I've done some more work on this. The jump routine is different and you'll now jump higher when you hold the button longer. I've also added backgrounds and more data is loaded from the XML files now.

The graphics are by Marc Russell from spicypixel.net. The graphics in the previous demo I made were just too awful, so I searched for some royalty free ones and found these: http://www.spicypixel.net/2008/01/10/gfxlib-fuzed-a-free-developer-graphic-library/

I did't replace the hearts and coins yet. The aim of this project is not to make a game, but to make an engine that allows anyone to make their own platform game. So the graphics aren't the main focus for now. Although these graphics make for much nicer testing than the previous ones did :)

The background code made this version too slow for the GP2X. I should see if I can optimise it.

Windows version only for now, but I'll try to make a linux/mac version if anyone wants me to.

http://queenofbuckets.com/SDL_Game.zip

SDL_Game.jpg
 
I haven't really decided yet whether I'll open up the source or not.

Some things like collision detection are done rather clumsily :D. I'd have to clean up the code for sure and add some comments.

The game also depends on boost for some rather trivial things. I'm not sure how people feel about that. Boost is pretty easy to install though.

I guess once I have it running on the GP2X again, and have done some cleaning up, I can release the source to whoever asks. I'm a beginner myself though, so I can't guarantee the quality of the code to be any good.
 
I've tried to compile it on my Macbook and it went pretty well. But now when I run it all the transparencies are black. Could this be bug in SDL, my code, or should I not be using GIF images in the first place? It worked fine in windows, kind of at a loss how to fix this.

Edit:
I've modified lesson 3 of lazy foo's tutorial and it too shows black around a gif image. Something must have gone wrong when I installed SDL or SDL image
 
hisaki said:
I've tried to compile it on my Macbook and it went pretty well. But now when I run it all the transparencies are black. Could this be bug in SDL, my code, or should I not be using GIF images in the first place? It worked fine in windows, kind of at a loss how to fix this.

Edit:
I've modified lesson 3 of lazy foo's tutorial and it too shows black around a gif image. Something must have gone wrong when I installed SDL or SDL image
Are you making sure to use SDL_DisplayFormatAlpha() instead of SDL_DisplayFormat() when optimizing your loaded GIF images?
 
Last edited by a moderator:
Aethix said:
Are you making sure to use SDL_DisplayFormatAlpha() instead of SDL_DisplayFormat() when optimizing your loaded GIF images?

Thanks! It does work, but it makes the game really really slow. I know where to look now though, so I should be able to figure it out :)
 
Last edited by a moderator:
This is pretty fun, i've always enjoyed simple platformers, keep going with level building :)
 
RubiX said:
This is pretty fun, i've always enjoyed simple platformers, keep going with level building :)

Thanks, hopefully if I finish this project people will make a flood of new platform games with it :D



Also, yey I fixed it. Turns out the default SDL image back end for Mac doesn't do color keying on gif images. I fixed it by using "./configure --disable-imageio" when configuring SDL Image, which makes it use the same back end as on Linux/Windows.
 
Last edited by a moderator:
On the Windows version, the character rarely jumps when you are running left and press jump.

-God Ginrai
 
God Ginrai said:
On the Windows version, the character rarely jumps when you are running left and press jump.

-God Ginrai

That's strange, it works fine on my PC. What version of windows do you use?

I'm using XP myself, but a colleague of mine tested it in Vista and it seemed to work ok on there too.

Anyway, thanks for testing :)
 
Last edited by a moderator:
hisaki said:
God Ginrai said:
On the Windows version, the character rarely jumps when you are running left and press jump.

-God Ginrai

That's strange, it works fine on my PC. What version of windows do you use?

I'm using XP myself, but a colleague of mine tested it in Vista and it seemed to work ok on there too.

Anyway, thanks for testing :)

I'm using Windows 7.

-God Ginrai
 
Last edited by a moderator:
Runs both ways and jumps fine here and I'm on windows 7. Btw a platform game maker sounds fun, I'd definatly have a go at making one if it was easy :)
 
Works fine for me and I am using Windows 7, too.
I also can move left/right, run and jump at the same time...

There might be a slim possibility that it's related to your keyboard, but I doubt that.
You might have an outdated version of SDL in your system32 folder, which gets used instead of the supplied one (though I dunno if that's the order of priority).

foxblock out
 
puppydee said:
Btw a platform game maker sounds fun, I'd definatly have a go at making one if it was easy :)

I'm glad you like the idea :)

I hope it'll be easy. I think the hardest part will be to make the graphics, maybe I can include more royalty free ones. I should start working on the editor soon, which will hopefully inspire me to finish the remaining things in the engine too.



foxblock said:
There might be a slim possibility that it's related to your keyboard, but I doubt that.

I was thinking that, but I think anyone on this forum would know if their keyboard only registered 2 keys at a time :)

Good to know it does work on windows 7 :)
 
Last edited by a moderator:
Hi,

Could you please upload (or PM me) the old version with GP2X binary ?

Or upload a new optimized version for GP2X ? :p

I'd like to give it a go on my F200 with Open2X DR 7...

Bye, and keep up the good work !

Magic Sam
 
http://queenofbuckets.com/sdl_game_gp2x.zip

I've actually fixed the problem since. There didn't seem to be much interest in the GP2X version, so I forgot to upload it. Maybe that's because I posted this in the Pandora section though :)

I forgot to change the video mode for the GP2X build, so it wasn't using hardware surfaces. Which made it pretty slow.

I haven't tested it on an F200 nor the open2x firmware so I don't know if it'll work. Also, you might want to make the level a bit easier for the small screen (edit level1.xml).
 
Back
Top