Advertisement
otorp2

mca follow within radius

May 3rd, 2020
752
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let generic_apple_man = sprites.create(img`
  2. . . . . . . . e c 7 . . . . . .
  3. . . . . e e e c 7 7 e e . . . .
  4. . . c e e e e c 7 e 2 2 e e . .
  5. . c e e e e e c 6 e e 2 2 2 e .
  6. . c e e e 2 e c c 2 4 5 4 2 e .
  7. c e e e 2 2 2 2 2 2 4 5 5 2 2 e
  8. c e e 2 2 2 2 2 2 2 2 4 4 2 2 e
  9. c e e 2 2 2 c 2 2 c 2 2 2 2 2 e
  10. c e e 2 2 2 c 2 2 c 2 2 2 2 2 e
  11. c e e 2 2 2 c 2 2 c 2 2 2 2 2 e
  12. c e e 2 2 2 2 2 2 2 2 2 2 4 2 e
  13. . e e e 2 c c c c c c 2 2 4 e .
  14. . 2 e e 2 2 2 2 2 2 2 2 4 2 e .
  15. . . 2 e e 2 2 2 2 2 4 4 2 e . .
  16. . . . 2 2 e e 4 4 4 2 e e . . .
  17. . . . . . 2 2 e e e e . . . . .
  18. `, SpriteKind.Player)
  19. controller.moveSprite(generic_apple_man)
  20. let no_joke_pure_evil = sprites.create(img`
  21. . . . . . . . . . . . . . . . .
  22. . . . . . . . . . . b 5 b . . .
  23. . . . . . . . . . b 5 b . . . .
  24. . . . . . . b b b b b b . . . .
  25. . . . . . b b 4 5 5 5 5 b 4 . .
  26. . b b b b b 5 5 4 5 5 5 4 b . .
  27. . b d 5 b 5 5 5 5 4 5 4 5 b . .
  28. . . b 5 5 b 5 d 1 f 4 d 4 f . .
  29. . . b d 5 5 b 1 f f 5 4 4 c . .
  30. b b d b 5 5 5 d f b f f 4 f 4 b
  31. b d d c d 5 5 b 5 4 4 4 f 4 b .
  32. c d d d c c b 5 5 5 5 5 5 5 b .
  33. c b d d d d d 5 5 5 5 5 5 5 b .
  34. . c d d d d d d 5 5 5 5 5 d b .
  35. . . c b d d d d d 5 5 5 b b . .
  36. . . . c c c c c c c c b b . . .
  37. `, SpriteKind.Enemy)
  38. no_joke_pure_evil.setPosition(140, 15)
  39. game.onUpdate(function () {
  40.     for (let value of sprites.allOfKind(SpriteKind.Enemy)) {
  41.         if (value.x > generic_apple_man.x - 48 && value.x < generic_apple_man.x + 48 && (value.y > generic_apple_man.y - 48 && value.y < generic_apple_man.y + 48)) {
  42.             value.follow(generic_apple_man, 50)
  43.         }
  44.     }
  45. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement