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 = 10; self.dashDistance = 200; self.dashCooldown = 1000; // 1 second 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; } }; 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; } }; }); // 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 = 5; 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 < 5; 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(); }; // 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(); } } }; // Score display var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Update score function updateScore() { var score = parseInt(scoreTxt.text) + 1; scoreTxt.setText(score); if (score >= 50) { LK.showYouWin(); } } // Increment score every second LK.setInterval(updateScore, 1000);
===================================================================
--- original.js
+++ change.js
@@ -1,97 +1,111 @@
-/****
+/****
* 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 = 10;
- self.dashDistance = 200;
- self.dashCooldown = 1000; // 1 second cooldown
- self.lastDashTime = 0;
- self.update = function () {
- // Update logic for the kitten
- };
- self.dash = function () {
- var currentTime = Date.now();
- if (currentTime - self.lastDashTime >= self.dashCooldown) {
- self.x += self.dashDistance;
- self.lastDashTime = currentTime;
- }
- };
+ var self = Container.call(this);
+ var kittenGraphics = self.attachAsset('kitten', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 10;
+ self.dashDistance = 200;
+ self.dashCooldown = 1000; // 1 second 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;
+ }
+ };
+ 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;
+ }
+ };
});
// 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 = 5;
- self.update = function () {
- self.y += self.speed;
- if (self.y > 2732) {
- self.y = -self.height;
- self.x = Math.random() * 2048;
- }
- };
+ var self = Container.call(this);
+ var obstacleGraphics = self.attachAsset('obstacle', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speed = 5;
+ 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
+ backgroundColor: 0x87CEEB // Light blue background
});
-/****
+/****
* Game Code
-****/
+****/
// Initialize game elements
var kitten = game.addChild(new Kitten());
-kitten.x = 2048 / 2;
+// 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++) {
- var obstacle = new Obstacle();
- obstacle.x = Math.random() * 2048;
- obstacle.y = Math.random() * 2732;
- obstacles.push(obstacle);
- game.addChild(obstacle);
+ 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) {
- kitten.dash();
+ // Dash when the screen is touched
+ kitten.dash();
};
// 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();
- }
- }
+ for (var i = 0; i < obstacles.length; i++) {
+ obstacles[i].update();
+ if (kitten.intersects(obstacles[i])) {
+ LK.effects.flashScreen(0xff0000, 1000);
+ LK.showGameOver();
+ }
+ }
};
// Score display
var scoreTxt = new Text2('0', {
- size: 150,
- fill: 0xFFFFFF
+ size: 150,
+ fill: 0xFFFFFF
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Update score
function updateScore() {
- var score = parseInt(scoreTxt.text) + 1;
- scoreTxt.setText(score);
- if (score >= 50) {
- LK.showYouWin();
- }
+ var score = parseInt(scoreTxt.text) + 1;
+ scoreTxt.setText(score);
+ if (score >= 50) {
+ LK.showYouWin();
+ }
}
// Increment score every second
LK.setInterval(updateScore, 1000);
\ No newline at end of file