These lessons are based on a simplified version of a space shooter game that I developed using Squeak. The original version was very fun to develop and was my first Squeak program. I continue to work on it to improve it and to further my understanding of object-oriented programming. I am not an expert and still have much to learn.
The original game lent itself well to teaching an entire program to my son using Smalltalk and its environment. He already had a couple of years learning Python. I figured that in the second half of his school year I would teach him Smalltalk. The game had elements he would enjoy programming, and it was in a domain he was already familiar with.
My son picked up Smalltalk quickly. While he understood Python well, he grasped Smalltalk even more easily. As a language, Smalltalk removed the language barrier and made it easy for him to focus instead on the tasks at hand and be creative (at his level, he is 12). The language just seemed natural to him. Smalltalk is a great language, even for kids. Squeak, in particular, offers a lot in this regard. It provides an excellent environment for teaching and learning Smalltalk, object-oriented programming, and programming in general.
He enjoyed using Squeak, and here is a bit of what he wrote in a report about his experience:
Smalltalk is an object-oriented programming language that is really easy to use. If you create a game, you can change it while it is still running! Unlike other programming languages this takes less time to code. In other languages you have to type SO many lines of code.
In Smalltalk there is a thing called the debugger that puts you straight to the flaw so you can fix it, you don't even need to get out of the debugger to fix the flaw. Other languages you have to look at almost all of your code to find one tiny mistake.
You can also “explore” morphs to find out what it took to code the morph. Smalltalk is like a digital playground, you can add so many things in your code, like sound effects.
Programming concepts are introduced throughout the lessons to keep things moving and to ensure that each topic receives proper attention. These lessons are designed for live coding, meaning the game does not need to be closed and restarted when changes are made. You can follow through the lessons just as easily without live coding; however, you may not learn as many topics, as some only arise from using live coding. Each lesson also includes a corresponding downloadable PDF document for additional reference.
Although the lessons were created for my middle school-aged child, they could also be fun for adults (I have had some ask for them, which is why I have made them available). I wrote the lessons daily and tried to be consistent throughout, but I am sure such may not always be the case. I also discussed topics before each lesson, providing much more detail. There may be things not written that would be helpful – if so, please let me know. I am happy to add more helpful information. Feedback is certainly welcome. Chapter 1 of the Squeak By Example PDF/book below would be a great resource to get started.
Key Learning Topics and Skills Covered in These Lessons:
Game Controls:
Game Features:
Squeak Smalltalk – squeak.org
Squeak by Example PDF (6.0 Edition) – SBE-6.0.pdf
Squeak by Example printed book (6.0 Edition) – Amazon, Lulu
An Introduction to Morphic: The Squeak User Interface Framework – morphic.final.pdf
Source code (open, MIT license):
Filein code for this game – ShooterGame.st (full code for the game)
Hit sound file – HitSound.wav
Ship image file – Ship.png
Enemy image file – Enemy.png
Shooter Game in your browser – Play Now!
If you have any questions, comments, or suggestions you can reach me at scott.gibson@posteo.net.