It's time to apply all that you've learned and start coding the game. This video will guide you with the initial code, and explain what each line of code does.
- [Narrator] In the previous video,…we looked at addressing assets…and understanding coordinates.…In this video, we will take a look…at including Windows essentials using main function,…returning values from a function.…Open up Visual Studio if it isn't already.…Open up the Timber project by left clicking it…from the recent list on the main Visual Studio window.…The first thing we will do is to rename our main code file.…It is currently called HelloSFML.cpp.…We will rename it to the Timer.cpp.…
The dot-cpp stands for C++…So find the Solution Explorer window on the right hand side,…and locate the HelloSFML file under the source files folder.…Right click on it and choose 'rename.'…Edit the file to Timber.cpp and press enter.…Make some minor edits in the code window.…You can do so in exactly the same way…that you would with any text editor or window processor.…You can even copy and paste it if you prefer.…
This simple C++ program is a good place to start.…Let's go through it line by line.…As you can see, the only code that needed to be changed…
This course was created and produced by Packt Publishing. We are honored to host this training in our library.
- Creating the main game loop
- Drawing the game background
- Handling errors
- Manipulating C++ variables
- Randomizing numbers
- Making decisions with if, else, and switch
- Moving game objects
- Pausing and restarting games
- Adding scoring and messages
- Using class enumerations and arrays
- Adding sound effects
- Object-oriented programming in C++
- C++ references
- Texture management
- Collision detection
- Implementing the HUD
- Finishing the game
Skill Level Beginner
1. C++, SFML, Visual Studio, and Starting the First Game
2. Variables, Operators, and Decisions
3. C++ Strings, SFML Time, Player Input, and HUD
4. Loops, Arrays, Switch, Enumerations, and Functions
5. Collisions, Sound, and End Conditions
6. Object-Oriented Programming, Classes, and SFML Views
7. C ++ References, Sprite Sheets, and Vertex Arrays
8. Pointers, the Standard Template Library, and Texture Management
9. Collision Detection, Pickups, and Bullets
10. Layering Views and Implementing the HUD
Updating the HUD each frame3m 24s
11. Sound Effects, File I/O, and Finishing the Game
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.