User prompt
The costumes should be on the character in the same way as they are on the selection screen, there should be no difference after the game starts
User prompt
The costumes should look like they are stuck to the character.
User prompt
Remove the selected costumes from the middle of the screen after the game starts so that they are only on the character you are playing.
User prompt
When the game starts, the selected costumes should be on the characters. Forget the previously prepared costumes. We will use these new costumes.
User prompt
costumes always move in integration with the characters (including the selection screen)
User prompt
Show the costumes we wear on the character selection screen
User prompt
Let's add it to the costume assets as in the example you said.
User prompt
a little further down
User prompt
just a little bit down
User prompt
Kostümler daha düzenli görünmeli ki hepsini ekranda görebilelim.
User prompt
Think like a jumping human head instead of a jumping bird and design your costumes accordingly.
User prompt
"Touch the screen to jump" text should not be on the selection screen, it should be there softly when the game starts after selecting the character
User prompt
have a crown instead of a hat and all costumes make the same movements as the character (including bending)
User prompt
Add a costume section so that when we click on it, we can dress the character in costumes
User prompt
Put the speed option in a small way on the top right of the screen and adjust the speed from there
User prompt
Put the speed option in a small way on the top right of the screen and adjust the speed from there, it will disappear when the game starts
User prompt
Put the speed adjustment in a small way on the top right of the screen
User prompt
The game should speed up over time and this should be a feature that can be adjusted on the selection screen.
User prompt
Make the text "Zıplamak için Ekrana Dokunn" a little smaller
User prompt
change tap to flap hold to float text to"Zıplamak için Ekrana Dokunn"
User prompt
Make that sound immediately after selecting the character
User prompt
Play sound after selecting characters on selection screen
User prompt
When you tap on the characters on the selection screen, they will grow a little bigger. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
The characters on the selection screen should move a little up and a little down slowly. ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
add "starsound" sound to selection screen
/****
* Plugins
****/
var storage = LK.import("@upit/storage.v1");
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Bird = Container.expand(function (birdType, costumeId) {
var self = Container.call(this);
// Default to 'bird' if not specified
var assetId = birdType === 'bird2' ? 'bird2' : 'bird';
var birdGraphics = self.attachAsset(assetId, {
anchorX: 0.5,
anchorY: 0.5
});
// Costume overlay logic
if (typeof costumeId !== "number") costumeId = 0;
self.costumeSprites = [];
// Use new costume images for overlays
if (costumeId === 1) {
// Crown
var crown = LK.getAsset('costume_crown', {
anchorX: 0.5,
anchorY: 1
});
crown.x = 0;
crown.y = -birdGraphics.height * 0.55;
self.addChild(crown);
self.costumeSprites.push(crown);
}
if (costumeId === 2) {
// Glasses
var glasses = LK.getAsset('costume_glasses', {
anchorX: 0.5,
anchorY: 0.5
});
glasses.x = 0;
glasses.y = -birdGraphics.height * 0.05;
self.addChild(glasses);
self.costumeSprites.push(glasses);
}
if (costumeId === 3) {
// Mustache
var mustache = LK.getAsset('costume_mustache', {
anchorX: 0.5,
anchorY: 0.5
});
mustache.x = 0;
mustache.y = birdGraphics.height * 0.29;
self.addChild(mustache);
self.costumeSprites.push(mustache);
}
if (costumeId === 4) {
// Beard
var beard = LK.getAsset('costume_beard', {
anchorX: 0.5,
anchorY: 0.5
});
beard.x = 0;
beard.y = birdGraphics.height * 0.49;
self.addChild(beard);
self.costumeSprites.push(beard);
}
self.xSpeed = 10.9375;
self.ySpeed = -20;
self.gravity = 1;
self.lift = -15;
self.flap = function () {
self.ySpeed = self.lift * 1.5;
LK.getSound('flap').play();
};
self._update_migrated = function () {
if (game.isMouseDown) {
self.ySpeed += self.gravity / 3;
} else {
self.ySpeed += self.gravity;
}
self.y += self.ySpeed;
self.x += self.xSpeed;
if (self.y <= 0 || self.y >= 2732) {
self.speed = -self.speed;
}
var targetRotation = Math.atan2(self.ySpeed, self.xSpeed * self.scale.x) / 2;
birdGraphics.rotation += (targetRotation - birdGraphics.rotation) / 10;
// Make all costume overlays follow the bird's position, scale, and rotation exactly
if (self.costumeSprites && self.costumeSprites.length) {
for (var i = 0; i < self.costumeSprites.length; i++) {
var sprite = self.costumeSprites[i];
// Match the exact transform logic as the selection screen overlays
sprite.scale.x = birdGraphics.scale.x;
sprite.scale.y = birdGraphics.scale.y;
sprite.rotation = birdGraphics.rotation;
// Position overlays with the same offsets as in the selection screen
if (costumeId === 1) {
// Crown
sprite.x = 0;
sprite.y = -birdGraphics.height * 0.55;
} else if (costumeId === 2) {
// Glasses
sprite.x = 0;
sprite.y = -birdGraphics.height * 0.05;
} else if (costumeId === 3) {
// Mustache
sprite.x = 0;
sprite.y = birdGraphics.height * 0.29;
} else if (costumeId === 4) {
// Beard
sprite.x = 0;
sprite.y = birdGraphics.height * 0.49;
}
}
}
};
self.flip = function () {
self.scale.x *= -1;
};
});
var Obstacle = Container.expand(function () {
var self = Container.call(this);
var obstacleShadow = self.attachAsset('obstacleShadow', {
anchorX: 0.5,
anchorY: 0.5
});
obstacleShadow.rotation = Math.PI / 4;
var obstacleShadow2 = self.attachAsset('obstacleShadow2', {
anchorX: 0.5,
anchorY: 0.5
});
obstacleShadow2.rotation = Math.PI / 4;
obstacleShadow2.y = -7;
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
obstacleGraphics.rotation = Math.PI / 4;
self.speed = 5;
self._move_migrated = function (speed) {
self.y += speed;
};
});
var Wall = Container.expand(function () {
var self = Container.call(this);
var wallGraphics = self.attachAsset('wall', {
anchorX: 0.5,
anchorY: 0.5
});
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Costume image assets (replace id values with your own images in the asset manager)
// Tutorial text will be created and added only after the game starts (see startGameWithSelectedBird)
var tutorialTextWhite = null;
var tutorialText = null;
game.score = 0;
game.obstacleSpeed = 5;
// Default value, will be overwritten by selection screen
game.obstacleSpeedIncrease = 0.005;
game.checkObstacleCollision = function (obstacles) {
for (var i = 0; i < obstacles.length; i++) {
obstacles[i]._move_migrated();
var dist = Math.sqrt(Math.pow(bird.x - obstacles[i].x, 2) + Math.pow(bird.y - obstacles[i].y, 2));
if (dist < 280) {
LK.setScore(game.score);
LK.getSound('gameOverJingle').play();
LK.effects.flashScreen(0xff0000, 600);
LK.setTimeout(function () {
LK.showGameOver();
}, 2700); //{W} // Set to 2.7 seconds
return;
}
}
};
game.setBackgroundColor(0xffe0f0); // very light pink background
var record = typeof storage.record === 'number' ? storage.record : 0;
var scoreText = new Text2('0', {
size: 150,
fill: '#e75480',
//{V} // vivid pink
font: 'Impact',
dropShadow: true,
dropShadowColor: '#ffb6e6',
//{Y} // light pink shadow
dropShadowBlur: 5,
dropShadowDistance: 7,
dropShadowAngle: 0
});
scoreText.anchor.set(.5, 0);
LK.gui.top.addChild(scoreText);
var scoreText2 = new Text2('0', {
size: 150,
fill: '#ffb6e6',
//{14} // light pink
font: 'Impact'
});
scoreText2.anchor.set(.5, 0);
scoreText2.x = -4;
scoreText2.y = -5;
LK.gui.top.addChild(scoreText2);
// Record (high score) text
var recordText = new Text2('REKOR: ' + record, {
size: 80,
fill: '#e75480',
font: 'Impact',
dropShadow: true,
dropShadowColor: '#ffb6e6',
dropShadowBlur: 5,
dropShadowDistance: 7,
dropShadowAngle: 0
});
recordText.anchor.set(0.5, 0);
recordText.y = 140;
LK.gui.top.addChild(recordText);
LK.gui.top.addChild(scoreText);
// Character select state
var characterSelected = false;
var selectedBirdType = null;
var bird = null;
// Create character select UI
var selectText = new Text2('Hangimizle oynamak istersin', {
size: 80,
fill: '#e75480',
//{17} // vivid pink
font: 'Impact',
align: 'center'
});
selectText.anchor.set(0.5, 1);
selectText.x = 0;
selectText.y = -200;
LK.gui.center.addChild(selectText);
// --- Speed selection UI (Top Right) ---
var speedOptions = [{
label: "Yavaş",
value: 0.003
}, {
label: "Normal",
value: 0.005
}, {
label: "Hızlı",
value: 0.009
}];
var selectedSpeedIndex = 1; // Default to "Normal"
// Small speed display at top right
var speedDisplayText = new Text2('Hız: ' + speedOptions[selectedSpeedIndex].label, {
size: 60,
fill: '#e75480',
font: 'Impact',
align: 'center'
});
speedDisplayText.anchor.set(1, 0); // Top right
speedDisplayText.x = -40; // Padding from right edge
speedDisplayText.y = 20;
speedDisplayText.interactive = true;
LK.gui.topRight.addChild(speedDisplayText);
// Add left/right arrows for speed selection
var speedLeftArrow = new Text2('<', {
size: 60,
fill: '#e75480',
font: 'Impact'
});
speedLeftArrow.anchor.set(1, 0);
speedLeftArrow.x = -170;
speedLeftArrow.y = 20;
speedLeftArrow.interactive = true;
LK.gui.topRight.addChild(speedLeftArrow);
var speedRightArrow = new Text2('>', {
size: 60,
fill: '#e75480',
font: 'Impact'
});
speedRightArrow.anchor.set(1, 0);
speedRightArrow.x = 0;
speedRightArrow.y = 20;
speedRightArrow.interactive = true;
LK.gui.topRight.addChild(speedRightArrow);
function updateSpeedDisplay() {
speedDisplayText.setText('Hız: ' + speedOptions[selectedSpeedIndex].label);
}
// Only allow speed change before character is selected
speedLeftArrow.down = function () {
if (characterSelected) return;
if (selectedSpeedIndex > 0) {
selectedSpeedIndex--;
updateSpeedDisplay();
}
};
speedRightArrow.down = function () {
if (characterSelected) return;
if (selectedSpeedIndex < speedOptions.length - 1) {
selectedSpeedIndex++;
updateSpeedDisplay();
}
};
speedDisplayText.down = function () {
// Optional: cycle through speeds by tapping the label itself
if (characterSelected) return;
selectedSpeedIndex = (selectedSpeedIndex + 1) % speedOptions.length;
updateSpeedDisplay();
};
// --- End speed selection UI (Top Right) ---
// Bird 1 preview and costume overlay
var bird1Preview = LK.getAsset('bird', {
anchorX: 0.5,
anchorY: 0.5
});
bird1Preview.x = -200;
bird1Preview.y = 200;
bird1Preview.scaleX = 2;
bird1Preview.scaleY = 2;
LK.gui.center.addChild(bird1Preview);
// Costume overlay for bird1Preview
var bird1CostumeOverlay = null;
function updateBird1CostumeOverlay() {
// Remove previous overlay if exists
if (bird1CostumeOverlay && bird1Preview.parent) {
bird1Preview.parent.removeChild(bird1CostumeOverlay);
bird1CostumeOverlay = null;
}
// Add new overlay if not classic
if (selectedCostume === 1) {
// Crown
bird1CostumeOverlay = LK.getAsset('costume_crown', {
anchorX: 0.5,
anchorY: 1
});
bird1CostumeOverlay.x = bird1Preview.x;
bird1CostumeOverlay.y = bird1Preview.y - 120;
bird1CostumeOverlay.scaleX = 2;
bird1CostumeOverlay.scaleY = 2;
LK.gui.center.addChild(bird1CostumeOverlay);
} else if (selectedCostume === 2) {
// Glasses
bird1CostumeOverlay = LK.getAsset('costume_glasses', {
anchorX: 0.5,
anchorY: 0.5
});
bird1CostumeOverlay.x = bird1Preview.x;
bird1CostumeOverlay.y = bird1Preview.y - 10;
bird1CostumeOverlay.scaleX = 2;
bird1CostumeOverlay.scaleY = 2;
LK.gui.center.addChild(bird1CostumeOverlay);
} else if (selectedCostume === 3) {
// Mustache
bird1CostumeOverlay = LK.getAsset('costume_mustache', {
anchorX: 0.5,
anchorY: 0.5
});
bird1CostumeOverlay.x = bird1Preview.x;
bird1CostumeOverlay.y = bird1Preview.y + 60;
bird1CostumeOverlay.scaleX = 2;
bird1CostumeOverlay.scaleY = 2;
LK.gui.center.addChild(bird1CostumeOverlay);
} else if (selectedCostume === 4) {
// Beard
bird1CostumeOverlay = LK.getAsset('costume_beard', {
anchorX: 0.5,
anchorY: 0.5
});
bird1CostumeOverlay.x = bird1Preview.x;
bird1CostumeOverlay.y = bird1Preview.y + 100;
bird1CostumeOverlay.scaleX = 2;
bird1CostumeOverlay.scaleY = 2;
LK.gui.center.addChild(bird1CostumeOverlay);
}
}
updateBird1CostumeOverlay();
// Animate bird1Preview up and down
function animateBird1PreviewDown() {
tween(bird1Preview, {
y: 240
}, {
duration: 1200,
easing: tween.sineInOut,
onFinish: function onFinish() {
animateBird1PreviewUp();
}
});
}
function animateBird1PreviewUp() {
tween(bird1Preview, {
y: 160
}, {
duration: 1200,
easing: tween.sineInOut,
onFinish: function onFinish() {
animateBird1PreviewDown();
}
});
}
animateBird1PreviewDown();
// Bird 2 preview and costume overlay
var bird2Preview = LK.getAsset('bird2', {
anchorX: 0.5,
anchorY: 0.5
});
bird2Preview.x = 200;
bird2Preview.y = 200;
bird2Preview.scaleX = 2;
bird2Preview.scaleY = 2;
LK.gui.center.addChild(bird2Preview);
// Costume overlay for bird1Preview and bird2Preview
var bird1CostumeOverlay = null;
var bird2CostumeOverlay = null;
// Helper to update overlays' transform to match preview birds
function updatePreviewCostumeOverlayTransforms() {
if (bird1CostumeOverlay && bird1Preview) {
bird1CostumeOverlay.x = bird1Preview.x;
// Y offset depends on costume
if (selectedCostume === 1) bird1CostumeOverlay.y = bird1Preview.y - 120;else if (selectedCostume === 2) bird1CostumeOverlay.y = bird1Preview.y - 10;else if (selectedCostume === 3) bird1CostumeOverlay.y = bird1Preview.y + 60;else if (selectedCostume === 4) bird1CostumeOverlay.y = bird1Preview.y + 100;
bird1CostumeOverlay.scaleX = bird1Preview.scaleX;
bird1CostumeOverlay.scaleY = bird1Preview.scaleY;
}
if (bird2CostumeOverlay && bird2Preview) {
bird2CostumeOverlay.x = bird2Preview.x;
if (selectedCostume === 1) bird2CostumeOverlay.y = bird2Preview.y - 120;else if (selectedCostume === 2) bird2CostumeOverlay.y = bird2Preview.y - 10;else if (selectedCostume === 3) bird2CostumeOverlay.y = bird2Preview.y + 60;else if (selectedCostume === 4) bird2CostumeOverlay.y = bird2Preview.y + 100;
bird2CostumeOverlay.scaleX = bird2Preview.scaleX;
bird2CostumeOverlay.scaleY = bird2Preview.scaleY;
}
}
// Costume overlay for bird1Preview
// Costume overlay for bird2Preview
function updateBird2CostumeOverlay() {
if (bird2CostumeOverlay && bird2Preview.parent) {
bird2Preview.parent.removeChild(bird2CostumeOverlay);
bird2CostumeOverlay = null;
}
if (selectedCostume === 1) {
bird2CostumeOverlay = LK.getAsset('costume_crown', {
anchorX: 0.5,
anchorY: 1
});
} else if (selectedCostume === 2) {
bird2CostumeOverlay = LK.getAsset('costume_glasses', {
anchorX: 0.5,
anchorY: 0.5
});
} else if (selectedCostume === 3) {
bird2CostumeOverlay = LK.getAsset('costume_mustache', {
anchorX: 0.5,
anchorY: 0.5
});
} else if (selectedCostume === 4) {
bird2CostumeOverlay = LK.getAsset('costume_beard', {
anchorX: 0.5,
anchorY: 0.5
});
}
if (bird2CostumeOverlay) {
LK.gui.center.addChild(bird2CostumeOverlay);
updatePreviewCostumeOverlayTransforms();
}
}
updateBird1CostumeOverlay();
updateBird2CostumeOverlay();
// Animate overlays with preview birds
function updatePreviewCostumeOverlayOnTick() {
updatePreviewCostumeOverlayTransforms();
}
LK.on('tick', updatePreviewCostumeOverlayOnTick);
// --- Costume section button (center, below birds) ---
var costumeButton = new Text2('Kostümler', {
size: 80,
fill: '#e75480',
font: 'Impact',
align: 'center'
});
costumeButton.anchor.set(0.5, 0);
costumeButton.x = 0;
costumeButton.y = 500;
costumeButton.interactive = true;
LK.gui.center.addChild(costumeButton);
var costumePanelOpen = false;
// Animate bird2Preview up and down
function animateBird2PreviewDown() {
tween(bird2Preview, {
y: 240
}, {
duration: 1200,
easing: tween.sineInOut,
onFinish: animateBird2PreviewUp
});
}
function animateBird2PreviewUp() {
tween(bird2Preview, {
y: 160
}, {
duration: 1200,
easing: tween.sineInOut,
onFinish: animateBird2PreviewDown
});
}
animateBird2PreviewUp();
// Add touch/click handlers for selection
bird1Preview.interactive = true;
bird2Preview.interactive = true;
// Costume selection state
var selectedCostume = 0;
var costumePanel = null;
var costumeOptions = [{
name: "Klasik",
id: 0
}, {
name: "Taç",
id: 1
}, {
name: "Gözlük",
id: 2
}, {
name: "Bıyık",
id: 3
}, {
name: "Sakal",
id: 4
}];
// Costume panel UI
function showCostumePanel() {
if (costumePanelOpen) return;
costumePanelOpen = true;
costumePanel = new Container();
// Panel background
var panelBg = LK.getAsset('obstacleShadow2', {
anchorX: 0.5,
anchorY: 0.5
});
panelBg.width = 700;
panelBg.height = 350;
panelBg.x = 0;
panelBg.y = 600;
costumePanel.addChild(panelBg);
// Costume option buttons (düzenli grid: 2 satır, 3 sütun)
var gridCols = 3;
var gridRows = Math.ceil(costumeOptions.length / gridCols);
var optionWidth = 200;
var optionHeight = 120;
var startX = -optionWidth * (gridCols - 1) / 2;
var startY = 600 - (gridRows - 1) * optionHeight / 2;
for (var i = 0; i < costumeOptions.length; i++) {
(function (idx) {
var opt = costumeOptions[idx];
var col = idx % gridCols;
var row = Math.floor(idx / gridCols);
var btn = new Text2(opt.name, {
size: 70,
fill: selectedCostume === opt.id ? '#e75480' : '#ffb6e6',
font: 'Impact',
align: 'center'
});
btn.anchor.set(0.5, 0.5);
btn.x = startX + col * optionWidth;
btn.y = startY + row * optionHeight;
btn.interactive = true;
btn.down = function () {
selectedCostume = opt.id;
// Refresh panel to show selection
LK.gui.center.removeChild(costumePanel);
costumePanelOpen = false;
showCostumePanel();
// Update overlays on preview birds
if (typeof updateBird1CostumeOverlay === "function") updateBird1CostumeOverlay();
if (typeof updateBird2CostumeOverlay === "function") updateBird2CostumeOverlay();
};
costumePanel.addChild(btn);
})(i);
}
// Close button
var closeBtn = new Text2('Kapat', {
size: 60,
fill: '#e75480',
font: 'Impact'
});
closeBtn.anchor.set(0.5, 0.5);
closeBtn.x = 0;
closeBtn.y = 800;
closeBtn.interactive = true;
closeBtn.down = function () {
LK.gui.center.removeChild(costumePanel);
costumePanelOpen = false;
// Update overlays on preview birds
if (typeof updateBird1CostumeOverlay === "function") updateBird1CostumeOverlay();
if (typeof updateBird2CostumeOverlay === "function") updateBird2CostumeOverlay();
};
costumePanel.addChild(closeBtn);
LK.gui.center.addChild(costumePanel);
}
// Costume button handler
costumeButton.down = function () {
if (!costumePanelOpen) {
showCostumePanel();
}
};
bird1Preview.down = function (x, y, obj) {
if (!characterSelected) {
// Play a sound immediately after selecting a character
LK.getSound('startsound').play();
// Animate scale up, then back to normal
tween(bird1Preview, {
scaleX: 2.4,
scaleY: 2.4
}, {
duration: 120,
easing: tween.sineInOut,
onFinish: function onFinish() {
tween(bird1Preview, {
scaleX: 2,
scaleY: 2
}, {
duration: 120,
easing: tween.sineInOut,
onFinish: function onFinish() {
selectedBirdType = 'bird';
startGameWithSelectedBird();
}
});
}
});
}
};
bird2Preview.down = function (x, y, obj) {
if (!characterSelected) {
// Play a sound immediately after selecting a character
LK.getSound('startsound').play();
// Animate scale up, then back to normal
tween(bird2Preview, {
scaleX: 2.4,
scaleY: 2.4
}, {
duration: 120,
easing: tween.sineInOut,
onFinish: function onFinish() {
tween(bird2Preview, {
scaleX: 2,
scaleY: 2
}, {
duration: 120,
easing: tween.sineInOut,
onFinish: function onFinish() {
selectedBirdType = 'bird2';
startGameWithSelectedBird();
}
});
}
});
}
};
function startGameWithSelectedBird() {
characterSelected = true;
// Remove selection UI
LK.gui.center.removeChild(selectText);
LK.gui.center.removeChild(bird1Preview);
LK.gui.center.removeChild(bird2Preview);
if (costumeButton && LK.gui.center.children.indexOf(costumeButton) !== -1) {
LK.gui.center.removeChild(costumeButton);
}
if (costumePanel && LK.gui.center.children.indexOf(costumePanel) !== -1) {
LK.gui.center.removeChild(costumePanel);
}
// Remove costume overlays from center of screen
if (typeof bird1CostumeOverlay !== "undefined" && bird1CostumeOverlay && bird1CostumeOverlay.parent) {
bird1CostumeOverlay.parent.removeChild(bird1CostumeOverlay);
bird1CostumeOverlay = null;
}
if (typeof bird2CostumeOverlay !== "undefined" && bird2CostumeOverlay && bird2CostumeOverlay.parent) {
bird2CostumeOverlay.parent.removeChild(bird2CostumeOverlay);
bird2CostumeOverlay = null;
}
// Remove speed selection UI (top right)
LK.gui.topRight.removeChild(speedDisplayText);
LK.gui.topRight.removeChild(speedLeftArrow);
LK.gui.topRight.removeChild(speedRightArrow);
// Play a sound after selecting a character
// (Moved to down handler for immediate feedback)
// Add the selected bird to the game
bird = game.addChild(new Bird(selectedBirdType, selectedCostume));
bird.x = 1024;
bird.y = 1366;
// Apply selected speed
game.obstacleSpeedIncrease = speedOptions[selectedSpeedIndex].value;
// Continue with the rest of the game setup
leftWall = game.addChild(new Wall());
leftWall.x = 0;
leftWall.y = 1366;
rightWall = game.addChild(new Wall());
rightWall.x = 2048;
rightWall.y = 1366;
leftObstacles = [];
rightObstacles = [];
obstacleSpawnRandomness = 120;
obstacleSpawnRandomnessDecrease = 0.025 * (2 / 3);
obstacleSpawnY = -500;
leftObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
rightObstacleSpawnTime = Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
game.isMouseDown = false;
// Show tutorial text softly at the bottom when the game starts
tutorialTextWhite = new Text2('Zıplamak için\nEkrana Dokunn', {
size: 90,
fill: '#ffb6e6',
font: 'Impact',
align: 'center'
});
tutorialTextWhite.anchor.set(.5, 1);
tutorialTextWhite.x = -4;
tutorialTextWhite.y = -62;
LK.gui.bottom.addChild(tutorialTextWhite);
tutorialText = new Text2('Zıplamak için\nEkrana Dokunn', {
size: 90,
fill: '#e75480',
font: 'Impact',
dropShadow: true,
dropShadowColor: '#ffb6e6',
dropShadowBlur: 5,
dropShadowDistance: 7,
dropShadowAngle: 0,
align: 'center'
});
tutorialText.anchor.set(.5, 1);
tutorialText.y = -50;
LK.gui.bottom.addChild(tutorialText);
}
// Only allow input after character is selected
game.down = function (x, y, obj) {
if (characterSelected && bird) {
bird.flap();
game.isMouseDown = true;
}
};
game.up = function (x, y, obj) {
if (characterSelected) {
game.isMouseDown = false;
}
};
game.update = function () {
if (!characterSelected || !bird) {
// Don't run gameplay logic until a bird is selected
return;
}
bird._update_migrated();
if (game.score > 2) {
tutorialText.y += 5;
tutorialTextWhite.y += 5;
}
scoreText.setText(game.score);
scoreText2.setText(game.score);
// Update record if needed
if (game.score > record) {
record = game.score;
storage.record = record;
recordText.setText('REKOR: ' + record);
}
game.obstacleSpeed += game.obstacleSpeedIncrease;
obstacleSpawnRandomness -= obstacleSpawnRandomnessDecrease;
if (obstacleSpawnRandomness < 20) {
obstacleSpawnRandomness = 20;
}
if (LK.ticks >= leftObstacleSpawnTime) {
var newObstacle = game.addChildAt(new Obstacle(), 0);
newObstacle.x = 0;
newObstacle.y = obstacleSpawnY;
leftObstacles.push(newObstacle);
leftObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
}
if (LK.ticks >= rightObstacleSpawnTime) {
var newObstacle = game.addChildAt(new Obstacle(), 0);
newObstacle.x = 2048;
newObstacle.y = -newObstacle.height;
rightObstacles.push(newObstacle);
rightObstacleSpawnTime += Math.floor(Math.random() * obstacleSpawnRandomness) + obstacleSpawnRandomness;
}
if (bird.intersects(leftWall) && bird.xSpeed < 0 || bird.intersects(rightWall) && bird.xSpeed > 0) {
bird.xSpeed = -bird.xSpeed;
bird.flip();
game.score++;
LK.setScore(game.score);
LK.getSound('bounce').play();
}
for (var i = leftObstacles.length - 1; i >= 0; i--) {
leftObstacles[i]._move_migrated(game.obstacleSpeed);
if (leftObstacles[i].y > 3232) {
leftObstacles[i].destroy();
leftObstacles.splice(i, 1);
}
}
for (var i = rightObstacles.length - 1; i >= 0; i--) {
rightObstacles[i]._move_migrated(game.obstacleSpeed);
if (rightObstacles[i].y > 3232) {
rightObstacles[i].destroy();
rightObstacles.splice(i, 1);
}
}
game.checkObstacleCollision(leftObstacles);
game.checkObstacleCollision(rightObstacles);
if (bird.y < 0 || bird.y > 2732) {
LK.setScore(game.score);
LK.getSound('gameOverJingle').play();
LK.effects.flashScreen(0xff0000, 600);
LK.setTimeout(function () {
LK.showGameOver();
}, 2700); //{28} // Set to 2.7 seconds
return;
}
}; ===================================================================
--- original.js
+++ change.js
@@ -87,15 +87,30 @@
// Make all costume overlays follow the bird's position, scale, and rotation exactly
if (self.costumeSprites && self.costumeSprites.length) {
for (var i = 0; i < self.costumeSprites.length; i++) {
var sprite = self.costumeSprites[i];
- // Always keep overlays at (0,0) relative to bird, so they move with the bird
- sprite.x = 0;
- sprite.y = 0;
- // Match scale and rotation to birdGraphics
+ // Match the exact transform logic as the selection screen overlays
sprite.scale.x = birdGraphics.scale.x;
sprite.scale.y = birdGraphics.scale.y;
sprite.rotation = birdGraphics.rotation;
+ // Position overlays with the same offsets as in the selection screen
+ if (costumeId === 1) {
+ // Crown
+ sprite.x = 0;
+ sprite.y = -birdGraphics.height * 0.55;
+ } else if (costumeId === 2) {
+ // Glasses
+ sprite.x = 0;
+ sprite.y = -birdGraphics.height * 0.05;
+ } else if (costumeId === 3) {
+ // Mustache
+ sprite.x = 0;
+ sprite.y = birdGraphics.height * 0.29;
+ } else if (costumeId === 4) {
+ // Beard
+ sprite.x = 0;
+ sprite.y = birdGraphics.height * 0.49;
+ }
}
}
};
self.flip = function () {
Dusty pink wall with hearts inside . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat Let the hearts be hearts of vibrant colors and various pink emojis and let the wall be square
powder pink square. In-Game asset. 2d. High contrast. No shadows
pixel sun glasses . No background. Transparent background. Blank background. No shadows. 2d. In-Game asset. flat
brown beard. In-Game asset. 2d. High contrast. No shadows
king crown. In-Game asset. 2d. High contrast. No shadows
bıyık. In-Game asset. 2d. High contrast. No shadows
gri tonlarında şapka. In-Game asset. 2d. High contrast. No shadows
red rose realistic. In-Game asset. 2d. High contrast. No shadows
Daisy Bouquet Realistic. In-Game asset. 2d. High contrast. No shadows
pink flower bouquet realistic. In-Game asset. 2d. High contrast. No shadows