« All Events
6 PM – Adv Python Game Dev – Gamas
July 27, 2023 @ 6:00 pm - 7:00 pm
Today We Did
- We added “region <region>” information on the screen for debugging purposes.
- We added EnemyTwo class which inherits from Enemy class. This way we can override the self.images used for 2nd enemy type.
Homework
- Inside EnemyTwo.__init__(…) method, you need to load images from “assets/images/monster-character-2d-sprites/PNG/2/2_enemies_1_RUN_00{id}.png” .
- After you do this, inside main.py use EnemyTwo instead of Enemy class this way, EnemyTwo images will be shown
- Inside Enemy class, add one more attribute self.health = 100
- Inside Enemy class, load the heart image (“assets/images/heart.png”)
and display it next to the monster image. This is very similar to again Shoot Balloon “bad balloon” text but instead of text, you want to blit the heart image. - Inside Enemy class, blit the self.health next to heart image.
- Look at below screenshot for reference