User prompt
Make touch cantrol to move left and write
User prompt
Make touch cantrol
User prompt
Make it big game with levels
User prompt
Make it hard tooo
User prompt
Make win screen
User prompt
Make kitten is flying and make touch cantrols
User prompt
Make he is flying plz
User prompt
Make it better
User prompt
Make a kitten
Initial prompt
Kitten force 2 FRVR
/**** * Classes ****/ //<Assets used in the game will automatically appear here> //<Write imports for supported plugins here> // Kitten class representing the player character var Kitten = Container.expand(function () { var self = Container.call(this); var kittenGraphics = self.attachAsset('kitten', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 20; self.dashDistance = 100; self.dashCooldown = 2000; // 2 seconds cooldown self.lastDashTime = 0; self.update = function () { // Move the kitten to the right self.x += self.speed; // If the kitten reaches the right edge of the screen, wrap around to the left if (self.x > 2048) { self.x = 0; } // Make the kitten fly up and down if (self.y > 2732 - 200) { self.speedY = -5; } else if (self.y < 200) { self.speedY = 5; } self.y += self.speedY; // Make the kitten fly self.y -= self.speed; }; self.dash = function () { var currentTime = Date.now(); // Check if the dash is off cooldown if (currentTime - self.lastDashTime >= self.dashCooldown) { // Dash to the right self.x += self.dashDistance; // If the kitten reaches the right edge of the screen, wrap around to the left if (self.x > 2048) { self.x = 0; } // Reset the dash cooldown self.lastDashTime = currentTime; // Update the dash cooldown display dashCooldownTxt.setText(Math.round((self.dashCooldown - (currentTime - self.lastDashTime)) / 1000)); } }; }); // Obstacle class representing obstacles in the game var Obstacle = Container.expand(function () { var self = Container.call(this); var obstacleGraphics = self.attachAsset('obstacle', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 10; self.update = function () { self.y += self.speed; if (self.y > 2732) { self.y = -self.height; self.x = Math.random() * 2048; } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x87CEEB // Light blue background }); /**** * Game Code ****/ // Initialize game elements var kitten = game.addChild(new Kitten()); // Position the kitten at the left edge of the screen kitten.x = 0; kitten.y = 2732 - 200; var obstacles = []; for (var i = 0; i < 10; i++) { var obstacle = new Obstacle(); obstacle.x = Math.random() * 2048; obstacle.y = Math.random() * 2732; obstacles.push(obstacle); game.addChild(obstacle); } // Handle touch events for dashing game.down = function (x, y, obj) { // Dash when the screen is touched kitten.dash(); // Make the kitten fly when the screen is touched kitten.y -= kitten.speed; }; // Update game logic game.update = function () { for (var i = 0; i < obstacles.length; i++) { obstacles[i].update(); if (kitten.intersects(obstacles[i])) { LK.effects.flashScreen(0xff0000, 1000); LK.showGameOver(); } } // Update the dash cooldown display var currentTime = Date.now(); dashCooldownTxt.setText(Math.round((kitten.dashCooldown - (currentTime - kitten.lastDashTime)) / 1000)); }; // Score display var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Dash cooldown display var dashCooldownTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); dashCooldownTxt.anchor.set(0.5, 0); LK.gui.top.addChild(dashCooldownTxt); // Update score function updateScore() { var score = parseInt(scoreTxt.text) + 1; scoreTxt.setText(score); if (score >= 50) { LK.showYouWin(); var winScreen = new Text2('You Win!', { size: 200, fill: 0xFFFFFF }); winScreen.anchor.set(0.5, 0.5); winScreen.x = 2048 / 2; winScreen.y = 2732 / 2; LK.gui.center.addChild(winScreen); } } // Increment score every second LK.setInterval(updateScore, 1000);
===================================================================
--- original.js
+++ change.js
@@ -9,11 +9,11 @@
var kittenGraphics = self.attachAsset('kitten', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 10;
- self.dashDistance = 200;
- self.dashCooldown = 1000; // 1 second cooldown
+ self.speed = 20;
+ self.dashDistance = 100;
+ self.dashCooldown = 2000; // 2 seconds cooldown
self.lastDashTime = 0;
self.update = function () {
// Move the kitten to the right
self.x += self.speed;
@@ -54,9 +54,9 @@
var obstacleGraphics = self.attachAsset('obstacle', {
anchorX: 0.5,
anchorY: 0.5
});
- self.speed = 5;
+ self.speed = 10;
self.update = function () {
self.y += self.speed;
if (self.y > 2732) {
self.y = -self.height;
@@ -80,9 +80,9 @@
// Position the kitten at the left edge of the screen
kitten.x = 0;
kitten.y = 2732 - 200;
var obstacles = [];
-for (var i = 0; i < 5; i++) {
+for (var i = 0; i < 10; i++) {
var obstacle = new Obstacle();
obstacle.x = Math.random() * 2048;
obstacle.y = Math.random() * 2732;
obstacles.push(obstacle);