Game programming, creation from scratch: for children and teenagers, as well as their parents and teachers! Part two. Designed for a wide range of readers and students of programming. Examples using Tkinter - Building modern windowing interfaces.
Recommended age: from 13 years old and after studying the first part of the material.
Writing Games: Learning Python 3 programming by writing simple games that demonstrate programming capabilities.
In this part, the main emphasis is on the study of data structures as a tool for processing information programmatically. Symbols, strings, one-dimensional and two-dimensional lists, algorithms for their processing, encryption, recursion, data sorting. Bonus: quick sort algorithm and long arithmetic.
Why this particular tutorial? I have been working as a computer science teacher for almost two decades and come across one annoying thing. Most of the materials designed to "teach programming" do not actually teach, but are a kind of reference on the language: syntax, functions, result. Agree, even if we learn the entire Russian-English dictionary, we won't speak English. Because for a conversation you need to know a thousand more subtleties: tenses, declensions, the use of pronouns and prepositions, and so on.
In this tutorial, I talk not only about the Python 3 language, but also lead the reader through reasoning, logical reasoning, answering not only the question "With what help?", But also "For what?" and why?" The whole theory will immediately be reflected in practice.
- basic information about symbols, strings, lists;
- algorithms built using recursion;
- long arithmetic;
- tricks and tricks of the programmer: you cannot cheat fate, but you can (and should) make your work easier;
- games: there are four games in this part:
1. "Guess the word" - a game in which the user, choosing one letter at a time, tries to guess the word of a certain subject in a small number of attempts.
2. "Fifteen" - a puzzle from my Soviet childhood, in which there is only one free cell on a 4x4 field. It is necessary to cunningly move the plates with numbers from 1 to 15 and make a certain sequence. By the way, this puzzle has been dripping for years.
3. "Space Invaders" (c) (tm), etc. The famous game with aliens arriving; we will have a light version implemented with Tkinter. You can do something more worthy on your own. One of the publications ranked Space Invaders first in the ranking of space shooters.
4. "Sokoban" - a loader simulator. Consider the principles of building labyrinth games in 2D perspective (top view).
The presented algorithms are aimed at educating:
- understanding the principles of the processor;
- practical ability to create and write algorithms in the language;
- the ability to implement data processing with Python tools;
- the ability to use modern high-level language tools;
- ... and popularization of creative pastime.
- algorithms for processing data structures;
- practical advice and comments based on many years of experience;
- stages of designing algorithms for games;
- a description of the work of the Tkinter library with practical examples;
- tests for practicing understanding of Python code.
Please, if you liked the app, please rate it and write a comment. Very motivating to continue working :)