User prompt
Change the place that says Coin to a symbol
User prompt
Move the place that says Coin to the upper middle part
User prompt
Make the floor animated βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Background, endless, image
User prompt
Increases coins
User prompt
When you click on settings, there will be sound settings βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
Add a start screen to the game, press the button to play, and go to settings to adjust the sound. βͺπ‘ Consider importing and using the following plugins: @upit/storage.v1
User prompt
Slightly increase the size of everything on the screen βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Make the character an animated fox βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Clear all obstacles
User prompt
Delete the mountain and forest in the background
User prompt
Let the character appear in the foreground
User prompt
Make a mountain and a grassy forest and make it animated βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
As the ground character progresses, it progresses with it.
User prompt
When the character jumps, leave a small trail behind βͺπ‘ Consider importing and using the following plugins: @upit/tween.v1
User prompt
Let the character jump a little more 2 units
User prompt
The more you press on the screen, the higher the character jumps.
User prompt
Adjust the randomness of obstacles proportionally
User prompt
Adjust the size of your character enough to jump over obstacles
User prompt
Replace the number of lives on the screen with 3 hearts
User prompt
Give the character the right to life and give it 3 lives
User prompt
Make the character's hitbox round
User prompt
Make the obstacle locations a little more random
User prompt
Convert the obstacle model to the thorn model
Code edit (1 edits merged)
Please save this source code
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Coin = Container.expand(function () {
var self = Container.call(this);
var coinGraphics = self.attachAsset('coin', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = gameSpeed;
self.collected = false;
// Floating animation
self.floatOffset = 0;
self.update = function () {
self.x -= self.speed;
// Floating animation
self.floatOffset += 0.15;
coinGraphics.y = Math.sin(self.floatOffset) * 10;
// Rotation animation
coinGraphics.rotation += 0.1;
};
return self;
});
var Forest = Container.expand(function () {
var self = Container.call(this);
var forestGraphics = self.attachAsset('forest', {
anchorX: 0.5,
anchorY: 1.0
});
self.speed = gameSpeed * 0.5; // Forest moves at medium speed for parallax
self.sway = 0;
self.update = function () {
self.x -= self.speed;
// Gentle swaying animation for trees
self.sway += 0.05;
forestGraphics.y = Math.sin(self.sway) * 2;
};
return self;
});
var Mountain = Container.expand(function () {
var self = Container.call(this);
var mountainGraphics = self.attachAsset('mountain', {
anchorX: 0.5,
anchorY: 1.0
});
self.speed = gameSpeed * 0.3; // Mountains move slower for parallax effect
self.sway = 0;
self.update = function () {
self.x -= self.speed;
// Gentle swaying animation
self.sway += 0.02;
mountainGraphics.y = Math.sin(self.sway) * 3;
};
return self;
});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 1.0
});
self.isJumping = false;
self.velocityY = 0;
self.groundY = 2732 - 200; // Ground level
self.jumpPower = -27;
self.gravity = 1.2;
self.jump = function () {
if (!self.isJumping) {
self.isJumping = true;
self.velocityY = self.jumpPower;
LK.getSound('jump').play();
}
};
self.update = function () {
if (self.isJumping) {
self.velocityY += self.gravity;
self.y += self.velocityY;
// Land on ground
if (self.y >= self.groundY) {
self.y = self.groundY;
self.isJumping = false;
self.velocityY = 0;
}
}
};
return self;
});
var Thorn = Container.expand(function () {
var self = Container.call(this);
var thornGraphics = self.attachAsset('thorn', {
anchorX: 0.5,
anchorY: 1.0
});
self.speed = gameSpeed;
self.update = function () {
self.x -= self.speed;
};
return self;
});
var Trail = Container.expand(function () {
var self = Container.call(this);
var trailGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 1.0,
scaleX: 0.6,
scaleY: 0.6,
alpha: 0.7
});
self.speed = gameSpeed;
self.update = function () {
self.x -= self.speed;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87CEEB
});
/****
* Game Code
****/
var player;
var thorns = [];
var coins = [];
var trails = [];
var mountains = [];
var forests = [];
var gameSpeed = 8;
var spawnTimer = 0;
var coinCount = 0;
var distanceScore = 0;
var groundY = 2732 - 200;
var playerLives = 3;
var trailTimer = 0;
var mountainSpawnTimer = 0;
var forestSpawnTimer = 0;
// UI Elements
var coinText = new Text2('Coins: 0', {
size: 60,
fill: 0xFFFFFF
});
coinText.anchor.set(0, 0);
LK.gui.topLeft.addChild(coinText);
var scoreText = new Text2('Distance: 0', {
size: 60,
fill: 0xFFFFFF
});
scoreText.anchor.set(1, 0);
LK.gui.topRight.addChild(scoreText);
// Create heart UI elements
var hearts = [];
for (var h = 0; h < 3; h++) {
var heart = LK.getAsset('heart', {
anchorX: 0.5,
anchorY: 0.5,
x: 80 + h * 70,
y: 80
});
hearts.push(heart);
LK.gui.topLeft.addChild(heart);
}
// Create ground
var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0,
anchorY: 0,
x: 0,
y: groundY
}));
// Create player
player = game.addChild(new Player());
player.x = 400;
player.y = groundY;
player.isInvulnerable = false;
// Touch controls
game.down = function (x, y, obj) {
player.jump();
};
function spawnThorn() {
var thorn = new Thorn();
// Proportional random offset that increases with game speed
var maxOffset = 50 + Math.floor(gameSpeed * 5); // Increases with game speed
thorn.x = 2048 + 100 + Math.random() * maxOffset;
thorn.y = groundY;
thorns.push(thorn);
game.addChild(thorn);
// Sometimes spawn a coin above the thorn
var coinChance = Math.max(0.5, 0.7 - distanceScore / 5000); // Decrease coin frequency as game progresses
if (Math.random() < coinChance) {
var coin = new Coin();
coin.x = thorn.x;
// Proportional random height that increases with progression
var minHeight = 150;
var maxHeight = 100 + Math.floor(distanceScore / 500); // Height variation increases with distance
coin.y = thorn.y - minHeight - Math.random() * maxHeight;
coins.push(coin);
game.addChild(coin);
}
}
function spawnCoin() {
var coin = new Coin();
coin.x = 2048 + 100;
coin.y = groundY - 100 - Math.random() * 150;
coins.push(coin);
game.addChild(coin);
}
function spawnMountain() {
var mountain = new Mountain();
mountain.x = 2048 + 200;
mountain.y = groundY + 50;
mountain.speed = gameSpeed * 0.3;
mountains.push(mountain);
game.addChild(mountain);
// Add subtle color variation
var colorVariation = Math.random() * 0.3;
tween(mountain, {
tint: 0x8B7355 + Math.floor(colorVariation * 0x222222)
}, {
duration: 0
});
}
function spawnForest() {
var forest = new Forest();
forest.x = 2048 + 150;
forest.y = groundY;
forest.speed = gameSpeed * 0.5;
forests.push(forest);
game.addChild(forest);
// Add subtle swaying animation
tween(forest, {
rotation: Math.random() * 0.1 - 0.05
}, {
duration: 2000 + Math.random() * 1000,
easing: tween.easeInOut
});
}
game.update = function () {
// Increase distance score
distanceScore += 1;
scoreText.setText('Distance: ' + Math.floor(distanceScore / 10));
// Gradually increase speed
gameSpeed = 8 + distanceScore / 2000;
// Move ground with game progression
ground.x -= gameSpeed;
// Reset ground position when it moves too far left
if (ground.x <= -2048) {
ground.x = 0;
}
// Update spawn timer
spawnTimer++;
trailTimer++;
mountainSpawnTimer++;
forestSpawnTimer++;
// Spawn mountains
if (mountainSpawnTimer % 200 == 0) {
spawnMountain();
}
// Spawn forests
if (forestSpawnTimer % 150 == 0) {
spawnForest();
}
// Create trail when player is jumping
if (player.isJumping && trailTimer % 3 == 0) {
var trail = new Trail();
trail.x = player.x;
trail.y = player.y;
trail.speed = gameSpeed;
trails.push(trail);
game.addChild(trail);
// Fade out trail
tween(trail, {
alpha: 0,
scaleX: 0.3,
scaleY: 0.3
}, {
duration: 500,
onFinish: function onFinish() {
trail.destroy();
}
});
}
// Spawn thorns with random intervals that scale with progression
var baseInterval = Math.max(40, 70 - Math.floor(distanceScore / 1000)); // Decrease base interval as game progresses
var randomVariation = Math.floor(Math.random() * (baseInterval * 0.6)); // Random variation is 60% of base interval
var thornSpawnInterval = baseInterval + randomVariation;
if (spawnTimer % thornSpawnInterval == 0) {
spawnThorn();
}
// Spawn additional coins
if (spawnTimer % 120 == 0 && Math.random() < 0.4) {
spawnCoin();
}
// Update and check thorns
for (var i = thorns.length - 1; i >= 0; i--) {
var thorn = thorns[i];
thorn.speed = gameSpeed;
// Check collision with player
if (player.intersects(thorn) && !player.isInvulnerable) {
playerLives--;
// Hide a heart
if (hearts[playerLives]) {
hearts[playerLives].visible = false;
}
if (playerLives <= 0) {
LK.showGameOver();
return;
} else {
// Make player invulnerable temporarily
player.isInvulnerable = true;
LK.effects.flashObject(player, 0xFF0000, 1500);
// Remove invulnerability after 1.5 seconds
LK.setTimeout(function () {
player.isInvulnerable = false;
}, 1500);
}
}
// Remove off-screen thorns
if (thorn.x < -100) {
thorn.destroy();
thorns.splice(i, 1);
}
}
// Update and check coins
for (var j = coins.length - 1; j >= 0; j--) {
var coin = coins[j];
coin.speed = gameSpeed;
// Check collection
if (!coin.collected && player.intersects(coin)) {
coin.collected = true;
coinCount++;
LK.setScore(coinCount);
coinText.setText('Coins: ' + coinCount);
LK.getSound('coin').play();
// Visual feedback
LK.effects.flashObject(coin, 0xFFFFFF, 300);
tween(coin, {
alpha: 0,
scaleX: 2,
scaleY: 2
}, {
duration: 300,
onFinish: function onFinish() {
coin.destroy();
}
});
coins.splice(j, 1);
continue;
}
// Remove off-screen coins
if (coin.x < -50) {
coin.destroy();
coins.splice(j, 1);
}
}
// Update and clean up trails
for (var k = trails.length - 1; k >= 0; k--) {
var trail = trails[k];
trail.speed = gameSpeed;
// Remove off-screen or completely faded trails
if (trail.x < -100 || trail.alpha <= 0.1) {
trail.destroy();
trails.splice(k, 1);
}
}
// Update and clean up mountains
for (var m = mountains.length - 1; m >= 0; m--) {
var mountain = mountains[m];
mountain.speed = gameSpeed * 0.3;
// Remove off-screen mountains
if (mountain.x < -400) {
mountain.destroy();
mountains.splice(m, 1);
}
}
// Update and clean up forests
for (var f = forests.length - 1; f >= 0; f--) {
var forest = forests[f];
forest.speed = gameSpeed * 0.5;
// Remove off-screen forests
if (forest.x < -300) {
forest.destroy();
forests.splice(f, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -25,8 +25,40 @@
coinGraphics.rotation += 0.1;
};
return self;
});
+var Forest = Container.expand(function () {
+ var self = Container.call(this);
+ var forestGraphics = self.attachAsset('forest', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ self.speed = gameSpeed * 0.5; // Forest moves at medium speed for parallax
+ self.sway = 0;
+ self.update = function () {
+ self.x -= self.speed;
+ // Gentle swaying animation for trees
+ self.sway += 0.05;
+ forestGraphics.y = Math.sin(self.sway) * 2;
+ };
+ return self;
+});
+var Mountain = Container.expand(function () {
+ var self = Container.call(this);
+ var mountainGraphics = self.attachAsset('mountain', {
+ anchorX: 0.5,
+ anchorY: 1.0
+ });
+ self.speed = gameSpeed * 0.3; // Mountains move slower for parallax effect
+ self.sway = 0;
+ self.update = function () {
+ self.x -= self.speed;
+ // Gentle swaying animation
+ self.sway += 0.02;
+ mountainGraphics.y = Math.sin(self.sway) * 3;
+ };
+ return self;
+});
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
@@ -99,15 +131,19 @@
var player;
var thorns = [];
var coins = [];
var trails = [];
+var mountains = [];
+var forests = [];
var gameSpeed = 8;
var spawnTimer = 0;
var coinCount = 0;
var distanceScore = 0;
var groundY = 2732 - 200;
var playerLives = 3;
var trailTimer = 0;
+var mountainSpawnTimer = 0;
+var forestSpawnTimer = 0;
// UI Elements
var coinText = new Text2('Coins: 0', {
size: 60,
fill: 0xFFFFFF
@@ -175,8 +211,38 @@
coin.y = groundY - 100 - Math.random() * 150;
coins.push(coin);
game.addChild(coin);
}
+function spawnMountain() {
+ var mountain = new Mountain();
+ mountain.x = 2048 + 200;
+ mountain.y = groundY + 50;
+ mountain.speed = gameSpeed * 0.3;
+ mountains.push(mountain);
+ game.addChild(mountain);
+ // Add subtle color variation
+ var colorVariation = Math.random() * 0.3;
+ tween(mountain, {
+ tint: 0x8B7355 + Math.floor(colorVariation * 0x222222)
+ }, {
+ duration: 0
+ });
+}
+function spawnForest() {
+ var forest = new Forest();
+ forest.x = 2048 + 150;
+ forest.y = groundY;
+ forest.speed = gameSpeed * 0.5;
+ forests.push(forest);
+ game.addChild(forest);
+ // Add subtle swaying animation
+ tween(forest, {
+ rotation: Math.random() * 0.1 - 0.05
+ }, {
+ duration: 2000 + Math.random() * 1000,
+ easing: tween.easeInOut
+ });
+}
game.update = function () {
// Increase distance score
distanceScore += 1;
scoreText.setText('Distance: ' + Math.floor(distanceScore / 10));
@@ -190,8 +256,18 @@
}
// Update spawn timer
spawnTimer++;
trailTimer++;
+ mountainSpawnTimer++;
+ forestSpawnTimer++;
+ // Spawn mountains
+ if (mountainSpawnTimer % 200 == 0) {
+ spawnMountain();
+ }
+ // Spawn forests
+ if (forestSpawnTimer % 150 == 0) {
+ spawnForest();
+ }
// Create trail when player is jumping
if (player.isJumping && trailTimer % 3 == 0) {
var trail = new Trail();
trail.x = player.x;
@@ -293,5 +369,25 @@
trail.destroy();
trails.splice(k, 1);
}
}
+ // Update and clean up mountains
+ for (var m = mountains.length - 1; m >= 0; m--) {
+ var mountain = mountains[m];
+ mountain.speed = gameSpeed * 0.3;
+ // Remove off-screen mountains
+ if (mountain.x < -400) {
+ mountain.destroy();
+ mountains.splice(m, 1);
+ }
+ }
+ // Update and clean up forests
+ for (var f = forests.length - 1; f >= 0; f--) {
+ var forest = forests[f];
+ forest.speed = gameSpeed * 0.5;
+ // Remove off-screen forests
+ if (forest.x < -300) {
+ forest.destroy();
+ forests.splice(f, 1);
+ }
+ }
};
\ No newline at end of file
Just crystal
Just his head
Background, endless, forest, winter, cartoon. In-Game asset. 2d. High contrast. No shadows
Only the line of the ears and the color of the paws should be gray
Only the line of the ears and the color of the paws should be gray
Let C2 have the character's color
Only the line of the ears and the color of the paws should be gray
Delete the character on it
A version without snow
Koyu mavi elips start butonu. In-Game asset. 2d. High contrast. No shadows. In-Game asset. 2d. High contrast. No shadows
UcΜ§an bir dinazor. In-Game asset. 2d. High contrast. No shadows
Alev topu. In-Game asset. 2d. High contrast. No shadows
Mavi top rasengan top. In-Game asset. 2d. High contrast. No shadows
jump
Sound effect
coin
Sound effect
Arkaplanmuzik
Music
gem_collect
Sound effect
happy_giggle
Sound effect
Canazalma
Sound effect
Arkaplanmuzik1
Music
wumpa1
Sound effect
cancan
Sound effect
box_break
Sound effect
tnt_break
Sound effect
enemy_sound
Sound effect
bullet_sound
Sound effect