User prompt
ekranda hiçbir yaratık gelmiyoo
User prompt
Please fix the bug: 'TypeError: creature.animate is not a function' in or related to this line: 'creature.animate({' Line Number: 151
User prompt
ekranın sadece sağ tarafından gelsinler ve o yeşil engelleri de ilk engel gibi animasyon ekle
User prompt
gelen engeller ekranın sağ üstünden de uçarak gelebilsi
User prompt
oldu mu sence bu
User prompt
bu oldu mu sence yeşil yaratık demedim bu karşıdan gelen yaratık gibi gelecek yaratıklar aynı görsele sahip şekilde onlar gibi gelsin ama ekranın sağ tarafından üst veya altından ekran sağ tarafından gelicek ama
User prompt
ilerde zıplayan ya da yukardan gelen yaratıklar olsun
Remix started
Copy Mario vs Monsters
/**** * Classes ****/ // Define a class for enemies var Enemy = Container.expand(function () { var self = Container.call(this); var enemyGraphics = self.attachAsset('enemy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; if (self.x < -50) { self.destroy(); } }; }); // Define a class for jumping creatures var JumpingCreature = Container.expand(function () { var self = Container.call(this); var creatureGraphics = self.attachAsset('creature', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += 0.7; if (self.y >= 2732 / 2) { // Ground level self.y = 2732 / 2; self.isJumping = false; self.velocityY = 0; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; }); //<Assets used in the game will automatically appear here> // Define a class for the player character var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.jumpHeight = 40; self.isJumping = false; self.velocityY = 0; self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += 0.7; // Decreased gravity effect by 30% if (self.y >= 2732 / 2) { // Ground level self.y = 2732 / 2; self.isJumping = false; self.velocityY = 0; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = -self.jumpHeight; } }; }); // Define a class for creatures coming from the right side var RightCreature = Container.expand(function () { var self = Container.call(this); var creatureGraphics = self.attachAsset('creature', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.x -= self.speed; if (self.x < 0) { self.destroy(); } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Sky blue background }); /**** * Game Code ****/ var background = game.addChild(LK.getAsset('background', { anchorX: 0, anchorY: 0 })); background.x = 0; background.y = 0; // Initialize player var player = game.addChild(new Player()); player.x = 2048 / 2; player.y = 2732 / 2; // Initialize enemies var enemies = []; var enemySpawnInterval = 100; var enemySpawnCounter = 0; // Create a new Text2 object to display the score var scoreText = new Text2('0', { size: 100, fill: 0xFFFFFF }); // Add the score text to the game GUI at the top center of the screen LK.gui.top.addChild(scoreText); scoreText.x = 2048 / 2; scoreText.y = 0; // Handle game updates game.update = function () { player.update(); // Spawn enemies, jumping and falling creatures enemySpawnCounter++; if (enemySpawnCounter >= enemySpawnInterval) { var enemy = new Enemy(); enemy.x = 2048; enemy.y = 2732 / 2; enemies.push(enemy); game.addChild(enemy); var jumpingCreature = new JumpingCreature(); jumpingCreature.x = Math.random() * 2048; jumpingCreature.y = 2732 / 2; enemies.push(jumpingCreature); game.addChild(jumpingCreature); var rightCreature = new RightCreature(); rightCreature.x = 2048; rightCreature.y = Math.random() * 2732; enemies.push(rightCreature); game.addChild(rightCreature); // Randomize the spawn interval for the next enemy enemySpawnInterval = Math.floor(Math.random() * 150) + 50; enemySpawnCounter = 0; } // Update enemies for (var j = enemies.length - 1; j >= 0; j--) { enemies[j].update(); if (player.intersects(enemies[j])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } else if (player.x > enemies[j].x && !enemies[j].passed) { enemies[j].passed = true; LK.setScore(LK.getScore() + 1); scoreText.setText(LK.getScore()); } } }; // Handle player jump game.down = function (x, y, obj) { player.jump(); };
===================================================================
--- original.js
+++ change.js
@@ -15,23 +15,8 @@
self.destroy();
}
};
});
-// Define a class for creatures coming from above
-var FallingCreature = Container.expand(function () {
- var self = Container.call(this);
- var creatureGraphics = self.attachAsset('creature', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speed = 5;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.destroy();
- }
- };
-});
// Define a class for jumping creatures
var JumpingCreature = Container.expand(function () {
var self = Container.call(this);
var creatureGraphics = self.attachAsset('creature', {
@@ -91,8 +76,23 @@
self.velocityY = -self.jumpHeight;
}
};
});
+// Define a class for creatures coming from the right side
+var RightCreature = Container.expand(function () {
+ var self = Container.call(this);
+ var creatureGraphics = self.attachAsset('creature', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5;
+ self.update = function () {
+ self.x -= self.speed;
+ if (self.x < 0) {
+ self.destroy();
+ }
+ };
+});
/****
* Initialize Game
****/
@@ -141,13 +141,13 @@
jumpingCreature.x = Math.random() * 2048;
jumpingCreature.y = 2732 / 2;
enemies.push(jumpingCreature);
game.addChild(jumpingCreature);
- var fallingCreature = new FallingCreature();
- fallingCreature.x = Math.random() * 2048;
- fallingCreature.y = 0;
- enemies.push(fallingCreature);
- game.addChild(fallingCreature);
+ var rightCreature = new RightCreature();
+ rightCreature.x = 2048;
+ rightCreature.y = Math.random() * 2732;
+ enemies.push(rightCreature);
+ game.addChild(rightCreature);
// Randomize the spawn interval for the next enemy
enemySpawnInterval = Math.floor(Math.random() * 150) + 50;
enemySpawnCounter = 0;
}
uçabilen düşmanlar tatlı düşman. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
yeşil tatlı ok atmaya hazırlıklı okçu karakter. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
partıltılı yumurta. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
2d animation background forest with green and blue. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
altın coin üstünde C yazsın. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
pembe mor ve mavi karışımından oluşanının yap