Faster game, part 6th – Laser hit enemy

In this last video about making the game ‘faster’ with Pythonista, we added the code to detect the collision among the laser and the alien enemies ships. Using the self.lasers list and the enemies.list we can check the intersections of this Sprites. In the code there is also a limitation of lasers that can exist in the same moment on the screen to just two of them, as you can see in the touch_began method, in the first line of code with a if condition statement.

 

Published by pythonprogramming

Started with basic on the spectrum, loved javascript in the 90ies and python in the 2000, now I am back with python, still making some javascript stuff when needed.