I’ve written a series of posts based on teaching programming to children (specifically my 9 year old children). Currently, we’ve managed to produce a snake game, but we’re also working on a “Catch” game. This is a game whereby things drop from the top of the game screen, and the player must “Catch” them.
Before starting, it’s worth refering back to my first post for the basis of the game.
The initial set-up is the same; the difference for this game will mainly be that the player can only either move left, or right:
private static bool AcceptInput()
ConsoleKeyInfo key = Console.ReadKey();
Additionally, I’ve used a more bucket-like drawing for this game:
private static void DrawScreen()
The main function and variables look like this still (the only change being the default for top, which should resolve to the height of the screen – 0, 0 being the top left):
private static int _left = 0;
private static int _top = Console.WindowHeight - 1;
static void Main(string args)
Console.CursorVisible = false;
So, now we have a basis, the “bucket” moves along the bottom of the screen. The next task is to introduce the “falling things”.