User prompt
kasırga sadece sağa sola yukarı aşağı gitsin. Kendi etrafında dönmesin. Zeus paketi 25 saniyede bir gelsin
User prompt
kasırga sadece x ekseninde dönsün. y ekseninde yukarı aşağı hareket etsin
User prompt
zeus paketi 60 saniyede bir gelsin, böyle çok kolay oldu
User prompt
zeus paketleri 15 saniyede bir gelsin, paketi atan helikopter daha sonra yok olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
oyunda bazen helikopterden zeus yardım paketi atılsın. bu paket zemine düştükten sonra dokunduğumuzda, düşmanlarımız bir yıldırım efektiyle yok olsun. 10 saniye boyunca yeni düşman gelmesin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
güneş doğduğunda hava aydınlık olsun battığında karanlık olsun yani güneşide görelim. her iki yıldırımdan biri canavarımızın üstüne düşsün ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Canavarımızın canı 50 ye düşerse bulutlardan bir helikopter aşağıya sağlık kutusu atsın. Bu sağlık kutusu zemine düşsün. Canavarımız buna dokunursa sağlığı 100 artsın. 10 saniye sora kutu kaybolsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
kasırga yerden bulutlara, bulutlardan tekrar yere doğru ilerlesin ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
arada bir ekranın köşesinde bulunan volkan patlasın ve lavlar zemine dökülsün. Bazende kasırga olsun, kasırga bazı binalara değsin ve değdiği binalar bir seviye küçülsün ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
bazen gök gürültüsü ile yıldırım düşsün eğer binalara düşerse binalar patlamayla yıkılsın, eğer canavarın üstüne düşerse canavar ossursun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
canavarımız eğer son canavara saldırırken üstüne basarsa hasar almasın. binalarında üstüne bastığımızda hasar almayalım. havada kuşlar uçsun, bulutlar gelip gitsin, hava kararıp aydınlansın. Bazen yağmur bazen kar yağsın ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'addEventListener')' in or related to this line: 'game.addChild(building);' Line Number: 345
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'ArrowLeft')' in or related to this line: 'if (LK.keys.ArrowLeft) {' Line Number: 397
User prompt
tekrar denermisin, yapamadığın bir şey olursa diğer yapabildiklerin kalsın, iptal etme
User prompt
klavye tuşlarıyla hareket ettiremiyorum, lütfen problemi çöz. Binalardan gelen nesneleri biraz azaltırmısın. Benim canımıda biraz artırmanı istiyorum. mızrak ayağıma geldiğinde hafif bir bağırma, top ayağıma geldiğinde patlama efekti ve biraz daha güçlü bir kükreme, roket geldiğinde dinozor yüksek sesle küresin ve büyük bir patlama efekti olsun ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
en büyük binadan sadece roket atılsın, ortanca olan osmanlı binasından sadece canonball atılsın, mağaradan sadece mızrak atılsın. bizim canavarımızı sağ ve sol ok tuşlarıyla hareket ettirelim. space tuşuylada zıplasın. Ayrıca atılan nesneler gelen binadan bizim canavarımıza doğru olacak şekilde döndürülsün
User prompt
human oyunda olmasın. Onun yerine binalardan bize fırlatılan 3 farklı nesne olsun. Teknolojik binadan roket fırlatılsın. Osmanlı evinden top mermisi fırlatılsın. Mağaradan ok fırlatılsın
User prompt
tamam 3 boyut olmasın. binalar 3 farklı yükseklikte olsun ve zeminde olsunlar. Zıplama tuşuna bastığım zaman, ne kadar basılı tuttuğuma göre(maksimum 1 saniye) en yüksek binadan daha yükseğe kadar sıçrayabileyim. üstlerine bastığım bina 1 seviye küçülsün. En küçük seviyedeki bina yok olsun.
Code edit (1 edits merged)
Please save this source code
User prompt
Monster Rampage
Initial prompt
küçükken kardeşimle oynadığım bir oyun vardı. İkimiz godzilla tarzı büyük yaratıklar seçiyorduk. Yerden yükselen binalar vardı. Üstlerinde zıpladıkça binalar küçülüyor, sonra yok oluyorlardı. Binadan bize saldıran insanlar vardı. Bir kaç bina yok ettikten sonra bölüm sonu canavarıyla dövüşüyorduk.
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
var Bird = Container.expand(function () {
var self = Container.call(this);
var birdGraphics = self.attachAsset('bird', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = Math.random() * 2 + 1;
self.direction = Math.random() > 0.5 ? 1 : -1;
self.flapTimer = 0;
self.update = function () {
self.x += self.speed * self.direction;
// Flap animation
self.flapTimer++;
if (self.flapTimer < 15) {
birdGraphics.scaleY = 0.8;
} else if (self.flapTimer < 30) {
birdGraphics.scaleY = 1.2;
} else {
self.flapTimer = 0;
}
// Remove if off screen
if (self.x < -50 || self.x > 2098) {
self.destroy();
birds.splice(birds.indexOf(self), 1);
}
};
return self;
});
var Boss = Container.expand(function () {
var self = Container.call(this);
var bossGraphics = self.attachAsset('boss', {
anchorX: 0.5,
anchorY: 1.0
});
self.health = 300;
self.maxHealth = 300;
self.speed = 1.5;
self.attackDamage = 20;
self.attackCooldown = 0;
self.maxAttackCooldown = 120;
self.direction = 1;
self.lastIntersecting = false;
self.update = function () {
// Move back and forth
self.x += self.speed * self.direction;
if (self.x <= 200 || self.x >= 1848) {
self.direction *= -1;
}
// Attack monster
if (self.attackCooldown > 0) {
self.attackCooldown--;
}
var currentIntersecting = self.intersects(monster);
if (currentIntersecting && self.attackCooldown <= 0) {
monster.takeDamage(self.attackDamage);
LK.getSound('attack').play();
self.attackCooldown = self.maxAttackCooldown;
}
// Check if monster jumps on boss - monster takes no damage when landing on boss
if (!self.lastIntersecting && currentIntersecting && monster.velocityY > 0) {
self.takeDamage(50);
// Monster doesn't take damage when landing on boss
}
self.lastIntersecting = currentIntersecting;
};
self.takeDamage = function (damage) {
self.health -= damage;
LK.getSound('boss_hit').play();
LK.effects.flashObject(self, 0xff0000, 300);
if (self.health <= 0) {
LK.setScore(LK.getScore() + 1000);
self.destroy();
boss = null;
level++;
startLevel();
}
};
return self;
});
var Building = Container.expand(function () {
var self = Container.call(this);
self.heightLevel = Math.floor(Math.random() * 3) + 1; // 1, 2, or 3
self.assetNames = ['building_small', 'building_medium', 'building_large'];
self.buildingHeights = [80, 160, 240];
self.buildingType = Math.floor(Math.random() * 3); // 0=tech, 1=ottoman, 2=cave
self.buildingTypes = ['tech', 'ottoman', 'cave'];
self.projectileTypes = ['rocket', 'cannonball', 'arrow'];
self.attackCooldown = 0;
self.maxAttackCooldown = 450; // 7.5 seconds at 60fps
var buildingGraphics = self.attachAsset(self.assetNames[self.heightLevel - 1], {
anchorX: 0.5,
anchorY: 1.0
});
self.lastIntersecting = false;
self.update = function () {
// Check collision with monster
var currentIntersecting = self.intersects(monster);
if (!self.lastIntersecting && currentIntersecting && monster.velocityY > 0) {
self.stomp();
}
self.lastIntersecting = currentIntersecting;
// Attack monster with projectiles
if (self.attackCooldown > 0) {
self.attackCooldown--;
}
if (self.attackCooldown <= 0) {
self.fireProjectile();
self.attackCooldown = self.maxAttackCooldown;
}
};
self.stomp = function () {
LK.getSound('stomp').play();
LK.setScore(LK.getScore() + 10);
// Monster doesn't take damage when stomping on buildings
// Shrink building by one level
self.heightLevel--;
if (self.heightLevel <= 0) {
// Building destroyed
self.destroy();
buildings.splice(buildings.indexOf(self), 1);
buildingsDestroyed++;
} else {
// Replace with smaller building
self.removeChild(buildingGraphics);
buildingGraphics = self.attachAsset(self.assetNames[self.heightLevel - 1], {
anchorX: 0.5,
anchorY: 1.0
});
}
};
self.fireProjectile = function () {
var projectile = new Projectile();
// Fire projectile based on building height level: 3=rocket, 2=cannonball, 1=arrow
if (self.heightLevel === 3) {
projectile.type = 'rocket';
} else if (self.heightLevel === 2) {
projectile.type = 'cannonball';
} else {
projectile.type = 'arrow';
}
var projectileGraphics = projectile.attachAsset(projectile.type, {
anchorX: 0.5,
anchorY: 0.5
});
projectile.x = self.x;
projectile.y = self.y - self.buildingHeights[self.heightLevel - 1] / 2;
// Calculate direction to monster
var dx = monster.x - projectile.x;
var dy = monster.y - projectile.y;
var distance = Math.sqrt(dx * dx + dy * dy);
projectile.velocityX = dx / distance * projectile.speed;
projectile.velocityY = dy / distance * projectile.speed;
// Rotate projectile to face monster
projectileGraphics.rotation = Math.atan2(dy, dx);
projectiles.push(projectile);
game.addChild(projectile);
};
return self;
});
var Cloud = Container.expand(function () {
var self = Container.call(this);
var cloudGraphics = self.attachAsset('cloud', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = Math.random() * 0.5 + 0.2;
self.alpha = Math.random() * 0.4 + 0.6;
cloudGraphics.alpha = self.alpha;
self.update = function () {
self.x += self.speed;
// Remove if off screen
if (self.x > 2098 + 150) {
self.destroy();
clouds.splice(clouds.indexOf(self), 1);
}
};
return self;
});
var Monster = Container.expand(function () {
var self = Container.call(this);
var monsterGraphics = self.attachAsset('monster', {
anchorX: 0.5,
anchorY: 1.0
});
self.velocityY = 0;
self.isJumping = false;
self.minJumpPower = -15;
self.maxJumpPower = -35; // Higher than tallest building (240px)
self.gravity = 1.2;
self.groundY = 2500;
self.speed = 8;
self.health = 300;
self.maxHealth = 300;
self.isCharging = false;
self.chargeStartTime = 0;
self.maxChargeTime = 60; // 1 second at 60fps
self.update = function () {
// Apply gravity
self.velocityY += self.gravity;
self.y += self.velocityY;
// Ground collision
if (self.y >= self.groundY) {
self.y = self.groundY;
self.velocityY = 0;
self.isJumping = false;
}
// Keep monster on screen
if (self.x < 90) self.x = 90;
if (self.x > 1958) self.x = 1958;
};
self.startCharging = function () {
if (!self.isJumping && !self.isCharging) {
self.isCharging = true;
self.chargeStartTime = LK.ticks;
}
};
self.jump = function () {
if (self.isCharging) {
var chargeTime = Math.min(LK.ticks - self.chargeStartTime, self.maxChargeTime);
var chargeRatio = chargeTime / self.maxChargeTime;
var jumpPower = self.minJumpPower + (self.maxJumpPower - self.minJumpPower) * chargeRatio;
self.velocityY = jumpPower;
self.isJumping = true;
self.isCharging = false;
}
};
self.takeDamage = function (damage, projectileType) {
self.health -= damage;
if (self.health <= 0) {
self.health = 0;
LK.showGameOver();
}
// Flash red when taking damage
LK.effects.flashObject(self, 0xff0000, 500);
// Different effects based on projectile type
if (projectileType === 'arrow') {
// Light scream for arrow
LK.getSound('attack').play();
} else if (projectileType === 'cannonball') {
// Explosion effect and stronger roar for cannonball
LK.effects.flashScreen(0xff4400, 300);
tween(self, {
scaleX: 1.2,
scaleY: 1.2
}, {
duration: 200,
onFinish: function onFinish() {
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 200
});
}
});
LK.getSound('boss_hit').play();
} else if (projectileType === 'rocket') {
// Dinosaur roars loudly and big explosion for rocket
LK.effects.flashScreen(0xff0000, 500);
tween(self, {
scaleX: 1.5,
scaleY: 1.5
}, {
duration: 300,
onFinish: function onFinish() {
tween(self, {
scaleX: 1,
scaleY: 1
}, {
duration: 300
});
}
});
LK.getSound('stomp').play();
}
};
return self;
});
var Projectile = Container.expand(function () {
var self = Container.call(this);
self.type = 'rocket'; // 'rocket', 'cannonball', 'arrow'
self.speed = 5;
self.damage = 10;
self.lastIntersecting = false;
self.velocityX = 0;
self.velocityY = 0;
self.update = function () {
// Move projectile
self.x += self.velocityX;
self.y += self.velocityY;
// Check collision with monster
var currentIntersecting = self.intersects(monster);
if (!self.lastIntersecting && currentIntersecting) {
monster.takeDamage(self.damage, self.type);
self.destroy();
projectiles.splice(projectiles.indexOf(self), 1);
}
self.lastIntersecting = currentIntersecting;
// Remove if off screen
if (self.x < -50 || self.x > 2098 || self.y < -50 || self.y > 2782) {
self.destroy();
projectiles.splice(projectiles.indexOf(self), 1);
}
};
return self;
});
var WeatherParticle = Container.expand(function () {
var self = Container.call(this);
self.type = 'rain'; // 'rain' or 'snow'
self.speed = 0;
self.particleGraphics = null;
self.init = function (type) {
self.type = type;
if (type === 'rain') {
self.particleGraphics = self.attachAsset('rainDrop', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = Math.random() * 8 + 12;
} else {
self.particleGraphics = self.attachAsset('snowFlake', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = Math.random() * 3 + 2;
}
};
self.update = function () {
self.y += self.speed;
if (self.type === 'snow') {
self.x += Math.sin(self.y * 0.01) * 0.5;
}
// Remove if off screen
if (self.y > 2782) {
self.destroy();
weatherParticles.splice(weatherParticles.indexOf(self), 1);
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x87ceeb
});
/****
* Game Code
****/
var monster;
var buildings = [];
var projectiles = [];
var boss = null;
var buildingsDestroyed = 0;
var level = 1;
var spawnTimer = 0;
var maxSpawnTimer = 180;
var birds = [];
var clouds = [];
var weatherParticles = [];
var skyBrightness = 1.0;
var skyDirection = -1;
var weatherType = 'none'; // 'none', 'rain', 'snow'
var weatherTimer = 0;
var weatherDuration = 0;
var birdSpawnTimer = 0;
var cloudSpawnTimer = 0;
// Create ground
var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0.5,
anchorY: 1.0,
x: 1024,
y: 2600
}));
// Create monster
monster = game.addChild(new Monster());
monster.x = 1024;
monster.y = 2500;
// Create score display
var scoreTxt = new Text2('Score: 0', {
size: 80,
fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Create health display
var healthTxt = new Text2('Health: 300', {
size: 60,
fill: 0xFF0000
});
healthTxt.anchor.set(0, 0);
healthTxt.x = 120;
healthTxt.y = 120;
LK.gui.topLeft.addChild(healthTxt);
// Create level display
var levelTxt = new Text2('Level: 1', {
size: 60,
fill: 0xFFFFFF
});
levelTxt.anchor.set(1, 0);
LK.gui.topRight.addChild(levelTxt);
function spawnBuilding() {
var building = new Building();
var spawnX = Math.random() * 1800 + 124;
building.x = spawnX;
building.y = 2500;
buildings.push(building);
game.addChild(building);
}
function spawnBoss() {
boss = new Boss();
boss.x = 1024;
boss.y = 2500;
game.addChild(boss);
}
function spawnBird() {
var bird = new Bird();
bird.x = bird.direction > 0 ? -50 : 2098;
bird.y = Math.random() * 800 + 200;
birds.push(bird);
game.addChild(bird);
}
function spawnCloud() {
var cloud = new Cloud();
cloud.x = -150;
cloud.y = Math.random() * 600 + 100;
clouds.push(cloud);
game.addChild(cloud);
}
function spawnWeatherParticle() {
if (weatherType !== 'none') {
var particle = new WeatherParticle();
particle.init(weatherType);
particle.x = Math.random() * 2048;
particle.y = -20;
weatherParticles.push(particle);
game.addChild(particle);
}
}
function updateSky() {
skyBrightness += skyDirection * 0.002;
if (skyBrightness <= 0.3) {
skyBrightness = 0.3;
skyDirection = 1;
} else if (skyBrightness >= 1.0) {
skyBrightness = 1.0;
skyDirection = -1;
}
var skyColor = Math.floor(135 * skyBrightness) << 16 | Math.floor(206 * skyBrightness) << 8 | Math.floor(235 * skyBrightness);
game.setBackgroundColor(skyColor);
}
function updateWeather() {
weatherTimer++;
if (weatherTimer >= weatherDuration) {
// Change weather
var weatherTypes = ['none', 'rain', 'snow'];
weatherType = weatherTypes[Math.floor(Math.random() * 3)];
weatherTimer = 0;
weatherDuration = Math.random() * 1800 + 600; // 10-40 seconds
}
}
function startLevel() {
buildingsDestroyed = 0;
levelTxt.setText('Level: ' + level);
// Clear existing entities
for (var i = buildings.length - 1; i >= 0; i--) {
buildings[i].destroy();
}
buildings = [];
for (var j = projectiles.length - 1; j >= 0; j--) {
projectiles[j].destroy();
}
projectiles = [];
if (boss) {
boss.destroy();
boss = null;
}
// Spawn initial buildings
for (var k = 0; k < 3; k++) {
LK.setTimeout(function () {
spawnBuilding();
}, k * 1000);
}
}
// Start first level
startLevel();
// Game controls
game.down = function (x, y, obj) {
monster.startCharging();
};
game.up = function (x, y, obj) {
monster.jump();
};
game.move = function (x, y, obj) {
// Move monster towards touch position
if (x < monster.x) {
monster.x -= monster.speed;
} else if (x > monster.x) {
monster.x += monster.speed;
}
};
// Keyboard state tracking
var keys = {
ArrowLeft: false,
ArrowRight: false,
Space: false
};
// Main game loop
game.update = function () {
// Handle keyboard input (fallback to touch controls for mobile)
// Note: Keyboard controls are not available in LK sandbox, using touch controls instead
// Update score display
scoreTxt.setText('Score: ' + LK.getScore());
// Update health display
healthTxt.setText('Health: ' + monster.health);
// Update sky brightness
updateSky();
// Update weather
updateWeather();
// Spawn birds periodically
birdSpawnTimer++;
if (birdSpawnTimer >= 240) {
// Every 4 seconds
spawnBird();
birdSpawnTimer = 0;
}
// Spawn clouds periodically
cloudSpawnTimer++;
if (cloudSpawnTimer >= 300) {
// Every 5 seconds
spawnCloud();
cloudSpawnTimer = 0;
}
// Spawn weather particles
if (weatherType !== 'none' && Math.random() < 0.3) {
spawnWeatherParticle();
}
// Spawn new buildings periodically
if (!boss && buildings.length < 5) {
spawnTimer++;
if (spawnTimer >= maxSpawnTimer) {
spawnBuilding();
spawnTimer = 0;
}
}
// Check for boss spawn condition
if (!boss && buildingsDestroyed >= 5 + level * 2) {
spawnBoss();
}
// Remove destroyed projectiles
for (var i = projectiles.length - 1; i >= 0; i--) {
if (!projectiles[i].parent) {
projectiles.splice(i, 1);
}
}
// Remove destroyed buildings
for (var j = buildings.length - 1; j >= 0; j--) {
if (!buildings[j].parent) {
buildings.splice(j, 1);
}
}
// Remove destroyed birds
for (var k = birds.length - 1; k >= 0; k--) {
if (!birds[k].parent) {
birds.splice(k, 1);
}
}
// Remove destroyed clouds
for (var l = clouds.length - 1; l >= 0; l--) {
if (!clouds[l].parent) {
clouds.splice(l, 1);
}
}
// Remove destroyed weather particles
for (var m = weatherParticles.length - 1; m >= 0; m--) {
if (!weatherParticles[m].parent) {
weatherParticles.splice(m, 1);
}
}
}; ===================================================================
--- original.js
+++ change.js
@@ -5,8 +5,36 @@
/****
* Classes
****/
+var Bird = Container.expand(function () {
+ var self = Container.call(this);
+ var birdGraphics = self.attachAsset('bird', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = Math.random() * 2 + 1;
+ self.direction = Math.random() > 0.5 ? 1 : -1;
+ self.flapTimer = 0;
+ self.update = function () {
+ self.x += self.speed * self.direction;
+ // Flap animation
+ self.flapTimer++;
+ if (self.flapTimer < 15) {
+ birdGraphics.scaleY = 0.8;
+ } else if (self.flapTimer < 30) {
+ birdGraphics.scaleY = 1.2;
+ } else {
+ self.flapTimer = 0;
+ }
+ // Remove if off screen
+ if (self.x < -50 || self.x > 2098) {
+ self.destroy();
+ birds.splice(birds.indexOf(self), 1);
+ }
+ };
+ return self;
+});
var Boss = Container.expand(function () {
var self = Container.call(this);
var bossGraphics = self.attachAsset('boss', {
anchorX: 0.5,
@@ -35,11 +63,12 @@
monster.takeDamage(self.attackDamage);
LK.getSound('attack').play();
self.attackCooldown = self.maxAttackCooldown;
}
- // Check if monster jumps on boss
+ // Check if monster jumps on boss - monster takes no damage when landing on boss
if (!self.lastIntersecting && currentIntersecting && monster.velocityY > 0) {
self.takeDamage(50);
+ // Monster doesn't take damage when landing on boss
}
self.lastIntersecting = currentIntersecting;
};
self.takeDamage = function (damage) {
@@ -89,8 +118,9 @@
};
self.stomp = function () {
LK.getSound('stomp').play();
LK.setScore(LK.getScore() + 10);
+ // Monster doesn't take damage when stomping on buildings
// Shrink building by one level
self.heightLevel--;
if (self.heightLevel <= 0) {
// Building destroyed
@@ -134,8 +164,27 @@
game.addChild(projectile);
};
return self;
});
+var Cloud = Container.expand(function () {
+ var self = Container.call(this);
+ var cloudGraphics = self.attachAsset('cloud', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = Math.random() * 0.5 + 0.2;
+ self.alpha = Math.random() * 0.4 + 0.6;
+ cloudGraphics.alpha = self.alpha;
+ self.update = function () {
+ self.x += self.speed;
+ // Remove if off screen
+ if (self.x > 2098 + 150) {
+ self.destroy();
+ clouds.splice(clouds.indexOf(self), 1);
+ }
+ };
+ return self;
+});
var Monster = Container.expand(function () {
var self = Container.call(this);
var monsterGraphics = self.attachAsset('monster', {
anchorX: 0.5,
@@ -262,8 +311,42 @@
}
};
return self;
});
+var WeatherParticle = Container.expand(function () {
+ var self = Container.call(this);
+ self.type = 'rain'; // 'rain' or 'snow'
+ self.speed = 0;
+ self.particleGraphics = null;
+ self.init = function (type) {
+ self.type = type;
+ if (type === 'rain') {
+ self.particleGraphics = self.attachAsset('rainDrop', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = Math.random() * 8 + 12;
+ } else {
+ self.particleGraphics = self.attachAsset('snowFlake', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = Math.random() * 3 + 2;
+ }
+ };
+ self.update = function () {
+ self.y += self.speed;
+ if (self.type === 'snow') {
+ self.x += Math.sin(self.y * 0.01) * 0.5;
+ }
+ // Remove if off screen
+ if (self.y > 2782) {
+ self.destroy();
+ weatherParticles.splice(weatherParticles.indexOf(self), 1);
+ }
+ };
+ return self;
+});
/****
* Initialize Game
****/
@@ -281,8 +364,18 @@
var buildingsDestroyed = 0;
var level = 1;
var spawnTimer = 0;
var maxSpawnTimer = 180;
+var birds = [];
+var clouds = [];
+var weatherParticles = [];
+var skyBrightness = 1.0;
+var skyDirection = -1;
+var weatherType = 'none'; // 'none', 'rain', 'snow'
+var weatherTimer = 0;
+var weatherDuration = 0;
+var birdSpawnTimer = 0;
+var cloudSpawnTimer = 0;
// Create ground
var ground = game.addChild(LK.getAsset('ground', {
anchorX: 0.5,
anchorY: 1.0,
@@ -329,8 +422,54 @@
boss.x = 1024;
boss.y = 2500;
game.addChild(boss);
}
+function spawnBird() {
+ var bird = new Bird();
+ bird.x = bird.direction > 0 ? -50 : 2098;
+ bird.y = Math.random() * 800 + 200;
+ birds.push(bird);
+ game.addChild(bird);
+}
+function spawnCloud() {
+ var cloud = new Cloud();
+ cloud.x = -150;
+ cloud.y = Math.random() * 600 + 100;
+ clouds.push(cloud);
+ game.addChild(cloud);
+}
+function spawnWeatherParticle() {
+ if (weatherType !== 'none') {
+ var particle = new WeatherParticle();
+ particle.init(weatherType);
+ particle.x = Math.random() * 2048;
+ particle.y = -20;
+ weatherParticles.push(particle);
+ game.addChild(particle);
+ }
+}
+function updateSky() {
+ skyBrightness += skyDirection * 0.002;
+ if (skyBrightness <= 0.3) {
+ skyBrightness = 0.3;
+ skyDirection = 1;
+ } else if (skyBrightness >= 1.0) {
+ skyBrightness = 1.0;
+ skyDirection = -1;
+ }
+ var skyColor = Math.floor(135 * skyBrightness) << 16 | Math.floor(206 * skyBrightness) << 8 | Math.floor(235 * skyBrightness);
+ game.setBackgroundColor(skyColor);
+}
+function updateWeather() {
+ weatherTimer++;
+ if (weatherTimer >= weatherDuration) {
+ // Change weather
+ var weatherTypes = ['none', 'rain', 'snow'];
+ weatherType = weatherTypes[Math.floor(Math.random() * 3)];
+ weatherTimer = 0;
+ weatherDuration = Math.random() * 1800 + 600; // 10-40 seconds
+ }
+}
function startLevel() {
buildingsDestroyed = 0;
levelTxt.setText('Level: ' + level);
// Clear existing entities
@@ -383,8 +522,30 @@
// Update score display
scoreTxt.setText('Score: ' + LK.getScore());
// Update health display
healthTxt.setText('Health: ' + monster.health);
+ // Update sky brightness
+ updateSky();
+ // Update weather
+ updateWeather();
+ // Spawn birds periodically
+ birdSpawnTimer++;
+ if (birdSpawnTimer >= 240) {
+ // Every 4 seconds
+ spawnBird();
+ birdSpawnTimer = 0;
+ }
+ // Spawn clouds periodically
+ cloudSpawnTimer++;
+ if (cloudSpawnTimer >= 300) {
+ // Every 5 seconds
+ spawnCloud();
+ cloudSpawnTimer = 0;
+ }
+ // Spawn weather particles
+ if (weatherType !== 'none' && Math.random() < 0.3) {
+ spawnWeatherParticle();
+ }
// Spawn new buildings periodically
if (!boss && buildings.length < 5) {
spawnTimer++;
if (spawnTimer >= maxSpawnTimer) {
@@ -407,5 +568,23 @@
if (!buildings[j].parent) {
buildings.splice(j, 1);
}
}
+ // Remove destroyed birds
+ for (var k = birds.length - 1; k >= 0; k--) {
+ if (!birds[k].parent) {
+ birds.splice(k, 1);
+ }
+ }
+ // Remove destroyed clouds
+ for (var l = clouds.length - 1; l >= 0; l--) {
+ if (!clouds[l].parent) {
+ clouds.splice(l, 1);
+ }
+ }
+ // Remove destroyed weather particles
+ for (var m = weatherParticles.length - 1; m >= 0; m--) {
+ if (!weatherParticles[m].parent) {
+ weatherParticles.splice(m, 1);
+ }
+ }
};
\ No newline at end of file
Spinosaurus, yeşil, ağzı açık. In-Game asset. 2d. High contrast. No shadows
büyük modern bir bina, bazı camlarında silahlı insanlar var, çatısında roket atar var.. In-Game asset. 2d. High contrast. No shadows
ilk insanların içinde yaşadığı bir mağara. kapısında elinde mızrak olan ilkel bir insan var. In-Game asset. 2d. High contrast. No shadows
tripleks bir osmanlı evi çiz. Çatısında top mermisi ateşlemek üzere olan bir yeniçeri askeri olsun. In-Game asset. 2d. High contrast. No shadows
mavi bir Argentinosaurus, ağzında biraz kan ve yüzünde çizikler var. In-Game asset. 2d. High contrast. No shadows
yatayda hareket eden bir Agni-V füzesi çiz In-Game asset. 2d. High contrast. No shadows
sivri uçlu, hafif yıpranmış bir mızrak, yatayda hareket ederken çiz In-Game asset. 2d. High contrast. No shadows
en büyük aktif volkanı çiz. In-Game asset. 2d. High contrast. No shadows
skorski helikopteri çiz. In-Game asset. 2d. High contrast. No shadows
pubg gibi oyunlarda olan gökyüzünden düşen sağlık paketi çiz. In-Game asset. 2d. High contrast. No shadows
kasırga partikülleri çizmeni istiyorum. In-Game asset. 2d. High contrast. No shadows
güçlü bir yıldırım tanrısı olan zeus çiz. In-Game asset. 2d. High contrast. No shadows
yıldırım ışığı çiz. In-Game asset. 2d. High contrast. No shadows
hafifi kızarmış bir dolunay çiz. In-Game asset. 2d. High contrast. No shadows
dağınık bulut çiz. In-Game asset. 2d. High contrast. No shadows