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

Author Topic: Making first SFML game, help?  (Read 1166 times)

0 Members and 1 Guest are viewing this topic.

atac57

  • Newbie
  • *
  • Posts: 9
    • View Profile
Making first SFML game, help?
« on: June 02, 2013, 04:35:17 am »
Just recently I started working with SFML, I've mostly just been looking over some youtube tutorials, looking at the documentation and doing simple things like opening images, sounds,  etc. I'm trying to start simple by making a tic-tac-toe game, but I just don't know how I should organize the code. I've only written console programs up until this point so using graphics or even any other library (besides the standard library) is all new to me. So far I have a window with a tic-tac-toe board but when I try to add to the code I feel like its really messy and I'm just sort of throwing it together.  I also have a layout of what I think should be grouped together, like the logic of the game, loading the board and its pieces, how the user interacts with the game. Does anyone have a basic idea or some advice on how to approach getting started on this.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Making first SFML game, help?
« Reply #1 on: June 02, 2013, 09:24:27 am »
Do the terms classes, polymorphism, templates, STL, RAII tell you something? If not, you should probably learn some more C++ before you approach graphics programming.

You can reflect how to divide the code into different classes that represent objects in your game. For example, a class Board might be used to store the X and O of the tic tac toe. You could even have a different class that renders it, in case you would want different graphical representations. There are always multiple design possibilities, you will also see yourself which ones prove well and which ones don't.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything