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

Author Topic: 4 In A Row, Your First SFML game tutorial  (Read 17791 times)

0 Members and 1 Guest are viewing this topic.

redkiing

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • http://redkiing.wordpress.com
4 In A Row, Your First SFML game tutorial
« on: August 21, 2009, 08:08:47 pm »
Hi there!!
I've created three new posts in my blog describing how easy is to create SFML games. These are intended for new SFML developers, so I tried to do design the game 4 in a row as simple as possible. Hope you like it.

The tutorial is mostly code-commented, but I added additional comments between code parts. There's place for improvements, so if you think something is worth changing/adding/moving/... don't hesitate and tell it!^^

The three posts are here in a single page.

The first post is here. It includes the same screenshot :P and the links to the sources and the executable (for windows).

A screenshot of the game:


G.

  • Hero Member
  • *****
  • Posts: 1593
    • View Profile
4 In A Row, Your First SFML game tutorial
« Reply #1 on: August 21, 2009, 10:30:51 pm »
Hello.

It looks good, but since you want to draw your board it would have been better to make your board class inherit from sf::Drawable.

redkiing

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • http://redkiing.wordpress.com
4 In A Row, Your First SFML game tutorial
« Reply #2 on: August 21, 2009, 11:01:59 pm »
Hi thx G.,
What would be the differences and advantages of making the board class inherit from sf::Drawable besides using App.Draw(board) instead of board.draw()?

remi.k2620

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://remi.tuxfamily.org
4 In A Row, Your First SFML game tutorial
« Reply #3 on: August 22, 2009, 01:07:42 am »
Quote from: "redkiing"
Hi thx G.,
What would be the differences and advantages of making the board class inherit from sf::Drawable besides using App.Draw(board) instead of board.draw()?


It will inherit all drawable's methods, like SetPosition, etc...

redkiing

  • Newbie
  • *
  • Posts: 8
    • View Profile
    • http://redkiing.wordpress.com
4 In A Row, Your First SFML game tutorial
« Reply #4 on: August 27, 2009, 02:59:30 am »
I'll certainly use inheritance from drawable in more advanced projects/tutorials, but I think this game would be as simple as it is right now if I inherited from drawable. Or is there something obvious I'm missing? What do you think?

 

anything