Why is not possible to change flying-ball to potion-medium?
This works:
Now that the paddle is ready, we create the flying ball:
game.spawnXY(“flying-ball”, 40, 30)
game.setPropertyFor(“flying-ball”, “speed”, 30)
game.setPropertyFor(“flying-ball”, “rotation”, 0.8)
When the ball hits things, it defeats them:
game.setActionFor(“flying-ball”, “collide”, handler.defeatOther())
If it leaves the screen, it comes back to the center:
game.setActionFor(“flying-ball”, “exit”, handler.teleportTo(40, 40))
Each lost ball costs 20 points:
game.setActionFor(“flying-ball”, “exit”, handler.addScore(-20))
This don`t work :
game.spawnXY(“potion-medium”, 40, 30)
game.setPropertyFor(“potion-medium”, “speed”, 30)
game.setPropertyFor(“potion-medium”, “rotation”, 0.8)
game.setActionFor(“potion-medium”, “collide”, handler.defeatOther())
game.setActionFor(“potion-medium”, “exit”, handler.teleportTo(40, 40))
game.setActionFor(“potion-medium”, “exit”, handler.addScore(-20))