How to implement “modes” in software, with a game as an example

Overview

In software development, there's the concept of a "mode" – a distinct set of behaviors for a program that changes the way it receives user input. In this video we'll demonstrate a simple video game (using the PyGame framework) that uses three distinct modes of behavior, and use it as an example for how to implement modal behaviors in a program. The code shown in this video is available at https://gist.github.com/syegulalp/ab5ccf257381344ea6c3f29bf36936bc - you are free to use it as you see fit.

Register Now