User prompt
Karelerin hızını ve sayısını arttır
User prompt
sadece yanlara kaydırabilelim
User prompt
kendi kendine ateş etmesin biz dokununca etsin
User prompt
birazcık daha üste başlasın
User prompt
top aşağıdan başlasın
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'down')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 133
User prompt
oyunu yeniden başlat
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'down')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 125
User prompt
Top karelere canvar göndersin
User prompt
Sadece topun üzerine tıklandığında ateş etsin
User prompt
Karelerin geliş hızını azalt
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'down')' in or related to this line: 'self.down = function (x, y, obj) {' Line Number: 132
User prompt
Sadece topun üstüne tıklandığında canavar at
User prompt
topun canavar atma sayısını azaltır mısın
User prompt
Topun canvar atma hızını arttırır mısın
User prompt
Topun attığı canavar sayısını azaltır mısın
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading '__colorFlash_current_tick')' in or related to this line: 'LK.effects.flashObject(smallBalls[i], 0xff0000, 1000); // Add explosion effect' Line Number: 122
User prompt
Yukarıdan gelen kareleri canavarlar dokununca patlatsın lütfen
User prompt
kareler geri gesin
User prompt
kırmızı kareler yeşil kareye çarparsa patlar
User prompt
kareler geri gelsin renkleri değişik
User prompt
top kareye değerse oyun kazanılsın
User prompt
karler geri gelsin
User prompt
karelere ateş değerse kareler patlasın
User prompt
yuvalağa basınca ateş etsin
/**** * Classes ****/ var Bullet = Container.expand(function () { var self = Container.call(this); var bulletGraphics = self.attachAsset('bullet', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -5; self.update = function () { self.y += self.speed; }; }); //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Class for the shooting ball var ShootingBall = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('shootingBall', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () {}; self.down = function (x, y, obj) { var bullet = new Bullet(); bullet.x = self.x; bullet.y = self.y; bullets.push(bullet); game.addChild(bullet); }; }); // Class for the small balls var SmallBall = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('smallBall', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.y = 0; // Reset position if it goes off screen } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ var shootingBall = game.addChild(new ShootingBall()); shootingBall.x = 2048 / 2; shootingBall.y = 2732 - 200; var smallBalls = []; for (var i = 0; i < 5; i++) { var smallBall = new SmallBall(); smallBall.x = Math.random() * 2048; smallBall.y = Math.random() * 2732; smallBalls.push(smallBall); game.addChild(smallBall); } var dragNode = null; //Declare method for handling move events on game. function handleMove(x, y, obj) { //Get event position in relation to game object if (dragNode) { dragNode.x = x; } } //Mouse or touch move on game object. LK returns complex event objects. Please be aware of this. game.move = handleMove; //Allow dragging of the shootingBall to start from anywhere. game.down = function (x, y, obj) { //Set drag node to shootingBall. dragNode = shootingBall; //Also call move handler right away to make effect instant. handleMove(x, obj.global.y, obj); }; //Mouse or touch up on game object game.up = function (x, y, obj) { dragNode = null; }; var bullets = []; game.update = function () { for (var i = smallBalls.length - 1; i >= 0; i--) { if (shootingBall.intersects(smallBalls[i])) { LK.effects.flashObject(smallBalls[i], 0xff0000, 1000); // Add explosion effect smallBalls[i].destroy(); smallBalls.splice(i, 1); break; } for (var j = bullets.length - 1; j >= 0; j--) { if (bullets[j].intersects(smallBalls[i])) { LK.effects.flashObject(smallBalls[i], 0xff0000, 1000); // Add explosion effect smallBalls[i].destroy(); smallBalls.splice(i, 1); bullets[j].destroy(); bullets.splice(j, 1); break; } } } for (var i = smallBalls.length; i < 10; i++) { // Re-spawn small ball var smallBall = new SmallBall(); smallBall.x = Math.random() * 2048; smallBall.y = Math.random() * 2732; smallBalls.push(smallBall); game.addChild(smallBall); // Change the color of the small ball smallBall.tint = Math.random() * 0xFFFFFF; } }; // This code block has been moved inside the 'ShootingBall' class.
===================================================================
--- original.js
+++ change.js
@@ -36,9 +36,9 @@
var ballGraphics = self.attachAsset('smallBall', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 3;
+ self.speed = 5;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = 0; // Reset position if it goes off screen
@@ -107,9 +107,9 @@
break;
}
}
}
- for (var i = smallBalls.length; i < 5; i++) {
+ for (var i = smallBalls.length; i < 10; i++) {
// Re-spawn small ball
var smallBall = new SmallBall();
smallBall.x = Math.random() * 2048;
smallBall.y = Math.random() * 2732;