Initializing Ping

Initializing the Game Initializing Ping is a more complex task than you might think. To initialize Ping, the program must do the following tasks: 1. Set the size of the playable area. 2. Load the ball’s image. 3. Initialize all of the ball’s member data except the position and movement vector. 4. Load the bitmap for the paddles. 5. Initialize all of the paddles’ member data except the position and movement vectors. 6. Load the bitmap for the score markers. 7. Load...

read more

Creating a maze in C++ part 2

Here is part 2 of the tutorial It starts with defining four coordinate objects we are going to use to point towards different cells in the maze array. The pos coordinate will be our primary pointer. It will always point towards the cell we are currently standing on and we will use it to change those cells to wall or floor. The other three coordinates are temporary and will be used as helpers (the code gets a bit messed up with all these stupid names, but I’ll try to keep it as clear as possible). Now for the algorithm: First we are on...

read more

Creating a maze in C++ part 1

Creating a maze in C++ part 1

Creating a random maze, creating a game and creating a program that solves that maze. I. Random maze generator First let me explain the procedure this program uses: first it initializes and reads the appropriate arguments (size of the maze) it creates some graphic stuff and the main maze array. It also creates two “coord” objects called beginning and end (they are not important for this first program, but are required for the game). then it starts the main algorithm after the algorithm finished it’s work it runs the draw_maze() ...

read more