===================================================================
--- original.js
+++ change.js
@@ -10,10 +10,12 @@
anchorY: 0.5
});
self.speed = 5;
self.update = function () {
- // Create a floating effect by adjusting the player's y position using a sine wave
- self.y += Math.sin(LK.ticks / 10) * 2;
+ self.y += self.speed;
+ if (self.y > 2732) {
+ self.destroy();
+ }
};
});
// Define the Player class
var Player = Container.expand(function () {
@@ -25,8 +27,12 @@
self.down = function (x, y, obj) {
self.x = x;
self.y = y;
};
+ self.update = function () {
+ // Create a floating effect by slightly adjusting the y position
+ self.y += Math.sin(LK.ticks / 10) * 2;
+ };
});
/****
* Initialize Game
一颗陨石. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
一个宇航员,卡通风格. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
一个太空星空背景,唯美,浪漫. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
一颗陨石,卡通风格. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
一个金币,卡通. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.