User prompt
Oyun skorları olsun üste
User prompt
1 canavar geçince yukarıda skor yazsın mesela 5 canavar geçtim orda yukarda 5 yazmalı
User prompt
Her canavarı geçtinde final skor 1 yazılsın mesela 10 canavar geçtim 10 skor aldım gibi
Code edit (1 edits merged)
Please save this source code
User prompt
Gökten platforma tas düssün
User prompt
Yukardan platforma taş düşsün karekterde üstünden atlıyabilsin
User prompt
Sağ üste kaç canavarı geçtiği yazsın
User prompt
Platformu genişlet güzel görüntü olsun . Bu komutu kaldır
User prompt
Oyunu platformda başlasın
User prompt
Karekteri platformun ortasına koy
Code edit (1 edits merged)
Please save this source code
User prompt
Yer çekimini yere yap havada olmasın
User prompt
Önceki komutumu kaldır
User prompt
Platformu yukarı genişlet
User prompt
Platformu genişlet güzel görüntü olsun
User prompt
Ekran arka plan mavi olsun
User prompt
Platform yavaş yükleniyor sorunu düzelt
User prompt
Canavar doğma noktası olmasın canavar random doğsun
User prompt
Random olsun canavarların arası
User prompt
Canavar doğsun bir sürü
User prompt
Platformu sonsuza kadar uzat
User prompt
Karekteri takip et
User prompt
Karakteri biraz hızlandır
User prompt
Zıplamayı %20 yükselt
User prompt
Zıplamayı %20 yükselt
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); var storage = LK.import("@upit/storage.v1"); /**** * Classes ****/ var Monster = Container.expand(function () { var self = Container.call(this); var monsterGraphics = self.attachAsset('monster', { anchorX: 0.5, anchorY: 0.5 }); self.speed = -10; // Monsters move to the left self.update = function () { self.x += self.speed; }; return self; }); //Library for using the camera (the background becomes the user's camera video feed) and the microphone. It can access face coordinates for interactive play, as well detect microphone volume / voice interactions // var facekit = LK.import('@upit/facekit.v1'); //Classes can only be defined here. You cannot create inline classes in the games code. var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5 }); self.isJumping = false; self.velocityY = 0; self.gravity = 2; self.jumpStrength = -42; // Increased jump strength by 20% (-35 * 1.2 = -42) self.update = function () { if (self.isJumping) { self.y += self.velocityY; self.velocityY += self.gravity; // Check for landing on the platform if (self.y >= game.platformY - playerGraphics.height / 2) { self.y = game.platformY - playerGraphics.height / 2; self.isJumping = false; self.velocityY = 0; } } }; self.jump = function () { if (!self.isJumping) { self.isJumping = true; self.velocityY = self.jumpStrength; LK.getSound('jump').play(); } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x444444 // Init game with grey background }); /**** * Game Code ****/ //Storage library which should be used for persistent game data //Minimalistic tween library which should be used for animations over time, including tinting / colouring an object, scaling, rotating, or changing any game object property. //Only include the plugins you need to create the game. //We have access to the following plugins. (Note that the variable names used are mandetory for each plugin) // Initialize assets used in this game. Scale them according to what is needed for the game. // or via static code analysis based on their usage in the code. // Assets are automatically created and loaded either dynamically during gameplay /* Supported Types: 1. Shape: - Simple geometric figures with these properties: * width: (required) pixel width of the shape. * height: (required) pixel height of the shape. * color: (required) color of the shape. * shape: (required) type of shape. Valid options: 'box', 'ellipse'. 2. Image: - Imported images with these properties: * width: (required) pixel resolution width. * height: (required) pixel resolution height. * id: (required) identifier for the image. * flipX: (optional) horizontal flip. Valid values: 0 (no flip), 1 (flip). * flipY: (optional) vertical flip. Valid values: 0 (no flip), 1 (flip). * orientation: (optional) rotation in multiples of 90 degrees, clockwise. Valid values: - 0: No rotation. - 1: Rotate 90 degrees. - 2: Rotate 180 degrees. - 3: Rotate 270 degrees. Note: Width and height remain unchanged upon flipping. 3. Sound: - Sound effects with these properties: * id: (required) identifier for the sound. * volume: (optional) custom volume. Valid values are a float from 0 to 1. 4. Music: - In contract to sound effects, only one music can be played at a time - Music is using the same API to initilize just like sound. - Music loops by default - Music with these config options: * id: (required) identifier for the sound. * volume: (optional) custom volume. Valid values are a float from 0 to 1. * start: (optional) a float from 0 to 1 used for cropping and indicates the start of the cropping * end: (optional) a float from 0 to 1 used for cropping and indicates the end of the cropping */ //Note game dimensions are 2048x2732 var platform = game.addChild(LK.getAsset('platform', { x: 2048 / 2, y: 2732 - 50 / 2, anchorX: 0.5, anchorY: 0.5 })); game.platformY = platform.y - platform.height / 2; // Y-coordinate of the top of the platform var player = game.addChild(new Player()); player.x = 200; player.y = game.platformY - player.height / 2; // Position player on the platform var monsters = []; var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); LK.gui.top.addChild(scoreTxt); scoreTxt.x = 2048 / 2; var monsterSpawnTimer = LK.setInterval(function () { var newMonster = new Monster(); newMonster.x = 2048 + newMonster.width / 2; // Start off screen to the right newMonster.y = game.platformY - newMonster.height / 2; // Position on the platform monsters.push(newMonster); game.addChild(newMonster); }, 1500); // Spawn a monster every 1.5 seconds game.down = function (x, y, obj) { player.jump(); }; game.update = function () { // Update score based on distance traveled (simple time-based score for now) LK.setScore(LK.getScore() + 1); scoreTxt.setText(LK.getScore()); for (var i = monsters.length - 1; i >= 0; i--) { var monster = monsters[i]; // Remove monsters that go off screen if (monster.x < -monster.width / 2) { monster.destroy(); monsters.splice(i, 1); continue; } // Check for collision with player if (player.intersects(monster)) { LK.effects.flashScreen(0xff0000, 500); LK.showGameOver(); } } };
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
var storage = LK.import("@upit/storage.v1");
/****
* Classes
****/
var Monster = Container.expand(function () {
var self = Container.call(this);
var monsterGraphics = self.attachAsset('monster', {
anchorX: 0.5,
anchorY: 0.5
});
self.speed = -10; // Monsters move to the left
self.update = function () {
self.x += self.speed;
};
return self;
});
//Library for using the camera (the background becomes the user's camera video feed) and the microphone. It can access face coordinates for interactive play, as well detect microphone volume / voice interactions
// var facekit = LK.import('@upit/facekit.v1');
//Classes can only be defined here. You cannot create inline classes in the games code.
var Player = Container.expand(function () {
var self = Container.call(this);
var playerGraphics = self.attachAsset('player', {
anchorX: 0.5,
anchorY: 0.5
});
self.isJumping = false;
self.velocityY = 0;
self.gravity = 2;
self.jumpStrength = -42; // Increased jump strength by 20% (-35 * 1.2 = -42)
self.update = function () {
if (self.isJumping) {
self.y += self.velocityY;
self.velocityY += self.gravity;
// Check for landing on the platform
if (self.y >= game.platformY - playerGraphics.height / 2) {
self.y = game.platformY - playerGraphics.height / 2;
self.isJumping = false;
self.velocityY = 0;
}
}
};
self.jump = function () {
if (!self.isJumping) {
self.isJumping = true;
self.velocityY = self.jumpStrength;
LK.getSound('jump').play();
}
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x444444 // Init game with grey background
});
/****
* Game Code
****/
//Storage library which should be used for persistent game data
//Minimalistic tween library which should be used for animations over time, including tinting / colouring an object, scaling, rotating, or changing any game object property.
//Only include the plugins you need to create the game.
//We have access to the following plugins. (Note that the variable names used are mandetory for each plugin)
// Initialize assets used in this game. Scale them according to what is needed for the game.
// or via static code analysis based on their usage in the code.
// Assets are automatically created and loaded either dynamically during gameplay
/*
Supported Types:
1. Shape:
- Simple geometric figures with these properties:
* width: (required) pixel width of the shape.
* height: (required) pixel height of the shape.
* color: (required) color of the shape.
* shape: (required) type of shape. Valid options: 'box', 'ellipse'.
2. Image:
- Imported images with these properties:
* width: (required) pixel resolution width.
* height: (required) pixel resolution height.
* id: (required) identifier for the image.
* flipX: (optional) horizontal flip. Valid values: 0 (no flip), 1 (flip).
* flipY: (optional) vertical flip. Valid values: 0 (no flip), 1 (flip).
* orientation: (optional) rotation in multiples of 90 degrees, clockwise. Valid values:
- 0: No rotation.
- 1: Rotate 90 degrees.
- 2: Rotate 180 degrees.
- 3: Rotate 270 degrees.
Note: Width and height remain unchanged upon flipping.
3. Sound:
- Sound effects with these properties:
* id: (required) identifier for the sound.
* volume: (optional) custom volume. Valid values are a float from 0 to 1.
4. Music:
- In contract to sound effects, only one music can be played at a time
- Music is using the same API to initilize just like sound.
- Music loops by default
- Music with these config options:
* id: (required) identifier for the sound.
* volume: (optional) custom volume. Valid values are a float from 0 to 1.
* start: (optional) a float from 0 to 1 used for cropping and indicates the start of the cropping
* end: (optional) a float from 0 to 1 used for cropping and indicates the end of the cropping
*/
//Note game dimensions are 2048x2732
var platform = game.addChild(LK.getAsset('platform', {
x: 2048 / 2,
y: 2732 - 50 / 2,
anchorX: 0.5,
anchorY: 0.5
}));
game.platformY = platform.y - platform.height / 2; // Y-coordinate of the top of the platform
var player = game.addChild(new Player());
player.x = 200;
player.y = game.platformY - player.height / 2; // Position player on the platform
var monsters = [];
var scoreTxt = new Text2('0', {
size: 150,
fill: 0xFFFFFF
});
LK.gui.top.addChild(scoreTxt);
scoreTxt.x = 2048 / 2;
var monsterSpawnTimer = LK.setInterval(function () {
var newMonster = new Monster();
newMonster.x = 2048 + newMonster.width / 2; // Start off screen to the right
newMonster.y = game.platformY - newMonster.height / 2; // Position on the platform
monsters.push(newMonster);
game.addChild(newMonster);
}, 1500); // Spawn a monster every 1.5 seconds
game.down = function (x, y, obj) {
player.jump();
};
game.update = function () {
// Update score based on distance traveled (simple time-based score for now)
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
for (var i = monsters.length - 1; i >= 0; i--) {
var monster = monsters[i];
// Remove monsters that go off screen
if (monster.x < -monster.width / 2) {
monster.destroy();
monsters.splice(i, 1);
continue;
}
// Check for collision with player
if (player.intersects(monster)) {
LK.effects.flashScreen(0xff0000, 500);
LK.showGameOver();
}
}
};