Created
September 23, 2012 07:46
-
-
Save miketamis/3769238 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Random; | |
public class TileLongGrass extends Tile { | |
public static final int CHANCE_OF_FINDING_MONSTER = 2; | |
@Override | |
public void stepOn(EntityPlayer entityPlayer, int x, int y) { | |
System.out.println("YOU DARE STAND ON LONG GRASS!!!!" ); | |
Random generator = new Random(); | |
if(generator.nextInt(CHANCE_OF_FINDING_MONSTER) | |
MonsterData.monsters[generator.nextInt(monsters.size)].printMonster(); | |
else | |
System.out.println("No monster" ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment