asteroid-field.js 516 B

12345678910111213141516171819202122
  1. stages.push({
  2. id: "asteroid-field",
  3. setup: () => {
  4. getSet('starfield').setup();
  5. starMotion.velocity.x = 0.05;
  6. starMotion.velocity.y = 0.05;
  7. getSet('asteroid-field').setup();
  8. },
  9. update: (delta) => {
  10. getSet('starfield').update(delta);
  11. getSet('asteroid-field').update(delta);
  12. },
  13. draw: (context, delta) => {
  14. getSet('starfield').draw(context, delta);
  15. getSet('asteroid-field').draw(context, delta);
  16. atlas.drawCentered(context, userData.sprite, { x: 0, y: 0 });
  17. },
  18. cleanup: () => {
  19. },
  20. });