Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How can i start making a simple game like pong in sfml?  (Read 3687 times)

0 Members and 1 Guest are viewing this topic.

twigz

  • Newbie
  • *
  • Posts: 4
    • MSN Messenger - Jerry_g16@hotmail.com
    • View Profile
How can i start making a simple game like pong in sfml?
« on: July 15, 2011, 01:14:04 pm »
Hello, I'm new to sfml , went through the tutorials until the sound tuts. I'm understanding it piece by piece, but i was wondering how will i be able to start making games using this library.

If you can refer me to simple games tutorials or a way i can start, that will be much appreciated.

Thanks in Advance.

unranked86

  • Newbie
  • *
  • Posts: 37
    • View Profile
How can i start making a simple game like pong in sfml?
« Reply #1 on: July 15, 2011, 07:49:13 pm »
Hi there!
First of all, please, excuse my english.

Well, I can understand, that you're a bit lost :) But don't worry. It's simple to start a pong-like game. I'm not
a very good programmer, in fact, I started learning C++ a few months ago, and later I picked up SFML.
Anyway. I assume, that you're using the 1.6 version of SFML. That's a good sign, that you finished most of the
tutorials, so you have some understanding what SFML does.

What little advice I can give you, is this:

1. (maybe the best method to start??)
Take the code (for example..) of the Shape tutorial, and try to modify it. Create a basic shape, add an
event handler, to allow you, to move this shape around the window. Later add bounds to it's movement, like
if the shape's position is greater than the width of the window, then don't change it's position. I hope, I'm
clear enough.

2.
Search the internet! :)
But this forum has already some nice tutorials, on how to start a game.
For example this

Read the documentation! It's very helpful!

I don't know if this helped you in any way. Actually, this is how I started to use SFML.

twigz

  • Newbie
  • *
  • Posts: 4
    • MSN Messenger - Jerry_g16@hotmail.com
    • View Profile
How can i start making a simple game like pong in sfml?
« Reply #2 on: July 15, 2011, 07:59:38 pm »
Thanks a million, i never noticed that it had a game tutorial in here. I'm going to work on That and see what new things i can learn.

Umm, u said that a pong game is simple, but i'm not even sure how i can start making it, i would really like to make a pong game, so is there any tutorials on making a pong game for SFML?

Thanks once again.

oh and one more thing, before i can start with the making of games.
I have to be familiar with object oriented programming right?

unranked86

  • Newbie
  • *
  • Posts: 37
    • View Profile
How can i start making a simple game like pong in sfml?
« Reply #3 on: July 15, 2011, 08:38:07 pm »
I'm not sure, if there is any tutorial on making a pong game. But I think it's a fairly simple concept. There is
two paddle, and one ball, which is moving always, and the paddles are controlled by the players. It may sound
complicated, but it is fairly easy to implement.

Well, about the object-oriented programming...I recommend it. Sometimes, it can make your life easier. Once you
grasp the idea behind it, you will realize, that it can be very powerful.
This is a basic explanation about classes, and inheritation, BUT if you are not familiar with object oriented programming you should read about it.
Take a look at this very basic C++ tutorial for example. This site has some very nice explanation about the classes in C++. For further
reading I recommend the book "Beginning C++ through game programming" by Michael Dawson. I find it very useful. It is aimed
for beginners and I think, it's easy to understand.


Edit: P.S. Remember! Read,read, and read! ;)