travel-right.js 573 B

12345678910111213141516171819202122
  1. stages.push({
  2. id: "travel-right",
  3. setup: () => {
  4. getSet('starfield').setup();
  5. starMotion.velocity.x = -1;
  6. starMotion.velocity.y = 0;
  7. },
  8. update: (delta) => {
  9. getSet('starfield').update(delta);
  10. },
  11. draw: (context, delta) => {
  12. getSet('starfield').draw(context, delta);
  13. context.fillStyle = "grey";
  14. context.save();
  15. context.rotate(90 * Math.PI / 180);
  16. atlas.drawCentered(context, "fire08.png", { x: 0, y: 57 });
  17. atlas.drawCentered(context, userData.sprite, { x: 0, y: 0 });
  18. context.restore();
  19. },
  20. cleanup: () => { },
  21. });