SFML community forums

General => SFML projects => Topic started by: Pham Trinli on April 27, 2016, 09:24:38 am

Title: Let's make 16 classic game in C++ video series
Post by: Pham Trinli on April 27, 2016, 09:24:38 am
Hello! This is my implementation of the 16 classic games in C++/SFML and little video tutorial series =>
https://www.youtube.com/watch?v=zH_omFPqMO4&list=PLB_ibvUSN7mzUffhiay5g5GUHyJRO4DYr (https://www.youtube.com/watch?v=zH_omFPqMO4&list=PLB_ibvUSN7mzUffhiay5g5GUHyJRO4DYr)

16 games:
1. Tetris
2. Doodle Jump
3. Arkanoid
4. Snake
5. Minesweeper
6. 15-Puzzle
7. Car Racing (Top Down)
8. Outrun (Pseudo 3d Racing)
9. Xonix
10. Bejeweled (match-3)
11. NetWalk (Pipe Puzzle)
12. Mahjong Solitaire
13. Tron
14. Chess
15. Blobby Volley
16. Asteroids

source: https://yadi.sk/d/uqz1HerKrKWjV
Title: Re: Let's make 16 classic game in C++ video series
Post by: nicox11 on April 27, 2016, 11:17:42 am
Put your sources on github or something similar, it'll be easier to watch. I don't want to download archives.
Title: Re: Let's make 16 classic game in C++ video series
Post by: K.F on April 27, 2016, 12:01:11 pm
This is actually a pretty good format for these kinds of tutorials, good job.  ;D

I like that you show what some of the lines do just by running the program.

Put your sources on github or something similar, it'll be easier to watch. I don't want to download archives.

Seriosly? Github for single files with just few lines? That's pretty useless, I'd understand Justpaseit or hastebin.com - why isn't it working by the way? - but Github? It's not even good for simple things like that.
Title: Re: Let's make 16 classic game in C++ video series
Post by: eXpl0it3r on April 27, 2016, 12:37:31 pm
Quite cool to see a game come to life like in the videos. :)

Too bad the code formatting got screwed up like that (maybe because of the auto-insert script thingy you used to make the video?).

Would be quite interesting to see the code refactored into something more clean and easier to grasp. Right now there's a ton of magic numbers, short variable names and "random" arithmetic stuff. Plus the code is currently more C-like than C++-like. ;)
Title: Re: Let's make 16 classic game in C++ video series
Post by: Erdrick on April 28, 2016, 12:28:41 am
This is an amazing display of talent to me, nice work.
Title: Re: Let's make 16 classic game in C++ video series
Post by: Hapax on April 28, 2016, 01:48:32 am
Where is game 16 (in the videos)?

Where is the actual game (there's no car!) in the pseudo 3D car racing game?

This stuff will be quite useful for people looking to get one of these games running by typing it in theirselves or maybe if they're stuck somewhere and might find the answer in your code so nice of you to share this.

One of the first things I noticed, which was in the first video, was something like:
float time = clock.getElapsedTime().asSeconds();
clock.restart();
timer += time;
This could be just:
timer += clock.restart().asSeconds();

I don't want to comment too harshly as it's nice that you did it so I'll leave critiquing the code to others (who obviously know more about it than I do).
Title: Re: Let's make 16 classic game in C++ video series
Post by: Elias Daler on April 28, 2016, 02:27:01 pm
Wow, pretty amazing, great job!
Nice reminder that simple straightforward things are sometimes all it takes to get the job done.
Title: Re: Let's make 16 classic game in C++ video series
Post by: Tukimitzu on April 28, 2016, 05:32:29 pm
Very well put together. I think the fact that everything is in a single file makes it easier to a beginner to understand. I myself, when made my first game using Allegro a competitor, just shove it all in a .cpp and it worked. Beginners only care for results, and your videos show a very straight-forward way to do it.

Good job!
Title: Re: Let's make 16 classic game in C++ video series
Post by: CleverBoy on August 21, 2016, 03:55:33 pm
Amazing. I never thought all these games could be achieved in one file. You just changed my perspective that these games were difficult to code. You made it look so simple. Thanks to you man... Great job. 
Title: Re: Let's make 16 classic game in C++ video series
Post by: Raincode on September 16, 2016, 03:55:05 pm
Enjoyed watching your videos, thank's for sharing:)
Title: Re: Let's make 16 classic game in C++ video series
Post by: jamesL on September 16, 2016, 07:46:37 pm
great videos

a really great display of incremental programming

Title: Re: Let's make 16 classic game in C++ video series
Post by: Cmdu76 on September 18, 2016, 11:29:36 pm
The Outrun game is incredible !

The only problem is that it's not explained, but I understand that this is not the purpose of this video
Title: Re: Let's make 16 classic game in C++ video series
Post by: BioForceGun on January 24, 2017, 01:41:58 pm
Will i'm right if i say what this examples so more C-style, than that C++? I'm trying learn SFML by it, but now i think it bad sample to learn library. I spent a lot of time to refactor this code, because default format completly unread.

Please, give some examples or lessons to start and understanding SFML (in Google all examples so different in code-style and old), why official site doesen't have simple example completely game? Thank a lot.
Title: Re: Let's make 16 classic game in C++ video series
Post by: jamesL on January 25, 2017, 12:13:54 am
that is a great way to learn the library

just go to the download site listed on the video and download the code

look through it

watch the videos
what makes them great is they don't show the final code at the beginning, but each games starts off with a simple window and then adding and changing line by line they end up with a game

and I think its great that each game is contained in a single file

makes it much easier to follow along

if you want a game full of templates and classes and inheritance then go to
https://www.packtpub.com/all?search=%22sfml%22
and buy an sfml book

or search youtube
https://www.youtube.com/results?search_query=sfml

Title: Re: Let's make 16 classic game in C++ video series
Post by: Xhite on February 03, 2017, 11:24:53 am
Actually these videos made me try SFML  :) I have a rusty 10-15 years old C background, with 0 C++. Even not clearly remembering pointers etc. Still i am making some progress if i dont suicide next week :)
Title: Re: Let's make 16 classic game in C++ video series
Post by: bitano on February 03, 2017, 08:38:09 pm
Actually these videos made me try SFML  :) I have a rusty 10-15 years old C background, with 0 C++. Even not clearly remembering pointers etc. Still i am making some progress if i dont suicide next week :)
I know where you're coming from. The same kind of applied to me. So since you're mentioning pointers, i strongly advice you to look into vectors instead. Vectors and maps. Gotta love 'em!
Title: Re: Let's make 16 classic game in C++ video series
Post by: A_Singh on April 01, 2017, 10:53:25 am
Hey,I am getting the error "unresolved symbol public:static class sf::RenderStates const sf::RenderStates::Default"in the chess game.Please can anyone help me resolve this error.I am using visual studio 2015.
Title: Re: Let's make 16 classic game in C++ video series
Post by: Mario on April 01, 2017, 01:01:12 pm
Any chance you're linking libraries in the wrong order? Rewatched the video and didn't see it being referenced directly, so it should be from SFML's default parameters?
Title: Re: Let's make 16 classic game in C++ video series
Post by: striderm on May 25, 2019, 12:15:27 pm
Hey, I am tying to build this code in codeblock with MinGW. I have Following Errors. Can Someone Guide me through.  :-[ ??? ???

https://imgur.com/zL9kMPy (https://imgur.com/zL9kMPy)
Title: Re: Let's make 16 classic game in C++ video series
Post by: Rolf on May 27, 2019, 02:29:12 pm
I think you have a problem with the libraries (i'm new to sfml). So check if you created the project with static or dynamic libraries and check if you have the libraries in the correct order (sml-graphics , sfml-window, sfml-system, sfml-audio) in the project build options -> linker settings.