A guide for how to make a more advanced digital game based on coding. This is a super quick guide to some programming basics. Recommended for those that want to support their students in advanced computer programming game-making.
CP0 - Introduction to programming with C++
CP1: Variables, basic arithmetic, basic text input/output
This video tutorial will introduce Visual Studio as a popular development tool for C/C++ programming. We then review some of the basic concepts in programming including defining data (variables) and code (basic operations and functions). We also introduce simple ways to enter and display text and data values.
The code used in this video is linked below.
CP2: Flow control - if, for, while
This video tutorial will review how to control the flow of programs using decision-making (branching code) and iterations (repeating code).
These are very common practices that allow a program to have a more complicated structure than simple linear execution of instructions.
The program can perform different actions depending on conditions and/or perform them more than once.
This video gives a conceptual overview of the concept of flow control and how to explain it to students. This video is not a tutorial and does not implement flow control in an actual programming environment. But this video does offer a useful way for you to explain one of the trickier elements of programming to your students.
CP3: Functions and Parameters
This video tutorial will discuss functions as modules of code. Modularization is an important part of programming. Functions (modules of code) simplify managing complicated code and re-using commonly used parts of a program. We also see how to pass information to a module and receive results from it.
This video tutorial will go over how to create modules of data using arrays. These group of related data items share the same type and name, and each item will be accessed through an index.
Arrays are commonly used to store and process data items that have similar role in the program such as all the grades for a student, or the student names in a class.
This video tutorial will go over how to create modules of data using arrays. These group of related data items share the same type and name, and each item will be accessed through an index. Some basic examples of setting up and outputting the values of arrays are shown.
CP6 - Game loops and Libraries
This video tutorial will introduce Allegro library for doing graphics in C/C++. While powerful programming languages, C/C++ do not come with standard graphic operations. Allegro is a simple library that allows operations such as reading and setting pixels on screen and also support basic keyboard input.
CP7 - Dealing with 2D Graphics in Libraries
This video tutorial will see how to use bitmaps instead of working with individual pixels that can be very slow and inefficient. We also use structures in graphics programs. This tutorial prepares us for creating simple games.
CP8 - Implementing a game with basic physics
This video tutorial will use what we have learned so far to create a simple game. We see what is the program structure for games and how we can work with player-controlled and game-controlled objects.
We also see how to separate updating program data from drawing frames, and how to perform basic actions such as collision detection.
This video tutorial focuses specifically on how to write code that deals with collisions between objects. This offers a focused example of the kind of code that you’ll need to write to deal with objects that interact with each other. For reference, PG1 shows a way to implement the way mechanics in GameMaker.
CP5 - Objects and Classes
This video tutorial will introduce structures as another way of creating modules of related data. Structures include items that can have different types and names, but are used together, for example, all the information about a student (ID, name, grades, average, etc).
Structures are used as the basis for classes and objects (not discussed in this tutorial) that are module with code and data together.
This video tutorial will introduce structures as another way of creating modules of related data. Structures include items that can have different types and names, but are used together, for example, all the information about a car (wheels, seats, speed). Some examples of using structures are given in this video.
CP8 - Implementing a game with basic physics