American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

3:30 PM – Adv Python Game Dev – Latisha

December 16, 2023 @ 3:30 pm - 4:30 pm

Today We Did
  1. We continued with Tank War
    1. We created EnemyTank, EnemyTurret
    2. We made the Turret moved with the Tank
    3. We used inheritance to reduce code duplication in EnemyTank
  1. Use inheritance to reduce code duplication in EnemyTurret. This is very similar with what we did in EnemyTank using inheritance.
  2. 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.


December 16, 2023
3:30 pm - 4:30 pm
Verified by MonsterInsights