Hey guys. I was hoping that someone could help me figure out how to increase the score. I have a game that uses enumeration to get points for killing an enemy, I want the value of the enemy to increase by 10 times every time one of the enemies was killed. Here is the code I have for listing:
public enum gamescore
and a method to get an estimate called from another class when an enemy dies:
public int GetScore()// The method that utilieses the enumeration to get the score for the enemy killed { if (this is Martian) { return (int)gamescore.Martian; } else if (this is Vesuvian) { return (int)gamescore.Vesuvian; } else if (this is Mercurian) { return (int)gamescore.Mercurian; } else if (this is Destroyer) { return (int)gamescore.Destroyer; } else if (this is Meteor) { return (int)gamescore.Meteor; } else if (this is Mothership) { return (int)gamescore.MotherShip; } return 0; }
Any suggestions? I can only come up with sophisticated ways to do this that I don't think even works.
In addition, I was interested, I have a high-rated shortcut, which is updated if it is less than the rating, so the result becomes a score, but when the application restarts, if the game is completed or if the player runs out of life, the records are reset back to zero Is there a way to keep the record value in it, so that the highest score is always there?
I appreciate all your help with my questions, guys, I really do.
Thanks!
deucalion0
source share