American Young Coder

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Intro To Java – Gamas

May 7, 2022 @ 5:00 pm - 6:00 pm

Today We Do
  1. We continued with magic attack and how to rely on inheritance to have custom behavior for Dragon.
  2. We learned how to call parent’s method from the children class. For example, how to call monster.doDamage(int amount) from dragon class by using super.doDamage(amount).
Homework
  1. Create WaterGolem.java which inherits from Monster.java
  2. Override doMagicDamage(String magicAttackType, int amount) and add special behavior:
    • a. if magicAttackType is fire, print Water Golem is immune to fire magic attack. No damage is done.
    • b. if magicAttackType is water, print Water Golem is resistant to water magic attack. Damage is halved.
    • c. if magicAttackType is wind, print Wind is super effective against Water Golem. Damage is doubled.
    • everything else just do regular damage.
  3. Download Android Studio from here: https://developer.android.com/studio

Details

Date:
May 7, 2022
Time:
5:00 pm - 6:00 pm