launch-from-station.js 752 B

1234567891011121314151617181920212223242526272829
  1. stages.push({
  2. id: "launch-from-station",
  3. setup: () => {
  4. getSet('starfield').setup();
  5. starMotion.velocity.x = -0.10;
  6. starMotion.velocity.y = 0.05;
  7. getSet('station').setup();
  8. stationPosition.x = 150;
  9. stationTargetPosition.x = -150;
  10. },
  11. update: (delta) => {
  12. getSet('starfield').update(delta);
  13. getSet('station').update(delta);
  14. },
  15. draw: (context, delta) => {
  16. getSet('starfield').draw(context, delta);
  17. context.save();
  18. context.rotate(90 * Math.PI / 180);
  19. atlas.drawCentered(context, "fire08.png", { x: 0, y: 57 });
  20. atlas.drawCentered(context, userData.sprite, { x: 0, y: 0 });
  21. context.restore();
  22. getSet('station').draw(context, delta);
  23. },
  24. cleanup: () => {
  25. },
  26. });