
In a game of Pacman a specific algorithm is used to control the movement of the ghosts who are chasing (running towards) Pacman.
For this challenge we will assume that ghosts can walk through walls (as ghosts do!). So we will implement an algorithm that is slightly different to the algorithm used in the real game of Pacman where ghosts can only run alongside the corridors of the maze.
Our algorithm will be used in a frame based game where the sprites (e.g. Pacman, Ghosts) are positioned using (x,y) coordinates. The Pacman movement will be based on the position of the mouse cursor whereas the Ghosts will use a velocity vector (vx,vy) to move/translate between two frames.

Trigonometric Ratios: SOH-CAH-TOA
Our algorithm will use the trigonometric ration to find the angle the Ghost needs to head towards to chase Pacman.
The next step of our algorithm will use this angle to calculate the velocity vector (Vx,Vy) of the ghost:

The final step of our algorithm will update the (x,y) coordinates of our ghost to apply the velocity vector translation before drawing the ghost sprite on the screen.

Bouncing algorithms are often used in arcade games such as Pong or Breakout.



Have you ever noticed when playing a team sport video game such as a (football, basketball, rugby game, etc.) the computer often finds out who the closest player to the ball is so that you can run to the ball with the closest player. 
In this challenge we will use a Python script (using Python Turtle) to generate a random background for a 2D video game. 









The aim of this challenge is to demonstrate how the oblique projection formulas are used to convert 3D coordinates (x,y,z) into 2D coordinates (x,y).


2D arcade video games often use a frame based approach. This means that the screen is refreshed every so often (for instance every 20 milliseconds). This enables to animate the Graphical User Interface of the game making the game more engaging.

In this challenge we will use Python Turtle to create and draw a layer cake.







