Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411431 Posts in 69363 Topics- by 58417 Members - Latest Member: gigig987

April 20, 2024, 03:51:44 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallForum IssuesArchived subforums (read only)TutorialsA game from scratch in C++ using SFML
Pages: 1 2 [3]
Print
Author Topic: A game from scratch in C++ using SFML  (Read 32411 times)
Serapth
Level 2
**


View Profile
« Reply #40 on: November 21, 2011, 09:41:03 AM »

Thank you for writing this tutorial! I'm following your tutorial using SFML2.0 and XCode 4.2 at the moment. Will let you know how things go  Coffee



Cheers, let me know how it works out!  I recompiled the sources on Mac OS/X using SFML 1.6 and GCC 4.2 and ran into a few small issues.  First off, _tmain isn't supported, as are a couple headers utilizing tmain, so simply change that to traditional main() and removed the offending .h files from stdafx.


Also the new C++ named inner enums aren't supported, at least not with some compiler switch of sorts.  So for example, you can't do:

struct Colour
{
  enum DefinedColours { Red, Green, Blue };
};

Colour::DefinedColours::Red  instead you of have Colour::Red.  I am not sure if I changed the code to reflect this incompatibility or not.  It's too bad too, as I find the one much more readable than the other.
Logged
Rusk
Level 1
*


View Profile
« Reply #41 on: November 21, 2011, 03:18:24 PM »

Thanks for the tutorials from me as well. I just rewrote my little project using a resource locator, it cleaned up the code. Smiley
Logged
Xardov
Level 1
*


Game Developer


View Profile WWW
« Reply #42 on: November 21, 2011, 07:03:30 PM »

Best C++ tutorial I've read.   Beer!
Logged

Beer!  Blog / Twitter / Google+  Beer!
Serapth
Level 2
**


View Profile
« Reply #43 on: December 25, 2011, 09:01:55 AM »

Best C++ tutorial I've read.   Beer!

Excellent, thanks for the compliment!  Part 9 is pretty much live, except the whole holiday in the way thing... soon, very soon. Smiley
Logged
Serapth
Level 2
**


View Profile
« Reply #44 on: December 31, 2011, 05:34:28 PM »

Part 9 is finally live.


In this chapter we implement a simple caching system for audio files.  Additionally we added our enemy paddle and some exceedingly stupid AI.  Along the way we explore C++ exceptions and touch on templates.


Here is progress to this point:

Logged
verticalvertex
Level 1
*



View Profile
« Reply #45 on: January 05, 2012, 02:52:07 AM »

Part 9  Coffee
Logged

It's all good.
Serapth
Level 2
**


View Profile
« Reply #46 on: February 27, 2012, 09:42:42 AM »

Just realized I made a massive stupid.  Wayyy back in part two, I introduced the concept of pre-compiled headers and I mentioned stdafx but then I forgot to actually give the code!  Therefore if you weren't using the included project files and didn't already understand C++ #includes, you would have hit a massive roadblock.  Most importantly, stdafx.h was where all the SFML includes were!


This explains some of the questions I got from people!  Anyways, I've updated to actually show the code.


If you tried running through the tutorial and ran into problems early, this is most likely the reason!  So sorry for the confusion this omission may have caused!
Logged
JigxorAndy
Level 6
*


Working on Dungeon Dashers


View Profile WWW
« Reply #47 on: February 29, 2012, 07:52:11 AM »

These are some really useful and very informative tutorials! It's really cool how you go into systems like caching and object management which are totally overlooked by most tutorials dealing with SFML. Please do more!  Smiley
Logged

Twitter / Dungeon Dashers: Website / Steam Store
Serapth
Level 2
**


View Profile
« Reply #48 on: May 04, 2012, 08:12:53 PM »

Sfml 2 ports

The source code from chapter 6 on was all ported to work on SFML 2 as well as 1.6.

Logged
Serapth
Level 2
**


View Profile
« Reply #49 on: May 18, 2012, 07:57:43 AM »

As per a readers request, I put together a post on compiling your game in release mode, as well as the files you need to distribute with your game.  It is part of the main tutorial series ( aka, it's in the index ) or can be viewed here..

I provide a set of release SFML 1.6 DLLs compiled for Visual Studio 2010, because the process can be... problematic.


Even if you didn't follow the tutorial, if you are looking at distributing an SFML 1.6 game, this post may be of some use to you.
Logged
ASnogarD
Level 1
*



View Profile
« Reply #50 on: June 21, 2012, 05:21:22 AM »

Would the tutorial be any use to me as a SDL user , as a idea on how to design classes for a game/project ?

I get the idea of encapsulation, and protecting data that 'some potential user' may alter in an unwanted manner... its just I keep smacking into ' I cant do this here because this class doesnt know about that information, but that class doesnt know about this pointer, and the main class needs the pointer to acces another class altother ' walls.

A lot of the time I end up with a load of get x and set x mini functions to do the stupidest things.
I have gone through sdltutorials.com framework tutorial and picked up a lot of ideas, but even that has me wondering... like why declare the main display in the CApp , there is a CSurface class why not leave the surface work to the surface class itself ?
Logged

Somethings are painfully obvious, others must be made obvious... painfully.
Serapth
Level 2
**


View Profile
« Reply #51 on: June 21, 2012, 07:25:39 AM »

Would the tutorial be any use to me as a SDL user , as a idea on how to design classes for a game/project ?

I get the idea of encapsulation, and protecting data that 'some potential user' may alter in an unwanted manner... its just I keep smacking into ' I cant do this here because this class doesnt know about that information, but that class doesnt know about this pointer, and the main class needs the pointer to acces another class altother ' walls.

A lot of the time I end up with a load of get x and set x mini functions to do the stupidest things.
I have gone through sdltutorials.com framework tutorial and picked up a lot of ideas, but even that has me wondering... like why declare the main display in the CApp , there is a CSurface class why not leave the surface work to the surface class itself ?

To a certain degree, yeah.

The first two parts would be completely useless, as they are all about configuration.  Your game loop would have to be rewritten, and obviously you would have to swap SFML for SDL calls, but that would be about it.  The fundamentals and such would all still apply, so if you have a good understanding of SDL, you should be able to translate it pretty easily.
Logged
sigfarter
Level 7
**


卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐卐


View Profile
« Reply #52 on: June 21, 2012, 09:29:17 PM »

Coding standards are like societal expectations, completely useless.
Logged
Serapth
Level 2
**


View Profile
« Reply #53 on: February 19, 2013, 08:01:31 AM »

Coding standards are like societal expectations, completely useless.

Until of course you are working as part of a team, or revist your code many months later... something I've just recently done.
Logged
Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic