User prompt
Make the map icons in both map screen and home screen a bit bigger.
User prompt
Make sure that when pressing the map button, also on that map select, the maps appear next to each other and not below each other.
User prompt
Make it so that there is no hearable gap between the looping sounds. Also, remove the AI assistant jumping over the first obstacle.
User prompt
Make sure that the background ambience only appears when, well, during gameplay. Also, make the maps in the map button show up the same way they do now in the main menu.
User prompt
Make sure the ground also spans until the bottom of the screen. Also, make the same thing you did with the beach soundtrack for Jungle for the Jungle map and Volcano for the Volcano map.
User prompt
Remove the debugging feature.
User prompt
use the soundtrack beach as the ambience well for the beach
User prompt
Make sure the game stays possible and not gets too fast. Also, remove the turtle trick. Also, make the screen flash golden. When reaching gold, rang, but make the game stop for that second as well. Also, ↪💡 Consider importing and using the following plugins: @upit/tween.v1, @upit/storage.v1
User prompt
Add to the settings an AI player button which makes an AI play the game with perfect jumps and perfect everything.
User prompt
make the main character turtle sit next to the score on the main menu. If tapped on it 22 times, well, I will unlock the gold turtle and reach gold automatically to make it easier for debugging purposes. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
If gold is unlocked, permanently unlock the golden turtle skin. Add the golden turtle and golden turtle jump assets as well. And if the golden turtle is jumping, well, use the golden turtle. ↪💡 Consider importing and using the following plugins: @upit/storage.v1
User prompt
three new sounds trophy bronze trophy silver and trophy gold and well make them play whenever you reach that new high score 10 20 and 30 also after 40
User prompt
score be saved and after 10 make the color of the text for the score turn bronze after 20 silver and after 30 well gold and 40 ↪💡 Consider importing and using the following plugins: @upit/storage.v1, @upit/tween.v1
User prompt
Make every obstacle the same size and make the graphics actually show up on the obstacles and also be the same size as the obstacle collision.
User prompt
Would you be so kind and make the lava geyser much bigger, as well as, well, its texture, making it loop if it needs to, but just so that they are visible.
User prompt
So, the Lava Geyser is the obstacle for the volcano map, and I even have graphics placed for it already, but for some reason they don't show up, even though I told you countless times to fix the problem.
User prompt
some unknown reason it still does not work could you help me please i don't get it anymore
User prompt
So make sure that the graphics for the Lava Geyser objects are now correctly displaying since they currently, for some reason, do not work.
User prompt
make the obstacles as big as the hitboxes, I mean the graphics for the obstacles, so that they are actually visible now
User prompt
fix an issue where the graphics for the obstacles does not appear.
User prompt
the obstacles way way bigger, I mean the graphics for them, also well make the graphics for them exactly the same size as the hitboxes and make the hitboxes exactly fit the graphics.
User prompt
the beach map again use the palm tree acid and use the palm tree sound delete the original hit sound since it not since it's not needed anymore also ought to be so kind to well at the ground
User prompt
Move the Ambience button. Also, make it so that the selected maps cannot be changed or even show up in the settings, and make the maps show up next to it.
User prompt
Create a new obstacle called Boulder for the beach map. Use the sound Hit for colliding with it.
User prompt
create three music tracks for the respective maps also rename the music button to ambience or hintergrundgeräusche
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var LanguageButton = Container.expand(function (language, callback) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5
});
self.graphics = buttonGraphics;
var buttonText = new Text2(language, {
size: 120,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.down = function () {
LK.getSound('Gear').play();
if (callback) callback();
};
return self;
});
var LavaGeyser = Container.expand(function () {
var self = Container.call(this);
self.speed = -24;
self.passed = false;
self.isErupting = false;
self.eruptionTimer = 0;
self.eruptionInterval = 120; // Erupts every 2 seconds at 60fps
self.eruptionDuration = 30; // Erupts for 0.5 seconds
// Create and attach the lava geyser graphics with standardized scaling
var geyserGraphics = self.attachAsset('lavaGeyser', {
anchorX: 0.5,
anchorY: 1.0,
scaleX: 3.0,
scaleY: 4.0
});
// Store graphics reference for later manipulation
self.geyserGraphics = geyserGraphics;
// Set standardized obstacle dimensions - 300x400 pixels
self.width = 300;
self.height = 400;
self.update = function () {
self.x += self.speed;
// Handle eruption timing
self.eruptionTimer++;
if (!self.isErupting && self.eruptionTimer >= self.eruptionInterval) {
self.isErupting = true;
self.eruptionTimer = 0;
// Make geyser glow bright red when erupting with pulsing effect
self.geyserGraphics.tint = 0xff2222;
self.geyserGraphics.alpha = 0.9 + Math.sin(LK.ticks * 0.5) * 0.1;
} else if (self.isErupting && self.eruptionTimer >= self.eruptionDuration) {
self.isErupting = false;
self.eruptionTimer = 0;
// Return to enhanced normal color for better visibility
self.geyserGraphics.tint = 0xffffff;
self.geyserGraphics.alpha = 1.0;
}
// Add slight vertical movement when erupting
if (self.isErupting) {
self.y += Math.sin(LK.ticks * 0.3) * 3;
}
};
return self;
});
var MenuButton = Container.expand(function (text, callback) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5
});
var buttonText = new Text2(text, {
size: 120,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.down = function () {
LK.getSound('Lever').play();
if (callback) callback();
};
return self;
});
var MusicToggleButton = Container.expand(function (isEnabled, callback) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('menuButton', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.8,
scaleY: 0.6
});
self.graphics = buttonGraphics;
self.enabled = isEnabled;
self.callback = callback;
var buttonText = new Text2('HINTERGRUNDGERÄUSCHE: ' + (isEnabled ? 'AN' : 'AUS'), {
size: 80,
fill: 0xFFFFFF
});
buttonText.anchor.set(0.5, 0.5);
self.addChild(buttonText);
self.text = buttonText;
// Update button appearance
self.updateAppearance = function () {
self.text.setText('HINTERGRUNDGERÄUSCHE: ' + (self.enabled ? 'AN' : 'AUS'));
self.graphics.tint = self.enabled ? 0x90ee90 : 0x666666;
};
self.updateAppearance();
self.down = function () {
LK.getSound('Lever').play();
self.enabled = !self.enabled;
self.updateAppearance();
if (self.callback) self.callback(self.enabled);
// Play Started sound when music is enabled
if (self.enabled) {
LK.getSound('Started').play();
}
};
return self;
});
var PalmTree = Container.expand(function () {
var self = Container.call(this);
self.speed = -24;
self.passed = false;
// Create palm tree graphics with standardized size
var palmTreeGraphics = self.attachAsset('palmTree', {
anchorX: 0.5,
anchorY: 1.0,
scaleX: 3.0,
scaleY: 3.0
});
// Store graphics reference
self.palmTreeGraphics = palmTreeGraphics;
// Set standardized obstacle dimensions - 300x400 pixels
self.width = 300;
self.height = 400;
self.update = function () {
self.x += self.speed;
// Add subtle swaying animation
palmTreeGraphics.rotation = Math.sin(LK.ticks * 0.02) * 0.05;
};
return self;
});
var SkinButton = Container.expand(function (skinType, callback) {
var self = Container.call(this);
var buttonGraphics = self.attachAsset('skinButton', {
anchorX: 0.5,
anchorY: 0.5
});
self.graphics = buttonGraphics;
var skinPreview = self.attachAsset(skinType, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.6,
scaleY: 0.6
});
self.down = function () {
LK.getSound('Lever').play();
if (callback) callback();
};
return self;
});
var Turtle = Container.expand(function () {
var self = Container.call(this);
self.skinType = 'turtle_default';
self.originalSkin = 'turtle_default';
self.isJumping = false;
self.jumpSpeed = 0;
self.groundY = 0;
self.gravity = 2.4;
self.jumpPower = -90;
self.graphics = null;
self.setSkin = function (skinType) {
if (self.graphics) {
self.removeChild(self.graphics);
}
self.skinType = skinType;
self.originalSkin = skinType;
self.graphics = self.attachAsset(skinType, {
anchorX: 0.5,
anchorY: 1.0
});
// Set the container's dimensions to match the graphics
self.width = self.graphics.width;
self.height = self.graphics.height;
};
self.jump = function () {
if (!self.isJumping) {
self.isJumping = true;
self.jumpSpeed = self.jumpPower;
LK.getSound('jump').play();
// Change skin when jumping
var jumpSkin = self.originalSkin;
if (self.originalSkin === 'turtle_default') {
jumpSkin = 'turtle_jump';
} else if (self.originalSkin === 'turtle_suit') {
jumpSkin = 'turtle_suit_jump';
} else if (self.originalSkin === 'turtle_red') {
jumpSkin = 'turtle_suit_jump';
}
if (jumpSkin !== self.skinType) {
if (self.graphics) {
self.removeChild(self.graphics);
}
self.skinType = jumpSkin;
self.graphics = self.attachAsset(jumpSkin, {
anchorX: 0.5,
anchorY: 1.0
});
// Set the container's dimensions to match the graphics
self.width = self.graphics.width;
self.height = self.graphics.height;
}
}
};
self.update = function () {
if (self.isJumping) {
self.jumpSpeed += self.gravity;
self.y += self.jumpSpeed;
if (self.y >= self.groundY) {
self.y = self.groundY;
self.isJumping = false;
self.jumpSpeed = 0;
// Play landing sound based on current map
var landingSound = 'Land';
if (currentBackground === 'background_jungle') {
landingSound = 'landing_jungle';
} else if (currentBackground === 'background_volcano') {
landingSound = 'landing_volcano';
}
LK.getSound(landingSound).play();
// Create dust particles
createDustParticles(self.x, self.y);
// Restore original skin when landing
if (self.skinType !== self.originalSkin) {
if (self.graphics) {
self.removeChild(self.graphics);
}
self.skinType = self.originalSkin;
self.graphics = self.attachAsset(self.originalSkin, {
anchorX: 0.5,
anchorY: 1.0
});
// Set the container's dimensions to match the graphics
self.width = self.graphics.width;
self.height = self.graphics.height;
}
}
}
};
return self;
});
var TurtleBack = Container.expand(function () {
var self = Container.call(this);
self.speed = -24;
self.collected = false;
var backGraphics = self.attachAsset('turtle_back', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 2.5,
scaleY: 2.5
});
// Store graphics reference
self.backGraphics = backGraphics;
// Set standardized obstacle dimensions - 300x400 pixels
self.width = 300;
self.height = 400;
self.update = function () {
self.x += self.speed;
// Add floating animation
self.y += Math.sin(LK.ticks * 0.1) * 0.5;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Game states
var gameState = 'menu'; // 'menu', 'playing', 'gameOver'
var currentSkin = storage.selectedSkin || 'turtle_default';
var currentLanguage = storage.selectedLanguage || 'English';
var languageMenuContainer = null;
var settingsMenuContainer = null;
var mapMenuContainer = null;
var currentBackground = storage.selectedBackground || 'background_beach';
var backgroundElement = null;
var menuOverlay = null;
// Music settings
var musicEnabled = storage.musicEnabled !== undefined ? storage.musicEnabled : false;
var musicVolume = storage.musicVolume || 0.5;
var currentMusicTrack = null;
// Language translations
var translations = {
English: {
title: 'Turtle Run',
play: 'PLAY',
skins: 'SKINS',
back: 'BACK',
chooseSkin: 'Choose Skin',
selectLanguage: 'Select Language',
highScore: 'High Score: '
},
Deutsch: {
title: 'Turtlerun',
play: 'SPIELEN',
skins: 'SKINS',
back: 'ZURÜCK',
chooseSkin: 'Skin auswählen',
selectLanguage: 'Sprache auswählen',
highScore: 'Highscore: '
}
};
// Function to get translated text
function getText(key) {
return translations[currentLanguage][key] || translations['English'][key];
}
// Game elements
var turtle = null;
var palmTrees = [];
var obstacles = [];
var turtleBacks = [];
var ground = null;
var scoreText = null;
var gameScore = 0;
var lastBoulderTime = 0;
var boulderInterval = 200; // milliseconds - much more frequent spawning
var minBoulderInterval = 40; // extremely aggressive minimum interval
var difficultyLevel = 1;
var speedMultiplier = 1.0;
// Menu elements
var menuContainer = null;
var skinMenuContainer = null;
// Use stored background preference
currentBackground = storage.selectedBackground || 'background_beach';
var backgroundScrollSpeed = -12;
var backgroundElements = [];
// Create scrolling background system
function createScrollingBackground() {
// Create two background elements for seamless scrolling
for (var i = 0; i < 2; i++) {
var bg = game.addChild(LK.getAsset('background_beach', {
anchorX: 0,
anchorY: 0,
x: i * 2048,
y: 0
}));
backgroundElements.push(bg);
}
}
// Initialize scrolling background
createScrollingBackground();
// Create menu overlay for better contrast
function createMenuOverlay() {
if (!menuOverlay) {
menuOverlay = game.addChild(LK.getAsset('background_sky', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
scaleX: 20.48,
scaleY: 27.32,
alpha: 0.7
}));
}
}
function showMenuOverlay() {
if (menuOverlay) {
menuOverlay.visible = true;
// Ensure overlay is above background but below menu elements
game.setChildIndex(menuOverlay, 2);
}
}
function hideMenuOverlay() {
if (menuOverlay) {
menuOverlay.visible = false;
}
}
// Initialize ground
function createGround() {
var groundAsset = 'ground';
if (currentBackground === 'background_jungle') {
groundAsset = 'ground_jungle';
} else if (currentBackground === 'background_volcano') {
groundAsset = 'ground_volcano';
}
return LK.getAsset(groundAsset, {
anchorX: 0,
anchorY: 0,
x: 0,
y: 2732 - 270
});
}
ground = game.addChild(createGround());
// Initialize score display
var initialScore = storage.currentScore || 0;
scoreText = new Text2(initialScore.toString(), {
size: 300,
fill: 0xFFFFFF
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
scoreText.y = 50;
// Set initial color based on saved score
if (initialScore >= 40) {
scoreText.fill = 0xff00ff; // Magenta for 40+
scoreText.tint = 0xff00ff;
} else if (initialScore >= 30) {
scoreText.fill = 0xffd700; // Gold
scoreText.tint = 0xffd700;
} else if (initialScore >= 20) {
scoreText.fill = 0xc0c0c0; // Silver
scoreText.tint = 0xc0c0c0;
} else if (initialScore >= 10) {
scoreText.fill = 0xcd7f32; // Bronze
scoreText.tint = 0xcd7f32;
} else {
scoreText.fill = 0xffffff; // Default white
scoreText.tint = 0xffffff;
}
function createMainMenu() {
createMenuOverlay();
showMenuOverlay();
menuContainer = game.addChild(new Container());
// Title
var titleText = new Text2(getText('title'), {
size: 360,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 800;
// Add black outline effect by creating shadow text
var titleShadow = new Text2(getText('title'), {
size: 360,
fill: 0x000000
});
titleShadow.anchor.set(0.5, 0.5);
titleShadow.x = 2048 / 2 + 4;
titleShadow.y = 800 + 4;
menuContainer.addChild(titleShadow);
menuContainer.addChild(titleText);
// Play button
var playButton = menuContainer.addChild(new MenuButton(getText('play'), function () {
startGame();
}));
playButton.x = 2048 / 2;
playButton.y = 1200;
// Skins button
var skinsButton = menuContainer.addChild(new MenuButton(getText('skins'), function () {
showSkinMenu();
}));
skinsButton.x = 2048 / 2;
skinsButton.y = 1500;
// Map button
var mapButton = menuContainer.addChild(LK.getAsset('mapButton', {
anchorX: 0.5,
anchorY: 0.5
}));
mapButton.x = 2048 / 2;
mapButton.y = 1800;
mapButton.down = function () {
LK.getSound('Map').play();
showMapMenu();
};
// Gear icon for language selection
var gearIcon = menuContainer.addChild(LK.getAsset('gearIcon', {
anchorX: 0.5,
anchorY: 0.5
}));
gearIcon.x = 2048 - 150;
gearIcon.y = 150;
gearIcon.down = function () {
LK.getSound('Gear').play();
showLanguageMenu();
};
// Music toggle button
var musicToggle = menuContainer.addChild(new MusicToggleButton(musicEnabled, function (enabled) {
musicEnabled = enabled;
storage.musicEnabled = enabled;
if (musicEnabled) {
playBackgroundMusic();
} else {
LK.stopMusic();
currentMusicTrack = null;
}
}));
musicToggle.x = 2048 / 2;
musicToggle.y = 2100;
// Map selection buttons next to music toggle
var mapTypes = [{
id: 'background_beach',
name: 'Strand'
}, {
id: 'background_jungle',
name: 'Dschungel'
}, {
id: 'background_volcano',
name: 'Vulkan'
}];
var mapStartX = 2048 / 2 - 450;
for (var i = 0; i < mapTypes.length; i++) {
var mapContainer = menuContainer.addChild(new Container());
mapContainer.x = mapStartX + i * 300;
mapContainer.y = 2300;
// Background preview
var bgPreview = mapContainer.addChild(LK.getAsset(mapTypes[i].id, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.15,
scaleY: 0.12
}));
// Map name
var mapNameText = new Text2(mapTypes[i].name, {
size: 60,
fill: 0xFFFFFF
});
mapNameText.anchor.set(0.5, 0.5);
mapNameText.x = 0;
mapNameText.y = 120;
mapContainer.addChild(mapNameText);
// Highlight selected map
if (mapTypes[i].id === currentBackground) {
bgPreview.tint = 0x90ee90;
}
// Make clickable
mapContainer.down = function (mapType) {
return function () {
LK.getSound('Lever').play();
changeBackground(mapType.id);
// Refresh main menu to update highlighting
if (menuContainer) {
menuContainer.destroy();
menuContainer = null;
}
createMainMenu();
};
}(mapTypes[i]);
}
// High score display
var highScore = storage.highScore || 0;
var highScoreText = new Text2(getText('highScore') + highScore, {
size: 180,
fill: 0xFFFFFF
});
highScoreText.anchor.set(0.5, 0.5);
highScoreText.x = 2048 / 2;
highScoreText.y = 2500;
menuContainer.addChild(highScoreText);
}
function showSkinMenu() {
if (menuContainer) {
menuContainer.visible = false;
}
skinMenuContainer = game.addChild(new Container());
// Title
var titleText = new Text2(getText('chooseSkin'), {
size: 240,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 600;
// Add title shadow for better contrast
var titleShadow = new Text2(getText('chooseSkin'), {
size: 240,
fill: 0x000000
});
titleShadow.anchor.set(0.5, 0.5);
titleShadow.x = 2048 / 2 + 3;
titleShadow.y = 600 + 3;
skinMenuContainer.addChild(titleShadow);
skinMenuContainer.addChild(titleText);
// Skin options
var skins = ['turtle_default', 'turtle_red'];
var startX = 2048 / 2 - 600;
var startY = 900;
for (var i = 0; i < skins.length; i++) {
var skinButton = skinMenuContainer.addChild(new SkinButton(skins[i], function (skin) {
return function () {
currentSkin = skin;
storage.selectedSkin = skin;
hideSkinMenu();
};
}(skins[i])));
skinButton.x = startX + i * 600;
skinButton.y = startY;
// Highlight selected skin
if (skins[i] === currentSkin) {
skinButton.graphics.tint = 0x90ee90;
}
}
// Back button
var backButton = skinMenuContainer.addChild(new MenuButton(getText('back'), function () {
hideSkinMenu();
}));
backButton.x = 2048 / 2;
backButton.y = 1400;
}
function hideSkinMenu() {
if (skinMenuContainer) {
skinMenuContainer.destroy();
skinMenuContainer = null;
}
if (menuContainer) {
menuContainer.visible = true;
}
showMenuOverlay();
}
function showLanguageMenu() {
if (menuContainer) {
menuContainer.visible = false;
}
languageMenuContainer = game.addChild(new Container());
// Title
var titleText = new Text2(getText('selectLanguage'), {
size: 240,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 800;
// Add title shadow for better contrast
var titleShadow = new Text2(getText('selectLanguage'), {
size: 240,
fill: 0x000000
});
titleShadow.anchor.set(0.5, 0.5);
titleShadow.x = 2048 / 2 + 3;
titleShadow.y = 800 + 3;
languageMenuContainer.addChild(titleShadow);
languageMenuContainer.addChild(titleText);
// Language options
var languages = ['English', 'Deutsch'];
var startY = 1200;
for (var i = 0; i < languages.length; i++) {
var langButton = languageMenuContainer.addChild(new LanguageButton(languages[i], function (lang) {
return function () {
currentLanguage = lang;
storage.selectedLanguage = lang;
hideLanguageMenu();
// Refresh main menu with new language
if (menuContainer) {
menuContainer.destroy();
menuContainer = null;
}
createMainMenu();
};
}(languages[i])));
langButton.x = 2048 / 2;
langButton.y = startY + i * 300;
// Highlight selected language
if (languages[i] === currentLanguage) {
langButton.graphics.tint = 0x90ee90;
}
}
// Back button
var backButton = languageMenuContainer.addChild(new MenuButton(getText('back'), function () {
hideLanguageMenu();
}));
backButton.x = 2048 / 2;
backButton.y = 2500;
}
function hideLanguageMenu() {
if (languageMenuContainer) {
languageMenuContainer.destroy();
languageMenuContainer = null;
}
if (menuContainer) {
menuContainer.visible = true;
}
showMenuOverlay();
}
function showMapMenu() {
if (menuContainer) {
menuContainer.visible = false;
}
mapMenuContainer = game.addChild(new Container());
// Title
var titleText = new Text2('Select Map', {
size: 240,
fill: 0xFFFFFF
});
titleText.anchor.set(0.5, 0.5);
titleText.x = 2048 / 2;
titleText.y = 400;
// Add title shadow for better contrast
var titleShadow = new Text2('Select Map', {
size: 240,
fill: 0x000000
});
titleShadow.anchor.set(0.5, 0.5);
titleShadow.x = 2048 / 2 + 3;
titleShadow.y = 400 + 3;
mapMenuContainer.addChild(titleShadow);
mapMenuContainer.addChild(titleText);
// Map options with background previews
var mapTypes = [{
id: 'background_beach',
name: 'Strand'
}, {
id: 'background_jungle',
name: 'Dschungel'
}, {
id: 'background_volcano',
name: 'Vulkan'
}];
var startY = 800;
var spacing = 500;
for (var i = 0; i < mapTypes.length; i++) {
var mapContainer = mapMenuContainer.addChild(new Container());
mapContainer.x = 2048 / 2;
mapContainer.y = startY + i * spacing;
// Background preview
var bgPreview = mapContainer.addChild(LK.getAsset(mapTypes[i].id, {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.3,
scaleY: 0.2
}));
// Map name
var mapNameText = new Text2(mapTypes[i].name, {
size: 120,
fill: 0xFFFFFF
});
mapNameText.anchor.set(0.5, 0.5);
mapNameText.x = 0;
mapNameText.y = 200;
// Add text shadow for better contrast
var mapNameShadow = new Text2(mapTypes[i].name, {
size: 120,
fill: 0x000000
});
mapNameShadow.anchor.set(0.5, 0.5);
mapNameShadow.x = 2;
mapNameShadow.y = 202;
mapContainer.addChild(mapNameShadow);
mapContainer.addChild(mapNameText);
// Highlight selected map
if (mapTypes[i].id === currentBackground) {
bgPreview.tint = 0x90ee90;
}
// Make clickable
mapContainer.down = function (mapType) {
return function () {
LK.getSound('Lever').play();
changeBackground(mapType.id);
hideMapMenu();
};
}(mapTypes[i]);
}
// Back button
var backButton = mapMenuContainer.addChild(new MenuButton(getText('back'), function () {
hideMapMenu();
}));
backButton.x = 2048 / 2;
backButton.y = 2400;
}
function hideMapMenu() {
if (mapMenuContainer) {
mapMenuContainer.destroy();
mapMenuContainer = null;
}
if (menuContainer) {
menuContainer.visible = true;
}
showMenuOverlay();
}
function playBackgroundMusic() {
if (!musicEnabled) return;
var musicTrack = null;
if (currentBackground === 'background_beach') {
musicTrack = 'beachAmbience';
} else if (currentBackground === 'background_jungle') {
musicTrack = 'jungleAmbience';
} else if (currentBackground === 'background_volcano') {
musicTrack = 'volcanoAmbience';
}
if (musicTrack && musicTrack !== currentMusicTrack) {
LK.playMusic(musicTrack);
currentMusicTrack = musicTrack;
}
}
function changeBackground(newBackground) {
// Clean up existing background elements
for (var i = 0; i < backgroundElements.length; i++) {
backgroundElements[i].destroy();
}
backgroundElements = [];
currentBackground = newBackground;
storage.selectedBackground = newBackground;
// Recreate scrolling background with new background
for (var i = 0; i < 2; i++) {
var bg = game.addChild(LK.getAsset(currentBackground, {
anchorX: 0,
anchorY: 0,
x: i * 2048,
y: 0
}));
backgroundElements.push(bg);
// Move background to back
game.setChildIndex(bg, 0);
}
// Update ground asset
if (ground) {
ground.destroy();
ground = game.addChild(createGround());
}
// Play appropriate background music
playBackgroundMusic();
}
function startGame() {
gameState = 'playing';
gameScore = 0;
lastBoulderTime = 0;
boulderInterval = 200; // much more frequent spawning
// Use selected background for gameplay
changeBackground(currentBackground);
// Recreate ground with correct asset
if (ground) {
ground.destroy();
ground = game.addChild(createGround());
}
// Hide menu and overlay
if (menuContainer) {
menuContainer.visible = false;
}
hideMenuOverlay();
// Create turtle
turtle = game.addChild(new Turtle());
turtle.setSkin(currentSkin);
turtle.x = 300;
turtle.y = ground.y;
turtle.groundY = ground.y;
// Clean up obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].destroy();
}
obstacles = [];
// Clean up palm trees array for backwards compatibility
for (var i = palmTrees.length - 1; i >= 0; i--) {
palmTrees[i].destroy();
}
palmTrees = [];
// Clean up turtle backs
for (var i = turtleBacks.length - 1; i >= 0; i--) {
turtleBacks[i].destroy();
}
turtleBacks = [];
// Clear existing turtle backs
for (var i = turtleBacks.length - 1; i >= 0; i--) {
turtleBacks[i].destroy();
}
turtleBacks = [];
// Save current score and update display with color changes
storage.currentScore = gameScore;
scoreText.setText(gameScore);
// Change score text color based on thresholds
if (gameScore >= 40) {
// Special color for 40+ (rainbow effect using tween)
scoreText.fill = 0xff00ff; // Magenta
tween(scoreText, {
tint: 0x00ffff
}, {
duration: 500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(scoreText, {
tint: 0xffff00
}, {
duration: 500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(scoreText, {
tint: 0xff00ff
}, {
duration: 500,
easing: tween.easeInOut
});
}
});
}
});
} else if (gameScore >= 30) {
// Gold
scoreText.fill = 0xffd700;
scoreText.tint = 0xffd700;
} else if (gameScore >= 20) {
// Silver
scoreText.fill = 0xc0c0c0;
scoreText.tint = 0xc0c0c0;
} else if (gameScore >= 10) {
// Bronze
scoreText.fill = 0xcd7f32;
scoreText.tint = 0xcd7f32;
} else {
// Default white
scoreText.fill = 0xffffff;
scoreText.tint = 0xffffff;
}
// Start background music
playBackgroundMusic();
}
function gameOver() {
actualGameOver();
}
function actualGameOver() {
gameState = 'gameOver';
// Update high score
if (gameScore > (storage.highScore || 0)) {
storage.highScore = gameScore;
}
// Note: Specific hit sounds are now played on collision detection
// Flash screen red
LK.effects.flashScreen(0xff0000, 500);
// Show game over after delay
LK.setTimeout(function () {
LK.showGameOver();
// Reset everything after game over is shown
resetGame();
}, 500);
}
function resetGame() {
gameState = 'menu';
// Reset game variables
gameScore = 0;
lastBoulderTime = 0;
boulderInterval = 200;
difficultyLevel = 1;
speedMultiplier = 1.0;
// Clean up turtle
if (turtle) {
turtle.destroy();
turtle = null;
}
// Clean up obstacles
for (var i = obstacles.length - 1; i >= 0; i--) {
obstacles[i].destroy();
}
obstacles = [];
// Clean up palm trees array for backwards compatibility
for (var i = palmTrees.length - 1; i >= 0; i--) {
palmTrees[i].destroy();
}
palmTrees = [];
// Reset score display and color
scoreText.setText('0');
scoreText.fill = 0xffffff; // Reset to white
scoreText.tint = 0xffffff;
// Stop any ongoing color tweens
tween.stop(scoreText, {
tint: true
});
// Show menu
if (menuContainer) {
menuContainer.visible = true;
showMenuOverlay();
} else {
createMainMenu();
}
}
function createDustParticles(x, y) {
for (var i = 0; i < 8; i++) {
var particle = game.addChild(LK.getAsset('sandParticle', {
anchorX: 0.5,
anchorY: 0.5,
scaleX: 0.5 + Math.random() * 0.8,
scaleY: 0.5 + Math.random() * 0.8,
x: x + (Math.random() - 0.5) * 120,
y: y - 10,
alpha: 0.8
}));
// Create flying sand effect with arc trajectory
var targetY = y - Math.random() * 150 - 80;
var targetX = particle.x + (Math.random() - 0.5) * 200;
var midY = y - Math.random() * 80 - 40;
// First phase: launch upward with arc
tween(particle, {
y: midY,
x: targetX * 0.6,
alpha: 0.9
}, {
duration: 200,
easing: tween.easeOut,
onFinish: function onFinish() {
// Second phase: fall down with gravity
tween(particle, {
y: targetY,
x: targetX,
alpha: 0
}, {
duration: 600,
easing: tween.easeIn,
onFinish: function onFinish() {
particle.destroy();
}
});
}
});
}
}
// Touch input for jumping
game.down = function (x, y, obj) {
if (gameState === 'playing' && turtle) {
turtle.jump();
}
};
// Main game loop
game.update = function () {
// Update scrolling background only when playing
if (gameState === 'playing') {
for (var i = 0; i < backgroundElements.length; i++) {
var bg = backgroundElements[i];
bg.x += backgroundScrollSpeed;
// Reset position when background moves off screen
if (bg.x <= -2048) {
// Find the other background element and position relative to it
var otherBg = backgroundElements[1 - i];
bg.x = otherBg.x + 2048;
}
}
}
if (gameState === 'playing') {
// Spawn obstacles based on current map
if (LK.ticks - lastBoulderTime > boulderInterval) {
var obstacle = null;
if (currentBackground === 'background_beach') {
obstacle = game.addChild(new PalmTree());
} else if (currentBackground === 'background_jungle') {
obstacle = game.addChild(new PalmTree());
} else if (currentBackground === 'background_volcano') {
obstacle = game.addChild(new LavaGeyser());
}
if (obstacle) {
obstacle.x = 2048 + 300; // Spawn further off-screen to hide spawning
obstacle.y = ground.y;
obstacle.speed = obstacle.speed * speedMultiplier; // Apply speed multiplier
obstacles.push(obstacle);
}
lastBoulderTime = LK.ticks;
// Progressive difficulty system
var newDifficultyLevel = Math.floor(gameScore / 5) + 1;
if (newDifficultyLevel > difficultyLevel) {
difficultyLevel = newDifficultyLevel;
speedMultiplier = 1.0 + (difficultyLevel - 1) * 0.3; // 30% speed increase per level
// Play celebrate sound when speed increases
LK.getSound('celebrate').play();
}
// Increase spawn rate more aggressively
if (boulderInterval > minBoulderInterval) {
var reduction = Math.max(8, Math.floor(difficultyLevel * 3)); // More aggressive reduction
boulderInterval -= reduction;
}
}
// Update obstacles and check collisions
for (var i = obstacles.length - 1; i >= 0; i--) {
var obstacle = obstacles[i];
// Remove off-screen obstacles (hide despawning)
if (obstacle.x < -300) {
obstacle.destroy();
obstacles.splice(i, 1);
continue;
}
// Check if obstacle was passed for scoring
if (!obstacle.passed && obstacle.x < turtle.x) {
obstacle.passed = true;
gameScore++;
// Save current score and update display with color changes
storage.currentScore = gameScore;
scoreText.setText(gameScore);
// Change score text color based on thresholds
if (gameScore >= 40) {
// Special color for 40+ (rainbow effect using tween)
scoreText.fill = 0xff00ff; // Magenta
tween(scoreText, {
tint: 0x00ffff
}, {
duration: 500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(scoreText, {
tint: 0xffff00
}, {
duration: 500,
easing: tween.easeInOut,
onFinish: function onFinish() {
tween(scoreText, {
tint: 0xff00ff
}, {
duration: 500,
easing: tween.easeInOut
});
}
});
}
});
// Play special trophy sound for reaching 40 if this is the first time
if (gameScore == 40 && (storage.highScore || 0) < 40) {
LK.getSound('trophy_gold').play();
}
} else if (gameScore >= 30) {
// Gold
scoreText.fill = 0xffd700;
scoreText.tint = 0xffd700;
// Play gold trophy sound for reaching 30 if this is the first time
if (gameScore == 30 && (storage.highScore || 0) < 30) {
LK.getSound('trophy_gold').play();
}
} else if (gameScore >= 20) {
// Silver
scoreText.fill = 0xc0c0c0;
scoreText.tint = 0xc0c0c0;
// Play silver trophy sound for reaching 20 if this is the first time
if (gameScore == 20 && (storage.highScore || 0) < 20) {
LK.getSound('trophy_silver').play();
}
} else if (gameScore >= 10) {
// Bronze
scoreText.fill = 0xcd7f32;
scoreText.tint = 0xcd7f32;
// Play bronze trophy sound for reaching 10 if this is the first time
if (gameScore == 10 && (storage.highScore || 0) < 10) {
LK.getSound('trophy_bronze').play();
}
} else {
// Default white
scoreText.fill = 0xffffff;
scoreText.tint = 0xffffff;
}
// Play celebration sound for scoring
LK.getSound('Secret').play();
}
// Check collision with turtle
if (turtle && turtle.intersects(obstacle)) {
// Play specific hit sound based on obstacle type
if (obstacle instanceof PalmTree) {
LK.getSound('hit_palm_tree').play();
} else if (obstacle instanceof LavaGeyser) {
LK.getSound('hit_lava_geyser').play();
}
gameOver();
return;
}
}
}
};
// Initialize main menu
createMainMenu();
// Initialize background music
playBackgroundMusic(); ===================================================================
--- original.js
+++ change.js
@@ -1106,20 +1106,36 @@
}
});
}
});
+ // Play special trophy sound for reaching 40 if this is the first time
+ if (gameScore == 40 && (storage.highScore || 0) < 40) {
+ LK.getSound('trophy_gold').play();
+ }
} else if (gameScore >= 30) {
// Gold
scoreText.fill = 0xffd700;
scoreText.tint = 0xffd700;
+ // Play gold trophy sound for reaching 30 if this is the first time
+ if (gameScore == 30 && (storage.highScore || 0) < 30) {
+ LK.getSound('trophy_gold').play();
+ }
} else if (gameScore >= 20) {
// Silver
scoreText.fill = 0xc0c0c0;
scoreText.tint = 0xc0c0c0;
+ // Play silver trophy sound for reaching 20 if this is the first time
+ if (gameScore == 20 && (storage.highScore || 0) < 20) {
+ LK.getSound('trophy_silver').play();
+ }
} else if (gameScore >= 10) {
// Bronze
scoreText.fill = 0xcd7f32;
scoreText.tint = 0xcd7f32;
+ // Play bronze trophy sound for reaching 10 if this is the first time
+ if (gameScore == 10 && (storage.highScore || 0) < 10) {
+ LK.getSound('trophy_bronze').play();
+ }
} else {
// Default white
scoreText.fill = 0xffffff;
scoreText.tint = 0xffffff;
The sand ground of some sort of beach. In-Game asset. 2d. High contrast. No shadows
A small world map. In-Game asset. 2d. High contrast. No shadows
I land turtle with googly eyes wearing a suit and looking to the right. In-Game asset. 2d. High contrast. No shadows
Irregular old land turtle wearing a suit with a red tie in a jumping position. In-Game asset. 2d. High contrast. No shadows
A settings button I can without any background it’s a gear. In-Game asset. 2d. High contrast. No shadows
The beach of a tropical island, though the ocean is not to be seen in the background there is just a vibrant jungle. In-Game asset. 2d. High contrast. No shadows
A lush and vibrant jungle. In-Game asset. 2d. High contrast. No shadows
A area filled with lava and a sky two it’s still pretty vibrant but make sure it can loop without looking bad. In-Game asset. 2d. High contrast. No shadows
Junglee grass ground which is a bit overgrown. In-Game asset. 2d. High contrast. No shadows
Volcanic rocks for a ground. In-Game asset. 2d. High contrast. No shadows
I completely dark red square with some orange parts more in the middle representing a lava block. In-Game asset. 2d. High contrast. No shadows
A crazy almost neon green plant that can grow both on in the jungles and on beaches. In-Game asset. 2d. High contrast. No shadows
A golden land turtle with googly eyes looking to the right. In-Game asset. 2d. High contrast. No shadows
A golden turtle with googly eyes in the jumping position. In-Game asset. 2d. High contrast. No shadows
A pile of burn ash. In-Game asset. 2d. High contrast. No shadows
A trophy without any background. In-Game asset. 2d. High contrast. No shadows
A sterile space station background But it’s still futuristic and definitely seems like it’s made out of metal. In-Game asset. 2d. High contrast. No shadows
A metal plate working as the ground for a space station. In-Game asset. 2d. High contrast. No shadows
A swampy background with mangrove trees and overall overgrown but lush aesthetics. In-Game asset. 2d. High contrast. No shadows
A muddy swamp ground. In-Game asset. 2d. High contrast. No shadows
A background, this picture of a flash eating plant Not eating flesh at least not yet. In-Game asset. 2d. High contrast. No shadows
The street ground of a city. In-Game asset. 2d. High contrast. No shadows
A white car. In-Game asset. 2d. High contrast. No shadows
The skyline of a modern city. In-Game asset. 2d. High contrast. No shadows
Evening image of a mountain range easily looping. In-Game asset. 2d. High contrast. No shadows
The tropical ocean with the shore of an island in the far background easily looping itself. In-Game asset. 2d. High contrast. No shadows
A pirate. In-Game asset. 2d. High contrast. No shadows
The wooden floor of a pirate ship. In-Game asset. 2d. High contrast. No shadows
The pillar of an ancient jungle temple. In-Game asset. 2d. High contrast. No shadows
Ancient trap able to dispense arrows to PS it’s target. In-Game asset. 2d. High contrast. No shadows
The ground for an ancient jungle temple. In-Game asset. 2d. High contrast. No shadows
The background for the inside of an ancient jungle temple. In-Game asset. 2d. High contrast. No shadows
Fully soaked and wet grass and the dirt for the ground element oven to the jump and run. In-Game asset. 2d. High contrast. No shadows
Just a tree. In-Game asset. 2d. High contrast. No shadows
An open space of grass with dark rainy clouds up above Easily looper. In-Game asset. 2d. High contrast. No shadows
hit
Sound effect
jump
Sound effect
Map
Sound effect
Lever
Sound effect
Gear
Sound effect
Land
Sound effect
Secret
Sound effect
celebrate
Sound effect
Started
Sound effect
landing_jungle
Sound effect
landing_volcano
Sound effect
hit_lava_geyser
Sound effect
hit_palm_tree
Sound effect
trophy_bronze
Sound effect
trophy_gold
Sound effect
trophy_silver
Sound effect
Beach
Music
Jungle
Music
Volcano
Music
Warning
Sound effect
Alarm
Sound effect
Memories
Sound effect
Trophy
Sound effect
hit_laser_wall
Sound effect
Space
Music
landing_space
Sound effect
landing_swamp
Sound effect
hit_carnivorous_plant
Sound effect
Swamp
Music
City
Music
hit_car
Sound effect
landing_city
Sound effect
landing_silhouette_mountain
Sound effect
hit_dripstone
Sound effect
hit_pirate
Sound effect
pirate_landing
Sound effect
hit_arrow_trap
Sound effect
landing_ancient_temple
Sound effect
landing_thunderplanes
Sound effect
hit_thundertree
Sound effect
Thunderplanes
Music
thunder
Sound effect