« All Events
7 PM – Advanced Python Game Development
December 1, 2021 @ 7:00 pm - 8:00 pm
Today We Do
- We reviewed inheritance where with inheritance, we can avoid duplicating codes.
- We went over the homework on how to properly override Turret.load_image(self) and Turret.get_turret_angle(self) inside EnemyTurret.
- We extracted codes inside PlayerTank.update() which handles tank movement into its own method “tank_movement_control”. This way we can override this method in EnemyTank.tank_movement_control to make the enemy tank move independently.
Homework
- Make the enemy tank not able to go through the wall. Look at how we did it for Player Tank.
- PlayerTank.load_images(self) is overriden inside EnemyTank.load_images(self). But there are too many codes being duplicated. Extract the code inside PlayerTank.load_images(self) which will get the image path into its own method. And then override this method inside EnemyTank.