SFML community forums

General => SFML projects => Topic started by: redkiing on August 21, 2009, 08:08:47 pm

Title: 4 In A Row, Your First SFML game tutorial
Post by: redkiing on August 21, 2009, 08:08:47 pm
Hi there!!
I've created three new posts in my blog (http://redkiing.wordpress.com) 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 (http://redkiing.wordpress.com/category/game-development/) in a single page.

The first post is here (http://redkiing.wordpress.com/2009/08/20/your-first-sfml-game-part-i-introduction/). It includes the same screenshot :P and the links to the sources and the executable (for windows).

A screenshot of the game:

(http://redkiing.files.wordpress.com/2009/08/4inarowboard.png)
Title: 4 In A Row, Your First SFML game tutorial
Post by: G. 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.
Title: 4 In A Row, Your First SFML game tutorial
Post by: redkiing 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()?
Title: 4 In A Row, Your First SFML game tutorial
Post by: remi.k2620 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...
Title: 4 In A Row, Your First SFML game tutorial
Post by: redkiing 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?