Fix randomInt
This commit is contained in:
1 parent
b5814709f8
commit
6f148c14e0
61 files changed
+152
-158
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user