<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Space Invaders :: CoderDojo Python &amp; Pygame</title><link>https://python.coderdojohasselt.be/en/challenges/02-space-invaders/index.html</link><description>Note Requires: session 7 finished.
Aliens are lined up in a 4×9 formation. They move back and forth, drop down at every edge and shoot back at random. You have one ship and three lives. Shoot them all down before they land.
Getting started Download the starter code and unpack the ZIP. Open main.py in Thonny and click Run. You see the ship and the alien formation. The controls and the images are already there. You fill in the movement, the shooting and the collisions.</description><generator>Hugo</generator><language>en</language><atom:link href="https://python.coderdojohasselt.be/en/challenges/02-space-invaders/index.xml" rel="self" type="application/rss+xml"/><item><title>Space Invaders: Coach notes</title><link>https://python.coderdojohasselt.be/en/challenges/02-space-invaders/mentor-notes/index.html</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://python.coderdojohasselt.be/en/challenges/02-space-invaders/mentor-notes/index.html</guid><description>Goal of the challenge A ninja has finished the challenge when:
✅ Basic: the ship moves, the formation moves back and forth and drops down, the player can shoot with a cooldown. ⭐ Stretch: bullets hit aliens (score), aliens shoot back at random, lives go down on a hit; game-over screen. 🔥 Expert: formation speeds up with fewer aliens, game over on landing, restart with R. Preparation Give the ninja the starter code. It contains main.py and the images/ folder with ship.png, enemy.png and laser.png. Window, clock, font, colours, constants, loading images and maak_vijanden() are already in the starter code. Check that pygame is available on the laptop (see Installing Thonny). Common questions “The aliens move, but they don’t drop down” The edge check has to come after the move, not before it. The ninja first works out the new rechts/links after shifting, and only then the edge check. Check that alien.y += ALIEN_VAL really sits inside the if block.</description></item></channel></rss>