Fix randomInt

This commit is contained in:
Sam El-Husseini committed 2018-06-01 11:42:38 -07:00
1 parent b5814709f8
commit 6f148c14e0
61 files changed
+152 -158

No files matched your search

+4 -4
View File
@@ -193,8 +193,8 @@ while (true) {
}
if (hero.isTouching(food)) {
game.addScore(1);
food.set(LedSpriteProperty.X, Math.randomInt(5));
food.set(LedSpriteProperty.Y, Math.randomInt(5));
food.set(LedSpriteProperty.X, Math.randomRange(0, 5));
food.set(LedSpriteProperty.Y, Math.randomRange(0, 5));
}
}
@@ -241,8 +241,8 @@ while (true) {
}
if (hero.isTouching(food)) {
game.addScore(1);
food.set(LedSpriteProperty.X, Math.randomInt(5));
food.set(LedSpriteProperty.Y, Math.randomInt(5));
food.set(LedSpriteProperty.X, Math.randomRange(0, 5));
food.set(LedSpriteProperty.Y, Math.randomRange(0, 5));
if (food.get(LedSpriteProperty.X) < 2 && food.get(LedSpriteProperty.Y) < 2) {
ghost.set(LedSpriteProperty.X, 4);
ghost.set(LedSpriteProperty.Y, 4);