hero 2
This commit is contained in:
parent
e0da743cb4
commit
d43c0f6e23
@ -98,13 +98,9 @@ while (true) {
|
|||||||
Let's create the third function and forth function that continues the same logic in the y-direction of pacman and ghost. We create a function from the Game drawer that will check the y-direction of pacman and ghost. Finally, change the y-direction of the ghost to continue following pacman.
|
Let's create the third function and forth function that continues the same logic in the y-direction of pacman and ghost. We create a function from the Game drawer that will check the y-direction of pacman and ghost. Finally, change the y-direction of the ghost to continue following pacman.
|
||||||
|
|
||||||
```blocks
|
```blocks
|
||||||
|
let hero = game.createSprite(2, 2);
|
||||||
let ghost = 0;
|
let food = game.createSprite(4, 4);
|
||||||
let food = 0;
|
let ghost = game.createSprite(0, 0);
|
||||||
let hero = 0;
|
|
||||||
hero = game.createSprite(2, 2);
|
|
||||||
food = game.createSprite(4, 4);
|
|
||||||
ghost = game.createSprite(0, 0);
|
|
||||||
ghost.change(LedSpriteProperty.Blink, 100);
|
ghost.change(LedSpriteProperty.Blink, 100);
|
||||||
food = led.brightness() == 8;
|
food = led.brightness() == 8;
|
||||||
while (true) {
|
while (true) {
|
||||||
|
Loading…
Reference in New Issue
Block a user