2D platform game

Started by
6 comments, last by mrr 14 years ago
Hello Forum! I've been working on a 2D platform game for some days, and I really need some help in it. I use SDL for everything, it's gonna be my first game, so I don't want it to be complicated. I've been learning SDL from LazyFoo's SDL tutorials and I get it but I have some problems. Since I have never created a game (well, I've written Tic-Tac-Toe), I don't know how to construct it. I have a few hundreds of code written, so I have a lot of things handled in it, but it's not even close to complete. I need some great help as I really want to finish this game (and after that create more). The code already written is at http://sourceforge.net/projects/yolane/
Advertisement
What problems have you come across? We can't help unless you let us know what you need help with.

SourceForge isn't the best place to upload your projects. It's not bad for distributing your projects, but you might want to look at BitBucket or Google Code. They are a bit more lightweight and better suited for smaller projects.

Lastly, it looks like you committed your entire project to your repository in a zip file. Don't do that. You can upload files individually to the repository. That way, we (the friendly folks on GameDev's forums) can view your files without having to download and unzip your entire project.
Quote:Original post by Tac-Tics
What problems have you come across? We can't help unless you let us know what you need help with.


I need help in putting the game together.

Quote:
Lastly, it looks like you committed your entire project to your repository in a zip file. Don't do that. You can upload files individually to the repository. That way, we (the friendly folks on GameDev's forums) can view your files without having to download and unzip your entire project.


I'm going to upload the source files only then. What's on SF is not the current version, maybe tomorrow I'll update it.

Quote:Original post by sandorlev
I need help in putting the game together.


...okay... I'm assuming you know how to use a compiler, since you've made a tic-tac-toe game, so are you asking for advice on where to begin to build a 2d platformer engine?

For instance, do you need to know about 2d collisions? Do you want pixel-perfect collisions, or are box collisions good enough? Do you need other advice on 2d physics and movement? Do you want advice on how to architect your code so you can hopefully expand on your basic engine after writing? How about how to efficiently store and render large levels?

You need to understand that you've asked an extremely broad question, the kind of question that could inspire a 400 page book on 2d game programming. Actually, would a book recommendation be more helpful to you than hundreds of forum posts? Or are you looking for some specific piece of advice for now?

Globals are not evil. Singletons are evil.
Quote:Original post by Indigo Darkwolf
Quote:Original post by sandorlev
I need help in putting the game together.


...okay... I'm assuming you know how to use a compiler, since you've made a tic-tac-toe game, so are you asking for advice on where to begin to build a 2d platformer engine?

For instance, do you need to know about 2d collisions? Do you want pixel-perfect collisions, or are box collisions good enough? Do you need other advice on 2d physics and movement? Do you want advice on how to architect your code so you can hopefully expand on your basic engine after writing? How about how to efficiently store and render large levels?

You need to understand that you've asked an extremely broad question, the kind of question that could inspire a 400 page book on 2d game programming. Actually, would a book recommendation be more helpful to you than hundreds of forum posts? Or are you looking for some specific piece of advice for now?



I could use some advices on physics and movement indeed, for example I don't have the foggiest idea of coding a jump. Also some on architecture.

I just wanted people to check out my code then tell their ideas and stuff, since I've never written something like this before.
Quote:Original post by sandorlev
Quote:Original post by Indigo Darkwolf
Quote:Original post by sandorlev
I need help in putting the game together.


...okay... I'm assuming you know how to use a compiler, since you've made a tic-tac-toe game, so are you asking for advice on where to begin to build a 2d platformer engine?

For instance, do you need to know about 2d collisions? Do you want pixel-perfect collisions, or are box collisions good enough? Do you need other advice on 2d physics and movement? Do you want advice on how to architect your code so you can hopefully expand on your basic engine after writing? How about how to efficiently store and render large levels?

You need to understand that you've asked an extremely broad question, the kind of question that could inspire a 400 page book on 2d game programming. Actually, would a book recommendation be more helpful to you than hundreds of forum posts? Or are you looking for some specific piece of advice for now?



I could use some advices on physics and movement indeed, for example I don't have the foggiest idea of coding a jump. Also some on architecture.

I just wanted people to check out my code then tell their ideas and stuff, since I've never written something like this before.


I have a better suggestiuon for you. This is a suggestion I make to pretty much everybody who is starting out with any kind of animation.

Write a breakout game, with a ball, some blocks, and a paddle. A lot of the disciplines involved here are important for writing a platformer; collision of an object against some blocks, moving objects, animation, and of course general coding. Once you have a ball moving around the screen, and bouncing around, you will have an understanding of how to make a character jump on blocks.

I browsed your source on sourceforge, but I didnt find any source. Did you actually upload any source? Anyway, dont worry about that, nobody is going to read your source and follow you as you develop it.
Don't thank me, thank the moon's gravitation pull! Post in My Journal and help me to not procrastinate!
Quote:
I have a better suggestiuon for you. This is a suggestion I make to pretty much everybody who is starting out with any kind of animation.

Write a breakout game, with a ball, some blocks, and a paddle. A lot of the disciplines involved here are important for writing a platformer; collision of an object against some blocks, moving objects, animation, and of course general coding. Once you have a ball moving around the screen, and bouncing around, you will have an understanding of how to make a character jump on blocks.

I browsed your source on sourceforge, but I didnt find any source. Did you actually upload any source? Anyway, dont worry about that, nobody is going to read your source and follow you as you develop it.


yes, just not into directories like trunk and stuff but the files alone. my newest code is up and it can be browsed.

For simple way to make a jump you could pick the coordinates likes this:

ynew = ystart+Height*sin(t*pi) (Assumes +y is up)
xnew = xstart+Length*t

jump the other way by changing sign.

xnew = xstart-Length*t

There y is height and side ways position x.

Then play t through from 0 to 1.

Note this will go at different speeds on different computers..
so incrementing t with real delta time between updates is a good idea.
To change speed just scale the delta time.

This topic is closed to new replies.

Advertisement