Sign in to follow this  

Game Programming in SFML

This topic is 2364 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[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 [/size][/color]

Share this post


Link to post
Share on other sites
[quote name='KrNaGe' timestamp='1298171681' post='4776544']
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
[/quote]
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[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.
[/quote]


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

Share this post


Link to post
Share on other sites
[quote name='KrNaGe' timestamp='1298211622' post='4776668']
[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.
[/quote]


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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
[url="http://www.google.co.uk/#hl=en&xhr=t&q=SFML+collision+detection&cp=7&pf=p&sclient=psy&site=&source=hp&aq=0&aqi=&aql=&oq=SFML+co&pbx=1&fp=d207d86176b7919"]Google results for "SFML Collision Detection"[/url]
[url="http://www.google.co.uk/#hl=en&xhr=t&q=SFML+move+sprite&cp=16&pf=p&sclient=psy&aq=f&aqi=&aql=&oq=SFML+move+sprite&pbx=1&fp=d207d86176b7919"]Google results for "SFML move sprite"[/url]

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 [i]some[/i] aspects of your game.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.
[url="http://www.amazon.com/Game-Programming-All-Jonathan-Harbour/dp/1598632892"]http://www.amazon.co...r/dp/1598632892[/url]

Also. Maybe this helps [url="http://hypertextbook.com/facts/2007/mariogravity.shtml"]http://hypertextbook...iogravity.shtml[/url]. Is a small alticle about how gravity works on mario games (Not by me [img]http://public.gamedev.net/public/style_emoticons/default/laugh.gif[/img]).

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 [img]http://public.gamedev.net/public/style_emoticons/default/blink.gif[/img]

Share this post


Link to post
Share on other sites
[quote name='KrNaGe' timestamp='1298172362' post='4776547']
[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 [/size][/color]
[/quote]

My advice is not to use C++/ SFML , use SFML .NET instead, its a lot more porductive. I used C++ / SFML and it took me 2 weeks to make a decent rpg engine , which I made in like 3 days with SFML .NET. Anyway, to make a platformer you need to be familiar with game theory , I suggest you read a book like "Killer Game Programming in Java" (The language / toolkit doesnt matter as long as you understand the theory) and then implement that theory to SFML.

Share this post


Link to post
Share on other sites

This topic is 2364 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this