« All Events
3:30 PM – Adv Python Game Dev – Latisha
December 16, 2023 @ 3:30 pm - 4:30 pm
Today We Did
- We continued with Tank War
- We created EnemyTank, EnemyTurret
- We made the Turret moved with the Tank
- We used inheritance to reduce code duplication in EnemyTank
Homework
- Use inheritance to reduce code duplication in EnemyTurret. This is very similar with what we did in EnemyTank using inheritance.
- Inside EnemyTank.load_images(self) reduce the code duplication by creating a method that would provide the image name. This way you can remove the entire load_images(self) method from EnemyTank class hence reducing the code duplication even more. This is very similar why we create create_turret
(self) method inside Tank and EnemyTank.