Advertisement

Game Programming in SFML

Started by February 20, 2011 03:26 AM
9 comments, last by burningprodigy 13 years, 5 months ago
[color=#1C2837][size=2]Ive been programming in C++ for a while now and im pretty sure i have most of the basics i need down. Also ive been learning SFML lately. The problem is i dont know how to start making my own 2D game. I want to try and make a platform game similar to a mario-esque style. Could anyone help point me in the right direction and maybe give a few good tips, links to websites, or books i could use? Thanks

Ive been programming in C++ for a while now and im pretty sure i have most of the basics i need down. Also ive been learning SFML lately. The problem is i dont know how to start making my own 2D game. I want to try and make a platform game similar to a mario-esque style. Could anyone help point me in the right direction and maybe give a few good tips, links to websites, or books i could use? Thanks

For now I suggest you start simpler than mario-style platformer, you can always come back later. Start much easier, like Pong. Also, how are you learning SFML right now? I don't know any website about using SFML except the SFML website or I'd offer more concrete help. But as I said, if you start more simply you can work your way up to more difficult games. Start with trying to get a ball moving around on the screen by itself so it bounces around. Then figure out how to control the ball. Then figure out how to add paddles. Then figure out how to get the ball the bounce off the paddles.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Advertisement
the Question is a bit vague,
the best way to get started on the game is to do some of the tutorials at the SFML website, and think how this can be applied toward your goal of a cool side-scrolling game.

Im using SFML for my Platformer and having phenomenal success so its definitely doable. Maybe think first about how to loading a sprite, then moving it around the screen, then adding a map and navigating it with the player, then adding collision detection and so on and so forth.
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/

the Question is a bit vague,
the best way to get started on the game is to do some of the tutorials at the SFML website, and think how this can be applied toward your goal of a cool side-scrolling game.

Im using SFML for my Platformer and having phenomenal success so its definitely doable. Maybe think first about how to loading a sprite, then moving it around the screen, then adding a map and navigating it with the player, then adding collision detection and so on and so forth.



can i ask where your learning SFML from? because their website doesnt teach that much

[quote name='Xaer0' timestamp='1298183601' post='4776590']
the Question is a bit vague,
the best way to get started on the game is to do some of the tutorials at the SFML website, and think how this can be applied toward your goal of a cool side-scrolling game.

Im using SFML for my Platformer and having phenomenal success so its definitely doable. Maybe think first about how to loading a sprite, then moving it around the screen, then adding a map and navigating it with the player, then adding collision detection and so on and so forth.



can i ask where your learning SFML from? because their website doesnt teach that much
[/quote]

I learned SFML through the tutorials and their forums, they're pretty well done. though just going through them isn't going to teach you how to make a game
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/
i know. so what else do you think i should learn so that i can make a 2D game? im thinkin ill try makin somethin like pong first
Advertisement
Where can i learn how to program in SFML from besides their website? I can do some of the basic stuff from it like loading a sprite/background, moving objects with keyboard input, ect. But where do i learn how to implement collision detection, how to make an object move independently and continually, and how to set up window parameters so that the game objects dont go outside the screen boundaries?
Google results for "SFML Collision Detection"
Google results for "SFML move sprite"

To be honest, most of what you are asking is not really specific to SFML. Keeping a sprite inside the screen boundary, for example, is just a case of doing some fairly simple clamping on co-ordinates.

SFML provides a high-level wrapper around things like graphics, audio and networking. It's really more general programming approaches you need to be researching so perhaps you are searching too hard for SFML-related things? You are not "programming in SFML", you are programming in one of the languages SFML supports (C, C++, Python etc) and using the SFML library for some aspects of your game.
I think pong is a great first game to take on.




Just as Xaero0 said when he gave advice on how to start a platformer, the first things to think about for making pong a reality is loading a sprite(for a ping pong paddle for example), then allowing the user to control moving it around the screen (perhaps using the keyboard).




Good luck. You're headed in the right direction!

Even though I still suggest that you start simpler than mario (Try to make pong first, at least enough to understand the basic mechanics). Then you can start with the simplest 2D scroller.

One of the first books that I read has a chapter dedicated to that kind of games. It's obiously really simple but you can always refine the gameplay.
http://www.amazon.co...r/dp/1598632892

Also. Maybe this helps http://hypertextbook...iogravity.shtml. Is a small alticle about how gravity works on mario games (Not by me laugh.gif).

On a side note....I have sometimes dreamed about making myself a mario clone, the first thing I'd do is the scrolling mechanics...to play the NES version of the game and notice how it's implemented...you will notice that it's not that simple....then you can do the running mechanics...they are also not that simple....then maybe I'd come back to pong blink.gif
Check out my blog: vladimirsan.com

This topic is closed to new replies.

Advertisement