[Solved] How to create a switch for a takeDamage method
[ad_1] If I understood your question correctly, you want something like this: public void takeDamage(int damage){ shield-=damage; if(shield < 0){ health+=shield; //shield is negative,so subtracts leftover damage from health if(health <= 0){ lives–; health=DEFAULT_HEALTH_VALUE; //replace with your own default values shield=DEFAULT_SHIELD_VALUE; } } } 0 [ad_2] solved How to create a switch for a takeDamage … Read more