Difference between revisions of "Beginner C++ Game Programming Tutorial 9"
From Chilipedia
(→Video Timestamp Index) |
(→Downloads) |
||
Line 35: | Line 35: | ||
* [http://www.planetchili.net/downloads/T9-Starting-Code.zip T9 Starting Code] | * [http://www.planetchili.net/downloads/T9-Starting-Code.zip T9 Starting Code] | ||
+ | * [https://wiki.planetchili.net/ Tutorial 9 Code] (WORK IN PROGRESS) | ||
+ | * [https://wiki.planetchili.net/ Tutorial 9 Homework Solution Code] (WORK IN PROGRESS) | ||
== See also == | == See also == |
Revision as of 09:29, 27 September 2019
In this video we make our first class and Chili teaches us about the birds and the bees and the static constexpr.
Concepts Taught
- Creating a
class
-
public
vs.private
access -
static
member variables -
constexpr
variables
Video Timestamp Index
- Intro 0:00
- ClampScreen code recap 0:18
- The issue of the current Game data organization: 1:38
- Classes: OOP to the rescue 2:25
- Creating our own class 3:21
- Header guard:
#pragma once
3:40 - Letting other files know about our class: including headers 5:52
- Refactoring game code related to poo 6:56
- A little trick: Advanced find + replace with regex enabled 7:08
- Adding an implementation file (.cpp) for Poo class 9:05
- Advantages of the new poo object oriented code 12:07
- Initializing poos' velocities 14:12
- Factoring out common attributes from class objects:
static
andconstexpr
14:41 - Difference between
constexpr
andconst
16:08 - Accessing static class members 16:40
- Class member access restrictions:
public
vsprivate
17:20 - Summing up what we have learned and a couple of tips 19:12
- Homework 20:03
Homework
Make the Dude entity into a class
as well. It's up to you to decide what member functions you should give it. Might want to add another function to Poo
as well (hint hint hint!).
The solution is given in this video.
Downloads
- T9 Starting Code
- Tutorial 9 Code (WORK IN PROGRESS)
- Tutorial 9 Homework Solution Code (WORK IN PROGRESS)