User prompt
upgrade ui açıldığında ekranda hiç bir işlem yapamıyorum ve gözükmüyor. Upgrade ui açıldığında oyun duraklatılmış gibi olsun canavarlar bana yaklaşmasın. seçim yapana kadar oyun ilerlemesin.
User prompt
upgradi UI'ı score yazısının altına daha küçük şekilde yerleştir
User prompt
seviye 10 olduğunda ekranında ortasında bir seçim ekranı belirsin. solda saldırı hızı artışı butonu sağda damage artışı butonu olsun. buna görede bir asset seti ekle
User prompt
score 10 olduğunda bir ekran açılsın birisinde saldırı hızı artışı diğerinde ise damage artışı olsun. ikisinden birisini seçebileyim
User prompt
wizardın da fireball gibi mouse hareketine göre 360 derece dönebilsin. wizardın görsel olarak doğru şekli sola bakıyor
User prompt
büyücü hareket edemesin sabit kalsın
User prompt
enemy2 ve enemy3 için asset ekle
User prompt
Düşman zorlukları ekle. düşman 2 ve 3 olsun. her 10 skorda bir düşmanların seviyesi artsın. ve karışık gelsin. örneğin 10 skor aldığımda artık düşman 2lerde gelmeye başlasın. düşman 2, 2 fireball ile ölebilsin. düşman 3, üç fireball ile ölebilsin.
User prompt
Şimdi oyuna bir background ekleyelim assetlere bir background ekle
User prompt
düşman yaklaşıyorken bir miktar büyüyüp küçüksün. hareket ediyormuş efekti sağlansın
User prompt
düşman içinde bir asset oluştur
User prompt
Loading Add enemy spawning, movement toward wizard, collision with fireball, and scoring
User prompt
fireball'un hızını çok yavaşlat
User prompt
when the mage is firing, the fireball should change visuals according to the mouse cursor. So right now when you shoot to the right, it's correct, but when you shoot upwards, you have to turn the picture 90 degrees. We need to set it to 360 degrees.
User prompt
Generate the first version of the source code of my game: Pixel Wizard: Blue Hat Adventure.
User prompt
Pixel Wizard: Blue Hat Adventure
Initial prompt
hello Ava. I want to create a game which 2d pixelation. the adventure of a wizard in a blue hat. ,I can control the cursor with the mouse and throw a fireball with the left click.
/****
* Classes
****/
// Enemy class: represents an enemy that moves toward the wizard
var Enemy = Container.expand(function () {
var self = Container.call(this);
// Attach a unique enemy asset (pixel blue monster)
var enemySprite = self.attachAsset('enemy', {
anchorX: 0.5,
anchorY: 0.5
});
// Enemy speed and direction
self.vx = 0;
self.vy = 0;
// Track last position for event triggers
self.lastX = 0;
self.lastY = 0;
self.health = 1; // Enemy1: 1 hit to kill
self.type = 1;
self.update = function () {
self.x += self.vx;
self.y += self.vy;
// Pulsate scale for movement effect
var t = LK.ticks || Date.now(); // fallback for safety
var scale = 1 + 0.15 * Math.sin((t + self.x + self.y) * 0.05);
if (self.children && self.children.length > 0) {
self.children[0].scale.x = scale;
self.children[0].scale.y = scale;
}
// Remove enemy if it leaves the screen
if (self.x < -100 || self.x > 2048 + 100 || self.y < -100 || self.y > 2732 + 100) {
self.destroy();
}
self.lastX = self.x;
self.lastY = self.y;
};
return self;
});
// Enemy2: needs 2 fireballs to die
var Enemy2 = Container.expand(function () {
var self = Container.call(this);
var enemySprite = self.attachAsset('enemy2', {
anchorX: 0.5,
anchorY: 0.5
});
self.vx = 0;
self.vy = 0;
self.lastX = 0;
self.lastY = 0;
self.health = 2;
self.type = 2;
self.update = function () {
self.x += self.vx;
self.y += self.vy;
var t = LK.ticks || Date.now();
var scale = 1 + 0.18 * Math.sin((t + self.x + self.y) * 0.06);
if (self.children && self.children.length > 0) {
self.children[0].scale.x = scale;
self.children[0].scale.y = scale;
}
if (self.x < -100 || self.x > 2048 + 100 || self.y < -100 || self.y > 2732 + 100) {
self.destroy();
}
self.lastX = self.x;
self.lastY = self.y;
};
return self;
});
// Enemy3: needs 3 fireballs to die
var Enemy3 = Container.expand(function () {
var self = Container.call(this);
var enemySprite = self.attachAsset('enemy3', {
anchorX: 0.5,
anchorY: 0.5
});
self.vx = 0;
self.vy = 0;
self.lastX = 0;
self.lastY = 0;
self.health = 3;
self.type = 3;
self.update = function () {
self.x += self.vx;
self.y += self.vy;
var t = LK.ticks || Date.now();
var scale = 1 + 0.22 * Math.sin((t + self.x + self.y) * 0.07);
if (self.children && self.children.length > 0) {
self.children[0].scale.x = scale;
self.children[0].scale.y = scale;
}
if (self.x < -100 || self.x > 2048 + 100 || self.y < -100 || self.y > 2732 + 100) {
self.destroy();
}
self.lastX = self.x;
self.lastY = self.y;
};
return self;
});
// Fireball class: represents a fireball shot by the wizard
var Fireball = Container.expand(function () {
var self = Container.call(this);
// Attach fireball asset (pixel fireball)
var fireballSprite = self.attachAsset('fireball', {
anchorX: 0.5,
anchorY: 0.5
});
// Fireball speed and direction
self.vx = 0;
self.vy = 0;
// Track last position for event triggers
self.lastX = 0;
self.lastY = 0;
self.update = function () {
self.x += self.vx;
self.y += self.vy;
// Remove fireball if it leaves the screen
if (self.x < -100 || self.x > 2048 + 100 || self.y < -100 || self.y > 2732 + 100) {
self.destroy();
}
self.lastX = self.x;
self.lastY = self.y;
};
return self;
});
// Wizard class: represents the player character
var Wizard = Container.expand(function () {
var self = Container.call(this);
// Attach wizard asset (blue hat, pixel style)
var wizardSprite = self.attachAsset('wizard', {
anchorX: 0.5,
anchorY: 0.5
});
// Track last position for event triggers
self.lastX = 0;
self.lastY = 0;
// Update method (called every tick)
self.update = function () {
// No movement logic here; wizard is moved by mouse/touch
self.lastX = self.x;
self.lastY = self.y;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
});
/****
* Game Code
****/
// Upgrade button assets
;
// Add background image to the game scene
var background = LK.getAsset('background', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
width: 2048,
height: 2732
});
game.addChild(background);
// --- Game Code for Pixel Wizard: Blue Hat Adventure ---
// Create wizard instance and add to game
var wizard = new Wizard();
game.addChild(wizard);
// Center wizard on screen at start
wizard.x = 2048 / 2;
wizard.y = 2732 / 2;
// Array to hold all fireballs
var fireballs = [];
// Helper: get direction vector from wizard to (x, y)
function getDirection(fromX, fromY, toX, toY, speed) {
var dx = toX - fromX;
var dy = toY - fromY;
var len = Math.sqrt(dx * dx + dy * dy);
if (len === 0) return {
vx: 0,
vy: 0
};
return {
vx: dx / len * speed,
vy: dy / len * speed
};
}
// Dragging wizard with mouse/touch (disabled)
var dragging = false;
// Move handler: wizard does not move
game.move = function (x, y, obj) {
// Wizard is fixed; do nothing
// Calculate angle from wizard to pointer/touch and rotate wizard sprite
var dx = x - wizard.x;
var dy = y - wizard.y;
var angle = Math.atan2(dy, dx);
// Wizard's default asset faces left, so add Math.PI to rotate to correct direction
if (wizard.children && wizard.children.length > 0) {
wizard.children[0].rotation = angle + Math.PI;
}
};
// Down handler: only shoot fireball toward cursor/touch
game.down = function (x, y, obj) {
// Prevent shooting if upgrade UI is open
if (typeof upgradeUI !== "undefined" && upgradeUI) return;
// Fireball cooldown logic
if (typeof fireballLastShot === "undefined") fireballLastShot = 0;
if (typeof fireballCooldownBase === "undefined") fireballCooldownBase = 600;
var now = Date.now();
var cooldown = fireballCooldownBase;
if (now - fireballLastShot < cooldown) return;
fireballLastShot = now;
// Always shoot fireball toward cursor/touch
var fireball = new Fireball();
fireball.x = wizard.x;
fireball.y = wizard.y;
var dir = getDirection(wizard.x, wizard.y, x, y, 8); // 8 px per frame (much slower)
fireball.vx = dir.vx;
fireball.vy = dir.vy;
// Calculate angle for rotation (in radians)
var angle = Math.atan2(dir.vy, dir.vx);
// Set fireball sprite rotation to match direction
if (fireball.children && fireball.children.length > 0) {
fireball.children[0].rotation = angle;
}
// Also rotate wizard to face the shot direction
if (wizard.children && wizard.children.length > 0) {
wizard.children[0].rotation = Math.atan2(y - wizard.y, x - wizard.x) + Math.PI;
}
fireballs.push(fireball);
game.addChild(fireball);
};
// Up handler: nothing to do
game.up = function (x, y, obj) {
// Wizard is fixed; do nothing
};
// Array to hold all enemies
var enemies = [];
// Score variable
var score = 0;
// Score text
var scoreText = new Text2("Score: 0", {
size: 100,
fill: "#fff"
});
scoreText.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreText);
// Helper: spawn an enemy at a random edge, moving toward wizard
function spawnEnemy() {
// Determine which enemy types are available based on score
var availableTypes = [1];
if (score >= 10) availableTypes.push(2);
if (score >= 20) availableTypes.push(3);
// Randomly pick an available type
var typeIdx = Math.floor(Math.random() * availableTypes.length);
var enemyType = availableTypes[typeIdx];
var enemy;
if (enemyType === 1) {
enemy = new Enemy();
} else if (enemyType === 2) {
enemy = new Enemy2();
} else {
enemy = new Enemy3();
}
// Randomly pick an edge: 0=top, 1=bottom, 2=left, 3=right
var edge = Math.floor(Math.random() * 4);
var ex, ey;
if (edge === 0) {
// top
ex = Math.random() * 2048;
ey = -50;
} else if (edge === 1) {
// bottom
ex = Math.random() * 2048;
ey = 2732 + 50;
} else if (edge === 2) {
// left
ex = -50;
ey = Math.random() * 2732;
} else {
// right
ex = 2048 + 50;
ey = Math.random() * 2732;
}
enemy.x = ex;
enemy.y = ey;
// Move toward wizard
var dir = getDirection(ex, ey, wizard.x, wizard.y, 2.5 + Math.random() * 1.5); // randomize speed a bit
enemy.vx = dir.vx;
enemy.vy = dir.vy;
enemies.push(enemy);
game.addChild(enemy);
}
// Enemy spawn timer
var enemySpawnTimer = LK.setInterval(function () {
spawnEnemy();
}, 1200);
// Game update: update wizard, fireballs, enemies, handle collisions, and scoring
game.update = function () {
// Update wizard
if (wizard.update) wizard.update();
// Update fireballs and remove destroyed ones
for (var i = fireballs.length - 1; i >= 0; i--) {
var fb = fireballs[i];
if (fb.update) fb.update();
if (fb.destroyed) {
fireballs.splice(i, 1);
}
}
// --- Upgrade UI logic ---
if (typeof upgradeUIShown === "undefined") upgradeUIShown = false;
if (typeof attackSpeedLevel === "undefined") attackSpeedLevel = 0;
if (typeof damageLevel === "undefined") damageLevel = 0;
if (typeof fireballDamage === "undefined") fireballDamage = 1;
if (typeof fireballCooldown === "undefined") fireballCooldown = 0;
if (typeof fireballCooldownBase === "undefined") fireballCooldownBase = 0;
if (!upgradeUIShown && score >= 10) {
// Pause enemy spawn
if (typeof enemySpawnTimer !== "undefined") LK.clearInterval(enemySpawnTimer);
// Create upgrade UI container
upgradeUIShown = true;
upgradeUI = new Container();
// Dim background
var dimBg = LK.getAsset('background', {
anchorX: 0,
anchorY: 0,
x: 0,
y: 0,
width: 2048,
height: 2732
});
dimBg.alpha = 0.7;
upgradeUI.addChild(dimBg);
// Attack speed button (left)
var atkBtn = LK.getAsset('upgrade_attack', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 - 350,
y: 2732 / 2
});
upgradeUI.addChild(atkBtn);
// Damage button (right)
var dmgBtn = LK.getAsset('upgrade_damage', {
anchorX: 0.5,
anchorY: 0.5,
x: 2048 / 2 + 350,
y: 2732 / 2
});
upgradeUI.addChild(dmgBtn);
// Attack speed label
var atkLabel = new Text2("Saldırı Hızı+", {
size: 70,
fill: "#fff"
});
atkLabel.anchor.set(0.5, 0);
atkLabel.x = atkBtn.x;
atkLabel.y = atkBtn.y + 140;
upgradeUI.addChild(atkLabel);
// Damage label
var dmgLabel = new Text2("Damage+", {
size: 70,
fill: "#fff"
});
dmgLabel.anchor.set(0.5, 0);
dmgLabel.x = dmgBtn.x;
dmgLabel.y = dmgBtn.y + 140;
upgradeUI.addChild(dmgLabel);
// Add to GUI overlay (centered)
LK.gui.center.addChild(upgradeUI);
// Button handlers
atkBtn.down = function (x, y, obj) {
attackSpeedLevel += 1;
// Lower fireball cooldown (minimum 200ms)
fireballCooldownBase = Math.max(200, 600 - attackSpeedLevel * 150);
// Remove UI
if (upgradeUI && upgradeUI.parent) upgradeUI.parent.removeChild(upgradeUI);
upgradeUI = null;
// Resume enemy spawn
enemySpawnTimer = LK.setInterval(function () {
spawnEnemy();
}, 1200);
};
dmgBtn.down = function (x, y, obj) {
damageLevel += 1;
fireballDamage = 2;
// Remove UI
if (upgradeUI && upgradeUI.parent) upgradeUI.parent.removeChild(upgradeUI);
upgradeUI = null;
// Resume enemy spawn
enemySpawnTimer = LK.setInterval(function () {
spawnEnemy();
}, 1200);
};
}
// Update enemies and remove destroyed ones
for (var j = enemies.length - 1; j >= 0; j--) {
var enemy = enemies[j];
if (enemy.update) enemy.update();
if (enemy.destroyed) {
enemies.splice(j, 1);
continue;
}
// Check collision with wizard (game over)
if (enemy.lastWasIntersecting === undefined) enemy.lastWasIntersecting = false;
var nowIntersecting = enemy.intersects(wizard);
if (!enemy.lastWasIntersecting && nowIntersecting) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
return;
}
enemy.lastWasIntersecting = nowIntersecting;
// Check collision with fireballs
for (var k = fireballs.length - 1; k >= 0; k--) {
var fb = fireballs[k];
if (enemy['fb' + k + '_lastIntersecting'] === undefined) enemy['fb' + k + '_lastIntersecting'] = false;
var fbIntersect = enemy.intersects(fb);
if (!enemy['fb' + k + '_lastIntersecting'] && fbIntersect) {
// Decrease enemy health by fireballDamage (default 1, 2 if upgraded)
enemy.health -= typeof fireballDamage !== "undefined" ? fireballDamage : 1;
// Destroy fireball
fb.destroy();
fireballs.splice(k, 1);
// If enemy health reaches 0, destroy enemy and increase score
if (enemy.health <= 0) {
enemy.destroy();
enemies.splice(j, 1);
score += 1;
scoreText.setText("Score: " + score);
break;
}
}
enemy['fb' + k + '_lastIntersecting'] = fbIntersect;
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -151,8 +151,9 @@
/****
* Game Code
****/
+// Upgrade button assets
;
// Add background image to the game scene
var background = LK.getAsset('background', {
anchorX: 0,
@@ -201,19 +202,24 @@
}
};
// Down handler: only shoot fireball toward cursor/touch
game.down = function (x, y, obj) {
- // Always shoot fireball toward cursor/touch
+ // Prevent shooting if upgrade UI is open
+ if (typeof upgradeUI !== "undefined" && upgradeUI) return;
// Fireball cooldown logic
- if (fireballCooldown > 0) return;
- fireballCooldown = fireballDelay;
+ if (typeof fireballLastShot === "undefined") fireballLastShot = 0;
+ if (typeof fireballCooldownBase === "undefined") fireballCooldownBase = 600;
+ var now = Date.now();
+ var cooldown = fireballCooldownBase;
+ if (now - fireballLastShot < cooldown) return;
+ fireballLastShot = now;
+ // Always shoot fireball toward cursor/touch
var fireball = new Fireball();
fireball.x = wizard.x;
fireball.y = wizard.y;
- var dir = getDirection(wizard.x, wizard.y, x, y, fireballSpeed);
+ var dir = getDirection(wizard.x, wizard.y, x, y, 8); // 8 px per frame (much slower)
fireball.vx = dir.vx;
fireball.vy = dir.vy;
- fireball.damage = fireballDamage || 1; // set damage property
// Calculate angle for rotation (in radians)
var angle = Math.atan2(dir.vy, dir.vx);
// Set fireball sprite rotation to match direction
if (fireball.children && fireball.children.length > 0) {
@@ -233,15 +239,8 @@
// Array to hold all enemies
var enemies = [];
// Score variable
var score = 0;
-// Upgrade state
-var upgradePopup = null;
-var upgradeActive = false;
-var fireballSpeed = 8; // default fireball speed
-var fireballDamage = 1; // default fireball damage
-var fireballCooldown = 0; // ticks until next fireball allowed
-var fireballDelay = 0; // minimum ticks between fireballs (0 = no delay)
// Score text
var scoreText = new Text2("Score: 0", {
size: 100,
fill: "#fff"
@@ -301,18 +300,101 @@
// Game update: update wizard, fireballs, enemies, handle collisions, and scoring
game.update = function () {
// Update wizard
if (wizard.update) wizard.update();
- // Update fireball cooldown
- if (fireballCooldown > 0) fireballCooldown--;
// Update fireballs and remove destroyed ones
for (var i = fireballs.length - 1; i >= 0; i--) {
var fb = fireballs[i];
if (fb.update) fb.update();
if (fb.destroyed) {
fireballs.splice(i, 1);
}
}
+ // --- Upgrade UI logic ---
+ if (typeof upgradeUIShown === "undefined") upgradeUIShown = false;
+ if (typeof attackSpeedLevel === "undefined") attackSpeedLevel = 0;
+ if (typeof damageLevel === "undefined") damageLevel = 0;
+ if (typeof fireballDamage === "undefined") fireballDamage = 1;
+ if (typeof fireballCooldown === "undefined") fireballCooldown = 0;
+ if (typeof fireballCooldownBase === "undefined") fireballCooldownBase = 0;
+ if (!upgradeUIShown && score >= 10) {
+ // Pause enemy spawn
+ if (typeof enemySpawnTimer !== "undefined") LK.clearInterval(enemySpawnTimer);
+ // Create upgrade UI container
+ upgradeUIShown = true;
+ upgradeUI = new Container();
+ // Dim background
+ var dimBg = LK.getAsset('background', {
+ anchorX: 0,
+ anchorY: 0,
+ x: 0,
+ y: 0,
+ width: 2048,
+ height: 2732
+ });
+ dimBg.alpha = 0.7;
+ upgradeUI.addChild(dimBg);
+ // Attack speed button (left)
+ var atkBtn = LK.getAsset('upgrade_attack', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2 - 350,
+ y: 2732 / 2
+ });
+ upgradeUI.addChild(atkBtn);
+ // Damage button (right)
+ var dmgBtn = LK.getAsset('upgrade_damage', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: 2048 / 2 + 350,
+ y: 2732 / 2
+ });
+ upgradeUI.addChild(dmgBtn);
+ // Attack speed label
+ var atkLabel = new Text2("Saldırı Hızı+", {
+ size: 70,
+ fill: "#fff"
+ });
+ atkLabel.anchor.set(0.5, 0);
+ atkLabel.x = atkBtn.x;
+ atkLabel.y = atkBtn.y + 140;
+ upgradeUI.addChild(atkLabel);
+ // Damage label
+ var dmgLabel = new Text2("Damage+", {
+ size: 70,
+ fill: "#fff"
+ });
+ dmgLabel.anchor.set(0.5, 0);
+ dmgLabel.x = dmgBtn.x;
+ dmgLabel.y = dmgBtn.y + 140;
+ upgradeUI.addChild(dmgLabel);
+ // Add to GUI overlay (centered)
+ LK.gui.center.addChild(upgradeUI);
+ // Button handlers
+ atkBtn.down = function (x, y, obj) {
+ attackSpeedLevel += 1;
+ // Lower fireball cooldown (minimum 200ms)
+ fireballCooldownBase = Math.max(200, 600 - attackSpeedLevel * 150);
+ // Remove UI
+ if (upgradeUI && upgradeUI.parent) upgradeUI.parent.removeChild(upgradeUI);
+ upgradeUI = null;
+ // Resume enemy spawn
+ enemySpawnTimer = LK.setInterval(function () {
+ spawnEnemy();
+ }, 1200);
+ };
+ dmgBtn.down = function (x, y, obj) {
+ damageLevel += 1;
+ fireballDamage = 2;
+ // Remove UI
+ if (upgradeUI && upgradeUI.parent) upgradeUI.parent.removeChild(upgradeUI);
+ upgradeUI = null;
+ // Resume enemy spawn
+ enemySpawnTimer = LK.setInterval(function () {
+ spawnEnemy();
+ }, 1200);
+ };
+ }
// Update enemies and remove destroyed ones
for (var j = enemies.length - 1; j >= 0; j--) {
var enemy = enemies[j];
if (enemy.update) enemy.update();
@@ -334,10 +416,10 @@
var fb = fireballs[k];
if (enemy['fb' + k + '_lastIntersecting'] === undefined) enemy['fb' + k + '_lastIntersecting'] = false;
var fbIntersect = enemy.intersects(fb);
if (!enemy['fb' + k + '_lastIntersecting'] && fbIntersect) {
- // Decrease enemy health
- enemy.health -= fb.damage || 1;
+ // Decrease enemy health by fireballDamage (default 1, 2 if upgraded)
+ enemy.health -= typeof fireballDamage !== "undefined" ? fireballDamage : 1;
// Destroy fireball
fb.destroy();
fireballs.splice(k, 1);
// If enemy health reaches 0, destroy enemy and increase score
@@ -345,128 +427,8 @@
enemy.destroy();
enemies.splice(j, 1);
score += 1;
scoreText.setText("Score: " + score);
- // Show upgrade popup at score 10 (only once)
- if (score === 10 && !upgradeActive) {
- upgradeActive = true;
- // Pause enemy spawn
- LK.clearInterval(enemySpawnTimer);
- // Create popup container
- upgradePopup = new Container();
- // Semi-transparent background
- var popupBg = LK.getAsset('background', {
- anchorX: 0,
- anchorY: 0,
- x: 0,
- y: 0,
- width: 2048,
- height: 2732
- });
- popupBg.alpha = 0.7;
- upgradePopup.addChild(popupBg);
- // Title
- var title = new Text2("Bir Yükseltme Seç!", {
- size: 120,
- fill: "#fff"
- });
- title.anchor.set(0.5, 0);
- title.x = 2048 / 2;
- title.y = 700;
- upgradePopup.addChild(title);
- // Attack Speed Option
- var speedBtn = new Container();
- var speedBg = LK.getAsset('background', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 2 - 350,
- y: 1200,
- width: 500,
- height: 300
- });
- speedBg.alpha = 0.9;
- speedBtn.addChild(speedBg);
- var speedText = new Text2("Saldırı Hızı Artışı\n(Daha hızlı ateş et)", {
- size: 60,
- fill: "#fff"
- });
- speedText.anchor.set(0.5, 0.5);
- speedText.x = 2048 / 2 - 350;
- speedText.y = 1200;
- speedBtn.addChild(speedText);
- speedBtn.x = 0;
- speedBtn.y = 0;
- upgradePopup.addChild(speedBtn);
- // Damage Option
- var dmgBtn = new Container();
- var dmgBg = LK.getAsset('background', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: 2048 / 2 + 350,
- y: 1200,
- width: 500,
- height: 300
- });
- dmgBg.alpha = 0.9;
- dmgBtn.addChild(dmgBg);
- var dmgText = new Text2("Damage Artışı\n(Fireball daha güçlü)", {
- size: 60,
- fill: "#fff"
- });
- dmgText.anchor.set(0.5, 0.5);
- dmgText.x = 2048 / 2 + 350;
- dmgText.y = 1200;
- dmgBtn.addChild(dmgText);
- dmgBtn.x = 0;
- dmgBtn.y = 0;
- upgradePopup.addChild(dmgBtn);
- // Add to overlay
- LK.gui.center.addChild(upgradePopup);
- // Option selection logic
- // Use game.move to detect tap/click on buttons
- var upgradeMoveHandler = function upgradeMoveHandler(x, y, obj) {
- // Convert to GUI coordinates
- var guiX = x,
- guiY = y;
- // Check if inside speedBtn
- var sx = 2048 / 2 - 350,
- sy = 1200;
- if (guiX >= sx - 250 && guiX <= sx + 250 && guiY >= sy - 150 && guiY <= sy + 150) {
- // Attack speed upgrade
- fireballDelay = 8; // allow fireball every 8 ticks (~0.13s)
- LK.gui.center.removeChild(upgradePopup);
- upgradePopup = null;
- // Resume enemy spawn
- enemySpawnTimer = LK.setInterval(function () {
- spawnEnemy();
- }, 1200);
- // Remove handler
- game.move = originalMoveHandler;
- upgradeActive = false;
- return;
- }
- // Check if inside dmgBtn
- var dx = 2048 / 2 + 350,
- dy = 1200;
- if (guiX >= dx - 250 && guiX <= dx + 250 && guiY >= dy - 150 && guiY <= dy + 150) {
- // Damage upgrade
- fireballDamage = 2;
- LK.gui.center.removeChild(upgradePopup);
- upgradePopup = null;
- // Resume enemy spawn
- enemySpawnTimer = LK.setInterval(function () {
- spawnEnemy();
- }, 1200);
- // Remove handler
- game.move = originalMoveHandler;
- upgradeActive = false;
- return;
- }
- };
- // Save original move handler to restore later
- var originalMoveHandler = game.move;
- game.move = upgradeMoveHandler;
- }
break;
}
}
enemy['fb' + k + '_lastIntersecting'] = fbIntersect;
get an enemy in the form of slime. In-Game asset. 2d. High contrast. No shadows
get an enemy in the form of slime. In-Game asset. 2d. High contrast. No shadows
Let there be a mini machine gun and let this gun be pixel shaped. In-Game asset. 2d. High contrast. No shadows
a bullet but yellow and pixel. In-Game asset. 2d. High contrast. No shadows
slime explosion. In-Game asset. 2d. High contrast. No shadows
Change eyes like red
+ gain coin effect. In-Game asset. 2d. High contrast. No shadows
Fast bullet upgrade. In-Game asset. 2d. High contrast. No shadows
Upgrade power bullet. In-Game asset. 2d. High contrast. No shadows
Health + icon pixels. In-Game asset. 2d. High contrast. No shadows
Handgun pixel its look left. In-Game asset. 2d. High contrast. No shadows
işaretli alanı siyaha boya
pixel shuriken but 8 edges. In-Game asset. 2d. High contrast. No shadows
shotgun pixel and look left side. In-Game asset. 2d. High contrast. No shadows
submachine gun look left. In-Game asset. 2d. High contrast. No shadows
mp5 gun pixel. In-Game asset. 2d. High contrast. No shadows
Minigun bullet pixel. In-Game asset. 2d. High contrast. No shadows
Eliptic neon laser bullet. In-Game asset. 2d. High contrast. No shadows. Pixel
slime but have metalic helmet. In-Game asset. 2d. High contrast. No shadows
a slime boss enemy very strict. In-Game asset. 2d. High contrast. No shadows
create mirror view a bit smaller
add a dragon baby on top of gun
a goblin slime which have backpack fully coins. In-Game asset. 2d. High contrast. No shadows
Disappear smoke pixel. In-Game asset. 2d. High contrast. No shadows
Coin pile pixel. In-Game asset. 2d. High contrast. No shadows
fire left to right pixel. In-Game asset. 2d. High contrast. No shadows
Slime enemy healer. In-Game asset. 2d. High contrast. No shadows
Healt restore pixel. In-Game asset. 2d. High contrast. No shadows
Ammo +1 upgrade. In-Game asset. 2d. High contrast. No shadows
Type SLOW bottom of the amblem
Fire ball pixel
boss slime but like fire and dangereous. In-Game asset. 2d. High contrast. No shadows
Add body of this slime