Jump to content

View more

Image of the Day

Working on an auto spawn system. #gamedev #indiedev #screenshotsaturday https://t.co/Mm2kfekz7b
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

First game project, a 2D platformer.

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 EBBLER   Members   


Posted 16 August 2013 - 10:59 AM

Hello gamedev.net users,


i want to make a video game. The objective of my new project is to make a 2D platformer game with a lot of action (a dude that shoots everything to smitherness and the environment/enemies should be random generated). My experience: i graduated as bachelor of science this week..i coded some plugins and stand alone tools in C++ and java. I can code new challenges pretty easily but often my code is a mess and its not really resource efficient..but thats a story i want to improve when i start my first 3D game ;-).


I choose C++ as programming language, since i think that C++ is the king of the languages and in some point in my life i need to tame this king. I dont want to argue which language is the best..i just coded a lot in C++ lately and wanted to use it. I started a new project in C++ and just linked the SFML library with cmake. All i did uptil now is creating a window, drawing the player sprites in it and let it move with the arrow keys.. a simple hand-made collision detection lets the sprite stay in the window.


To my actual Question : i dont wan to reinvent the wheel. Of course i want to learn a lot, but i think i should not code a complete 2D physics engine or something like this....What are good C++ libraries i can use for a 2D platformer? 


Furthermore i struggle a bit with the order of how to implement things..should i implement jumping first or the actual ground he can walk on? How to implement "falling" ? Those are some really simple questions, i really need little head bump..



#2 PeterStock   Members   


Posted 16 August 2013 - 12:31 PM

a dude that shoots everything to smitherness


#3 BeerNutts   Members   


Posted 16 August 2013 - 02:44 PM

Well, SFML is a good start.  I would suggest looking at using a 2d physics library to handle all the movement and collision detection/response in your game.  I personally use chipmunk-physics, but other use box2d.  Both are good.


Outside of that, you might want to look at how to create your maps.  Tiled is a good tile map editor (you can also find a SFML Tiled map loader out there), but if you want to randomly generate levels and enemies, it probably won't help you too much.  it still may be good to look into.


You'll probably want some standardized way of saving configurations, maps, player data, etc.  Many people use xml, so tinyxml is a easy xml parser.  JSON is also getting a lot of usage, and Jsoncpp and Jansson are popular ones if you would rather use json.


Otherwise, play around with it all, use Google a lot, and find out everything you can do.  Good luck.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#4 SonicD007   Members   


Posted 16 August 2013 - 02:58 PM

IMHO I would say you should create small applications that focus on one thing before building a 2d platform as your first game.  If you want to implement grounds/jumping, I would say create a new project and create a "ground" (Technically if you can create boundaries then creating a ground should be no problem).  Have a rectangle jump on your created "ground".  After that move onto the next thing you want to accomplish and so on.  You'll have a very difficult time creating a 2d platformer if it's your first game and you're still learning C++ as well as SFML.  Take a step back and deal with C++ only.  Try to complete the Gamedev project 1 in the cpp workshop forum.  You'll learn a lot from that.  Also take a look at http://gameprogrammingpatterns.com/.  I've found those patterns very helpful.  In particular, I would look at the type object pattern, the state pattern, and the component pattern.  I don't know what exactly your expertise is in programming with C++, but by the sounds of it I think you should give the gamedev project a go before trying to make a 2d platformer.


Tiled is a great opensource tild map making program that you can use to create your levels for the 2d platformer.  You should also read up on tiled maps if you don't know what those are.  If you want to add physics, you should look into "fixed game loops".  I can't go into detail right now but this should be enough to start you off with.  I strongly suggest doing the gamedev project 1.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.