User prompt
She cant pass just ground platform
User prompt
Witch can pass through the platforms
User prompt
When press up button make it jump and delete jump button
User prompt
Ad buttons on the screen, up down left right and fire
User prompt
Add moving control
User prompt
Delete all moving control
User prompt
When ı push up she can pass when I push down she can pass move down
User prompt
Can you make controls like mario game
User prompt
Witch can jump on the platforms to other platforms
User prompt
Witch cant jumping help check controls
User prompt
Witch can move upper platforms
User prompt
Make this game moves like snow bros game
User prompt
Witch can jump between platforms
User prompt
Witch can jump
User prompt
Speed change life potions
User prompt
Platform stay stil
User prompt
Witch can moves all platforms
User prompt
Add boiler for 1 life point
User prompt
Make platforms more like snow bros game
User prompt
Platforms more on the ground level
User prompt
More longer platforms
User prompt
Make platforms more close
User prompt
When witch throw a ıce orb ghost and bats freeze 30 seconds
User prompt
Moon and speed moves
User prompt
Bats cant touch the platforms
/****
* Plugins
****/
var tween = LK.import("@upit/tween.v1");
/****
* Classes
****/
// Enemy: Bat
var Bat = Container.expand(function (x, y) {
var self = Container.call(this);
var bat = self.attachAsset('bat', {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
self.vx = (Math.random() > 0.5 ? 1 : -1) * (12 + Math.random() * 8);
self.vy = Math.random() > 0.5 ? 2 : -2;
self.frozen = false;
self.frozenTimer = 0;
self.trapped = false;
self.trapTimer = 0;
self.update = function () {
if (self.trapped) {
self.trapTimer--;
if (self.trapTimer <= 0) {
self.trapped = false;
self.alpha = 1;
}
return;
}
if (self.frozen) {
self.frozenTimer--;
if (self.frozenTimer <= 0) {
self.frozen = false;
bat.tint = 0x2a2a2a;
}
return;
}
self.x += self.vx;
self.y += self.vy;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
if (self.y < 200 || self.y > 2732 - 200) self.vy *= -1;
// Prevent bats from touching platforms: bounce off if intersecting
for (var i = 0; i < platforms.length; i++) {
var p = platforms[i];
if (self.intersects(p)) {
// Bounce bat away from platform
// Determine if bat is coming from above/below or left/right
var dx = self.x - p.x;
var dy = self.y - p.y;
if (Math.abs(dx) > Math.abs(dy)) {
// Bounce horizontally
self.vx *= -1;
// Move bat out of platform horizontally
if (dx > 0) {
self.x = p.x + p.width / 2 + 40;
} else {
self.x = p.x - p.width / 2 - 40;
}
} else {
// Bounce vertically
self.vy *= -1;
// Move bat out of platform vertically
if (dy > 0) {
self.y = p.y + p.height / 2 + 40;
} else {
self.y = p.y - p.height / 2 - 40;
}
}
}
}
};
// Freeze effect
self.freeze = function () {
self.frozen = true;
self.frozenTimer = 180;
bat.tint = 0x7fdfff;
};
// Trap effect
self.trap = function () {
self.trapped = true;
self.trapTimer = 90;
self.alpha = 0.4;
};
// Shatter (destroy)
self.shatter = function () {
LK.getSound('shatter').play();
self.destroy();
var idx = enemies.indexOf(self);
if (idx >= 0) enemies.splice(idx, 1);
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
};
return self;
});
// Evanasense (player) class
var Evanasense = Container.expand(function () {
var self = Container.call(this);
// Body
var body = self.attachAsset('evana', {
anchorX: 0.5,
anchorY: 0.5
});
// Hat
var hat = self.attachAsset('evana_hat', {
anchorX: 0.5,
anchorY: 1.1,
y: -60
});
// Physics
self.vx = 0;
self.vy = 0;
self.lastY = 0;
self.isOnGround = false;
self.facing = 1; // 1: right, -1: left
self.canShoot = true;
self.shootCooldown = 0;
self.shielded = false;
self.speedBoost = 0;
self.fullMoon = false;
self.fullMoonTimer = 0;
// For power-up visuals
self.shieldSprite = null;
// Freeze spell
self.castFreeze = function () {
if (!self.canShoot) return;
self.canShoot = false;
self.shootCooldown = 30; // 0.5s cooldown
var orb = new FreezeOrb(self.x, self.y - 60, self.facing);
game.addChild(orb);
freezeOrbs.push(orb);
LK.getSound('freeze').play();
};
// Trap spell (ice block, only in full moon mode)
self.castTrap = function () {
if (!self.fullMoon) return;
var trap = new IceBlock(self.x + 100 * self.facing, self.y - 40);
game.addChild(trap);
iceBlocks.push(trap);
LK.getSound('trap').play();
};
// Power-up: Shield
self.gainShield = function () {
self.shielded = true;
if (!self.shieldSprite) {
self.shieldSprite = self.attachAsset('shield', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.5
});
}
self.shieldSprite.visible = true;
};
self.loseShield = function () {
self.shielded = false;
if (self.shieldSprite) self.shieldSprite.visible = false;
};
// Power-up: Speed
self.gainSpeed = function () {
self.speedBoost = 180;
LK.effects.flashObject(self, 0xffe066, 400);
};
// Power-up: Full Moon
self.activateFullMoon = function () {
self.fullMoon = true;
self.fullMoonTimer = 360; // 6 seconds
LK.effects.flashObject(self, 0xf6f1c7, 600);
};
// Update
self.update = function () {
// Gravity
self.vy += 2.2;
if (self.vy > 40) self.vy = 40;
// Movement
var moveSpeed = 18 + (self.speedBoost > 0 ? 10 : 0);
if (self.moveDir) {
self.vx = moveSpeed * self.moveDir;
self.facing = self.moveDir;
} else {
self.vx *= 0.7;
if (Math.abs(self.vx) < 1) self.vx = 0;
}
// Apply position
self.lastY = self.y;
self.x += self.vx;
self.y += self.vy;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
// Clamp vertically
if (self.y > 2732 - 60) {
self.y = 2732 - 60;
self.vy = 0;
self.isOnGround = true;
}
// Platform collision (Snow Bros style: can jump up through platforms, land from above, and block head from below)
self.isOnGround = false;
for (var i = 0; i < platforms.length; i++) {
var p = platforms[i];
var platTop = p.y - p.height / 2;
var platBottom = p.y + p.height / 2;
var platLeft = p.x - p.width / 2 + 30;
var platRight = p.x + p.width / 2 - 30;
var feetLast = self.lastY + 60;
var feetNow = self.y + 60;
var headLast = self.lastY - 60;
var headNow = self.y - 60;
// Only land if falling and feet cross the top of a platform
if (feetLast <= platTop && feetNow > platTop && self.x > platLeft && self.x < platRight && self.vy >= 0) {
self.y = platTop - 60;
self.vy = 0;
self.isOnGround = true;
}
// Block head if jumping up into the bottom of a platform
if (headLast >= platBottom && headNow < platBottom && self.x > platLeft && self.x < platRight && self.vy < 0) {
self.y = platBottom + 60;
self.vy = 0;
}
}
// Shooting cooldown
if (!self.canShoot) {
self.shootCooldown--;
if (self.shootCooldown <= 0) {
self.canShoot = true;
}
}
// Speed boost timer
if (self.speedBoost > 0) {
self.speedBoost--;
}
// Full moon timer
if (self.fullMoon) {
self.fullMoonTimer--;
if (self.fullMoonTimer <= 0) {
self.fullMoon = false;
}
}
};
return self;
});
// Freeze orb spell
var FreezeOrb = Container.expand(function (x, y, dir) {
var self = Container.call(this);
var orb = self.attachAsset('freeze_orb', {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
self.vx = 32 * dir;
self.lifetime = 60;
self.update = function () {
self.x += self.vx;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
self.lifetime--;
if (self.lifetime <= 0) {
self.destroy();
var idx = freezeOrbs.indexOf(self);
if (idx >= 0) freezeOrbs.splice(idx, 1);
}
};
return self;
});
// Enemy: Ghost
var Ghost = Container.expand(function (x, y) {
var self = Container.call(this);
var ghost = self.attachAsset('ghost', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.85
});
self.x = x;
self.y = y;
self.vx = (Math.random() > 0.5 ? 1 : -1) * (8 + Math.random() * 6);
self.vy = 0;
self.frozen = false;
self.frozenTimer = 0;
self.trapped = false;
self.trapTimer = 0;
self.update = function () {
if (self.trapped) {
self.trapTimer--;
if (self.trapTimer <= 0) {
self.trapped = false;
self.alpha = 0.85;
}
return;
}
if (self.frozen) {
self.frozenTimer--;
if (self.frozenTimer <= 0) {
self.frozen = false;
ghost.tint = 0xcfd6e6;
}
return;
}
self.x += self.vx;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
};
// Freeze effect
self.freeze = function () {
self.frozen = true;
self.frozenTimer = 180;
ghost.tint = 0x7fdfff;
};
// Trap effect
self.trap = function () {
self.trapped = true;
self.trapTimer = 90;
self.alpha = 0.4;
};
// Shatter (destroy)
self.shatter = function () {
LK.getSound('shatter').play();
self.destroy();
var idx = enemies.indexOf(self);
if (idx >= 0) enemies.splice(idx, 1);
LK.setScore(LK.getScore() + 1);
scoreTxt.setText(LK.getScore());
};
return self;
});
// Ice block trap (full moon mode)
var IceBlock = Container.expand(function (x, y) {
var self = Container.call(this);
var block = self.attachAsset('ice_block', {
anchorX: 0.5,
anchorY: 0.5,
alpha: 0.85
});
self.x = x;
self.y = y;
self.lifetime = 120;
self.update = function () {
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
self.lifetime--;
if (self.lifetime <= 0) {
self.destroy();
var idx = iceBlocks.indexOf(self);
if (idx >= 0) iceBlocks.splice(idx, 1);
}
};
return self;
});
// Power-up: Moon (full moon mode)
var MoonPower = Container.expand(function (x, y) {
var self = Container.call(this);
var moon = self.attachAsset('moon', {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
self.type = 'moon';
self.vx = 8 + Math.random() * 4;
self.lastX = self.x;
self.update = function () {
self.lastX = self.x;
self.x += self.vx;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
};
return self;
});
// Platform
var Platform = Container.expand(function (x, y, w) {
var self = Container.call(this);
var plat = self.attachAsset('platform', {
anchorX: 0.5,
anchorY: 0.5,
width: w || 320
});
self.x = x;
self.y = y;
self.width = w || 320;
self.height = 40;
return self;
});
// Power-up: Shield
var ShieldPower = Container.expand(function (x, y) {
var self = Container.call(this);
var shield = self.attachAsset('shield', {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
self.type = 'shield';
self.update = function () {
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
};
return self;
});
// Power-up: Speed
var SpeedPower = Container.expand(function (x, y) {
var self = Container.call(this);
var speed = self.attachAsset('speed', {
anchorX: 0.5,
anchorY: 0.5
});
self.x = x;
self.y = y;
self.type = 'speed';
self.vy = 7 + Math.random() * 3;
self.lastY = self.y;
self.update = function () {
self.lastY = self.y;
self.y += self.vy;
// Snow Bros style: wrap horizontally
if (self.x < 0) self.x = 2048;
if (self.x > 2048) self.x = 0;
// Bounce at vertical edges
if (self.lastY <= 200 && self.y > 200 || self.lastY >= 2732 - 200 && self.y < 2732 - 200) {
self.vy *= -1;
}
if (self.y < 200) self.y = 200;
if (self.y > 2732 - 200) self.y = 2732 - 200;
};
return self;
});
/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x18141e
});
/****
* Game Code
****/
// Game state
// Add background image
var bg = LK.getAsset('bg', {
anchorX: 0,
anchorY: 0,
width: 2048,
height: 2732,
x: 0,
y: 0
});
game.addChild(bg);
// Main character: Evanasense (witch)
// Witch body
// Witch hat
// Enemy: Ghost
// Enemy: Bat
// Platform
// Spell: Freeze orb
// Spell: Trap (ice block)
// Power-up: Moon
// Power-up: Shield
// Power-up: Speed
// Sound effects
// Music
var player;
var platforms = [];
var enemies = [];
var freezeOrbs = [];
var iceBlocks = [];
var powerups = [];
var stage = 1;
var stageCleared = false;
var stageTimer = 0;
var dragNode = null;
var moveStartX = 0;
var moveDir = 0;
var scoreTxt;
// Add lives
var lives = 1;
var livesTxt = new Text2('Lives: ' + lives, {
size: 70,
fill: 0xF6F1C7
});
livesTxt.anchor.set(0, 0);
LK.gui.top.addChild(livesTxt);
// Place lives at top left, but not in the 100x100 reserved area
livesTxt.x = 120;
livesTxt.y = 20;
// Score display
scoreTxt = new Text2('0', {
size: 120,
fill: 0xF6F1C7
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
// Stage display
var stageTxt = new Text2('Stage 1', {
size: 70,
fill: 0xB8E6FF
});
stageTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(stageTxt);
stageTxt.y = 120;
// Helper: spawn platforms
function spawnPlatforms() {
// Clear old
for (var i = 0; i < platforms.length; i++) platforms[i].destroy();
platforms = [];
// Floor
var floor = new Platform(1024, 2732 - 40, 2048);
game.addChild(floor);
platforms.push(floor);
// Snow Bros style: 5-6 fixed rows, wide platforms, even spacing, classic arcade
var rows = 6;
var yStart = 2732 - 300;
var yStep = 320;
for (var i = 0; i < rows; i++) {
var y = yStart - i * yStep;
// Classic: alternate left/right gaps for each row
if (i % 2 === 0) {
// Full width platform
var plat = new Platform(1024, y, 1600);
game.addChild(plat);
platforms.push(plat);
} else {
// Two half platforms with a gap in the middle
var leftPlat = new Platform(512, y, 700);
var rightPlat = new Platform(1536, y, 700);
game.addChild(leftPlat);
game.addChild(rightPlat);
platforms.push(leftPlat);
platforms.push(rightPlat);
}
}
}
// Helper: spawn enemies
function spawnEnemies() {
for (var i = 0; i < enemies.length; i++) enemies[i].destroy();
enemies = [];
var ghostCount = 2 + Math.floor(stage / 2);
var batCount = 3 + Math.floor(stage / 2); // Increased number of bats for more slow bats
for (var i = 0; i < ghostCount; i++) {
var px = 200 + Math.random() * (2048 - 400);
var py = 400 + Math.random() * 1200;
var g = new Ghost(px, py);
game.addChild(g);
enemies.push(g);
}
for (var i = 0; i < batCount; i++) {
var px = 200 + Math.random() * (2048 - 400);
var py = 300 + Math.random() * 1000;
var b = new Bat(px, py);
game.addChild(b);
enemies.push(b);
}
}
// Helper: spawn powerups
function spawnPowerups() {
for (var i = 0; i < powerups.length; i++) powerups[i].destroy();
powerups = [];
// Always one moon per stage
var moon = new MoonPower(200 + Math.random() * (2048 - 400), 400 + Math.random() * 1200);
game.addChild(moon);
powerups.push(moon);
// 50% chance for shield
if (Math.random() < 0.5) {
var shield = new ShieldPower(200 + Math.random() * (2048 - 400), 400 + Math.random() * 1200);
game.addChild(shield);
powerups.push(shield);
}
// 50% chance for speed
if (Math.random() < 0.5) {
var speed = new SpeedPower(200 + Math.random() * (2048 - 400), 400 + Math.random() * 1200);
game.addChild(speed);
powerups.push(speed);
}
}
// Start new stage
function startStage() {
stageCleared = false;
stageTimer = 0;
stageTxt.setText('Stage ' + stage);
LK.setScore(0);
scoreTxt.setText('0');
lives = 5;
livesTxt.setText('Lives: ' + lives);
spawnPlatforms();
spawnEnemies();
spawnPowerups();
// Place player
if (player) player.destroy();
player = new Evanasense();
player.x = 1024;
player.y = 2732 - 200;
game.addChild(player);
}
// Begin first stage
startStage();
// Main update loop
game.update = function () {
// Update player
if (player) player.update();
// Update freeze orbs
for (var i = freezeOrbs.length - 1; i >= 0; i--) {
var orb = freezeOrbs[i];
orb.update();
// Collide with enemies
for (var j = 0; j < enemies.length; j++) {
var e = enemies[j];
if (!e.frozen && !e.trapped && orb.intersects(e)) {
e.freeze();
orb.destroy();
freezeOrbs.splice(i, 1);
break;
}
}
}
// Update ice blocks
for (var i = iceBlocks.length - 1; i >= 0; i--) {
var block = iceBlocks[i];
block.update();
// Collide with enemies
for (var j = 0; j < enemies.length; j++) {
var e = enemies[j];
if (!e.trapped && block.intersects(e)) {
e.trap();
block.destroy();
iceBlocks.splice(i, 1);
break;
}
}
}
// Update enemies
for (var i = enemies.length - 1; i >= 0; i--) {
var e = enemies[i];
e.update();
// If frozen or trapped, can be shattered by touching again
if ((e.frozen || e.trapped) && player && player.intersects(e)) {
e.shatter();
}
// If not frozen/trapped, collision with player
if (!e.frozen && !e.trapped && player && player.intersects(e)) {
if (player.shielded) {
player.loseShield();
LK.getSound('hit').play();
LK.effects.flashObject(player, 0x8fffd6, 400);
} else {
lives--;
livesTxt.setText('Lives: ' + lives);
LK.effects.flashScreen(0x7e4a9c, 900);
if (lives <= 0) {
LK.showGameOver();
return;
} else {
// Respawn player at start position
player.x = 1024;
player.y = 2732 - 200;
player.vx = 0;
player.vy = 0;
player.loseShield();
}
}
}
}
// Update powerups
for (var i = powerups.length - 1; i >= 0; i--) {
var p = powerups[i];
if (player && player.intersects(p)) {
if (p.type === 'moon') {
player.activateFullMoon();
} else if (p.type === 'shield') {
player.gainShield();
} else if (p.type === 'speed') {
player.gainSpeed();
player.speedBoost = 240; // Speed lasts 4 seconds (60fps*4)
}
LK.getSound('powerup').play();
p.destroy();
powerups.splice(i, 1);
}
}
// Full moon: allow trap spell by tap with two fingers (simulate by double tap)
if (player && player.fullMoon && LK.ticks % 60 === 0) {
// For MVP, allow trap spell every second in full moon
player.castTrap();
}
// Stage clear
if (!stageCleared && enemies.length === 0) {
stageCleared = true;
stageTimer = 90;
LK.effects.flashScreen(0xb8e6ff, 600);
}
if (stageCleared) {
stageTimer--;
if (stageTimer <= 0) {
stage++;
if (stage % 5 === 0) {
// Boss stage MVP: just spawn more enemies
stageTxt.setText('Boss Stage!');
for (var i = 0; i < 3; i++) {
var px = 200 + Math.random() * (2048 - 400);
var py = 400 + Math.random() * 1200;
var g = new Ghost(px, py);
game.addChild(g);
enemies.push(g);
}
for (var i = 0; i < 2; i++) {
var px = 200 + Math.random() * (2048 - 400);
var py = 300 + Math.random() * 1000;
var b = new Bat(px, py);
game.addChild(b);
enemies.push(b);
}
stageCleared = false;
} else {
startStage();
}
}
}
};
// Play music
LK.playMusic('gothic_theme', {
fade: {
start: 0,
end: 1,
duration: 1200
}
}); ===================================================================
--- original.js
+++ change.js
@@ -599,132 +599,8 @@
game.addChild(player);
}
// Begin first stage
startStage();
-// Mario-style on-screen controls with up/down
-// Define button areas (bottom left: left, bottom right: right, bottom center: jump, above left: up, below left: down)
-var buttonSize = 320;
-var buttonMargin = 60;
-var leftBtn = {
- x: buttonMargin,
- y: 2732 - buttonSize - buttonMargin,
- w: buttonSize,
- h: buttonSize
-};
-var rightBtn = {
- x: buttonMargin + buttonSize + 60,
- y: 2732 - buttonSize - buttonMargin,
- w: buttonSize,
- h: buttonSize
-};
-var jumpBtn = {
- x: 2048 - buttonMargin - buttonSize,
- y: 2732 - buttonSize - buttonMargin,
- w: buttonSize,
- h: buttonSize
-};
-// Up and Down buttons (above and below leftBtn)
-var upBtn = {
- x: leftBtn.x,
- y: leftBtn.y - buttonSize - 40,
- w: buttonSize,
- h: buttonSize
-};
-var downBtn = {
- x: leftBtn.x,
- y: leftBtn.y + buttonSize + 40,
- w: buttonSize,
- h: buttonSize
-};
-// Optionally, you can draw semi-transparent overlays for debugging:
-// var leftOverlay = LK.getAsset('platform', { anchorX: 0, anchorY: 0, width: leftBtn.w, height: leftBtn.h, x: leftBtn.x, y: leftBtn.y, alpha: 0.1 });
-// var rightOverlay = LK.getAsset('platform', { anchorX: 0, anchorY: 0, width: rightBtn.w, height: rightBtn.h, x: rightBtn.x, y: rightBtn.y, alpha: 0.1 });
-// var jumpOverlay = LK.getAsset('platform', { anchorX: 0, anchorY: 0, width: jumpBtn.w, height: jumpBtn.h, x: jumpBtn.x, y: jumpBtn.y, alpha: 0.1 });
-// var upOverlay = LK.getAsset('platform', { anchorX: 0, anchorY: 0, width: upBtn.w, height: upBtn.h, x: upBtn.x, y: upBtn.y, alpha: 0.1 });
-// var downOverlay = LK.getAsset('platform', { anchorX: 0, anchorY: 0, width: downBtn.w, height: downBtn.h, x: downBtn.x, y: downBtn.y, alpha: 0.1 });
-// game.addChild(leftOverlay); game.addChild(rightOverlay); game.addChild(jumpOverlay); game.addChild(upOverlay); game.addChild(downOverlay);
-var leftPressed = false;
-var rightPressed = false;
-var jumpPressed = false;
-var upPressed = false;
-var downPressed = false;
-function isInBtn(x, y, btn) {
- return x >= btn.x && x <= btn.x + btn.w && y >= btn.y && y <= btn.y + btn.h;
-}
-game.down = function (x, y, obj) {
- if (isInBtn(x, y, leftBtn)) {
- leftPressed = true;
- player.moveDir = -1;
- } else if (isInBtn(x, y, rightBtn)) {
- rightPressed = true;
- player.moveDir = 1;
- } else if (isInBtn(x, y, upBtn)) {
- upPressed = true;
- if (player) {
- // Move up through platform: nudge player up by 80px, ignore collisions for 1 frame
- player.y -= 80;
- player.vy = -18;
- player.isOnGround = false;
- }
- } else if (isInBtn(x, y, downBtn)) {
- downPressed = true;
- if (player) {
- // Move down through platform: nudge player down by 80px, ignore collisions for 1 frame
- player.y += 80;
- player.vy = 18;
- player.isOnGround = false;
- }
- } else if (isInBtn(x, y, jumpBtn)) {
- jumpPressed = true;
- // Mario: jump only if on ground
- if (player && player.isOnGround) {
- player.vy = -38;
- player.isOnGround = false;
- LK.getSound('jump').play();
- }
- } else {
- // If tap elsewhere, cast freeze
- if (player) player.castFreeze();
- }
-};
-game.up = function (x, y, obj) {
- // Release all buttons if finger lifted anywhere
- leftPressed = false;
- rightPressed = false;
- jumpPressed = false;
- upPressed = false;
- downPressed = false;
- player.moveDir = 0;
-};
-game.move = function (x, y, obj) {
- // If finger is still on a button, keep that direction
- if (leftPressed && isInBtn(x, y, leftBtn)) {
- player.moveDir = -1;
- } else if (rightPressed && isInBtn(x, y, rightBtn)) {
- player.moveDir = 1;
- } else {
- player.moveDir = 0;
- }
- // Up/down continuous movement
- if (upPressed && isInBtn(x, y, upBtn)) {
- if (player) {
- player.y -= 18;
- player.vy = -18;
- player.isOnGround = false;
- }
- }
- if (downPressed && isInBtn(x, y, downBtn)) {
- if (player) {
- player.y += 18;
- player.vy = 18;
- player.isOnGround = false;
- }
- }
- // If finger is on jump, allow holding jump for a little longer (Mario style)
- if (jumpPressed && isInBtn(x, y, jumpBtn)) {
- // Optional: variable jump height if holding jump (not implemented here)
- }
-};
// Main update loop
game.update = function () {
// Update player
if (player) player.update();
Ghost. In-Game asset. 2d. High contrast. No shadows
One life potion. In-Game asset. 2d. High contrast. No shadows
Change
Witch boiler. In-Game asset. 2d. High contrast. No shadows
Diffrent colour
Broom. In-Game asset. 2d. High contrast. No shadows
Snake. In-Game asset. 2d. High contrast. No shadows
Add legs
Snowball. In-Game asset. 2d. High contrast. No shadows
Bat closed wings
Behind
Flying boss. In-Game asset. 2d. High contrast. No shadows
Fireball. In-Game asset. 2d. High contrast. No shadows
Moon. In-Game asset. 2d. High contrast. No shadows
Dark forrest. In-Game asset. 2d. High contrast. No shadows
Ice block. In-Game asset. 2d. High contrast. No shadows
Ice wall. In-Game asset. 2d. High contrast. No shadows
Portal. In-Game asset. 2d. High contrast. No shadows