Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Enemy {
- public int xPos;
- public int yPos;
- public int mHealth;
- public int health;
- public int type;
- public int level;
- public final int ORC = 0;
- public final int GOBLIN = 1;
- public final int ADDER = 2;
- public final int HOBGOBLIN = 3;
- public final int BAT = 4;
- public final int RAT = 5;
- public final int DEMON = 6;
- public final int ANT = 7;
- public final int ZOMBIE = 8;
- public final int TROLL = 9;
- public Enemy(int x, int y, int floor) {
- xPos = x;
- yPos = y;
- if (floor >= 1 && floor <= 5) {
- Random r = new Random();
- int monsterSelect = r.nextInt(4) + 1;
- switch (monsterSelect) {
- case 1:
- type = ORC;
- level = floor * 2;
- mHealth = 25;
- health = 25;
- break;
- case 2:
- type = BAT;
- level = 1;
- mHealth = 5;
- health = 5;
- break;
- case 3:
- type = ADDER;
- mHealth = 10;
- health = 10;
- break;
- case 4:
- type = RAT;
- mHealth = 10;
- health = 10;
- break;
- default:
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement