User prompt
Bring the text "Liveness Meter" more to the right
User prompt
Make the "Liveness Meter" font size larger
User prompt
Bring the text "Liveness Meter" more to the right
User prompt
more below
User prompt
Make "Liveness Meter" more below the health bar
User prompt
add the word "Liveness Meter" below the health bar
User prompt
Once the timer reach 100, the beatdown speed increase to 10
User prompt
Once the timer reach 100, the beat falls down faster
User prompt
you lose the game if your point reach 0
var PlayerHealth = Container.expand(function () { var self = Container.call(this); self.hp = 10; var healthBarBackground = self.createAsset('healthBarBackground', 'Health Bar Background', 0, 0); var healthBarForeground = self.createAsset('healthBarForeground', 'Health Bar Foreground', 0, 0); healthBarForeground.tint = 0x00FF00; self.updateHealthBar = function () { healthBarForeground.scale.x = self.hp / 10; var healthText = new Text2(self.hp.toString(), { size: 50, fill: "#ffffff" }); healthText.anchor.set(0.5, 0.5); healthText.x = healthBarBackground.width / 2; healthText.y = healthBarBackground.height / 2; if (self.healthText) self.healthText.destroy(); self.healthText = healthText; self.addChild(self.healthText); }; self.updateHealthBar(); }); var BeatColumn1 = Container.expand(function () { var self = Container.call(this); var beatGraphics = self.createAsset('beatColumn1', 'Beat Graphics Column 1', .5, .5); self.speed = 5; self.move = function () { self.y += self.speed; }; }); var BeatColumn2 = Container.expand(function () { var self = Container.call(this); var beatGraphics = self.createAsset('beatColumn2', 'Beat Graphics Column 2', .5, .5); self.speed = 5; self.move = function () { self.y += self.speed; }; }); var BeatColumn3 = Container.expand(function () { var self = Container.call(this); var beatGraphics = self.createAsset('beatColumn3', 'Beat Graphics Column 3', .5, .5); self.speed = 5; self.move = function () { self.y += self.speed; }; }); var BeatColumn4 = Container.expand(function () { var self = Container.call(this); var beatGraphics = self.createAsset('beatColumn4', 'Beat Graphics Column 4', .5, .5); self.speed = 5; self.move = function () { self.y += self.speed; }; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.createAsset('player', 'Player Graphics', .5, .5); self.dance = function () {}; }); var Game = Container.expand(function () { var self = Container.call(this); self.gameTimer = 180; self.timerText = new Text2(self.gameTimer.toString(), { size: 150, fill: "#000000" }); self.timerText.anchor.set(0.5, 0); LK.gui.topCenter.addChild(self.timerText); self.updateTimer = function () { if (self.gameTimer > 0) { self.gameTimer--; self.timerText.setText(self.gameTimer.toString()); if (self.gameTimer == 100) { BeatColumn1.prototype.speed = 10; BeatColumn2.prototype.speed = 10; BeatColumn3.prototype.speed = 10; BeatColumn4.prototype.speed = 10; } } else { LK.showGameOver('You Are Buck!'); } }; self.timerInterval = LK.setInterval(self.updateTimer, 1000); var score = 0; var scoreTxt = new Text2(score.toString(), { size: 150, fill: "#ffffff" }); scoreTxt.anchor.set(1, 0); LK.gui.topRight.addChild(scoreTxt); var playerHealth = self.addChild(new PlayerHealth()); playerHealth.x = 10; playerHealth.y = 10; LK.gui.topLeft.addChild(playerHealth); var background = self.createAsset('background', 'Background Image', 0, 0); self.addChildAt(background, 0); var beats = []; var player = self.addChild(new Player()); player.x = 2048 / 2; var floorHeight = 100; var playerFloorOffset = player.height / 2 + floorHeight; player.y = 2732 - playerFloorOffset; var floor = self.createAsset('floor', 'Floor Graphics', 0, 1); floor.y = 2732 - floorHeight; self.addChildAt(floor, 1); LK.on('tick', function () { player.dance(); for (var a = beats.length - 1; a >= 0; a--) { var beat = beats[a]; beat.move(); if (player.intersects(beat)) { score += 100; scoreTxt.setText(score.toString()); playerHealth.hp += 1; playerHealth.updateHealthBar(); if (playerHealth.hp >= 100) { LK.showGameOver('You Are Buck!'); } else if (playerHealth.hp <= 0) { LK.showGameOver('You Are Buck!'); } if (playerHealth.hp <= 0) { LK.showGameOver(); } beat.destroy(); beats.splice(a, 1); } else if (beat.y > 2732) { score -= 50; scoreTxt.setText(score.toString()); if (score <= 0) { LK.showGameOver('Game Over! Your score reached 0.'); } beat.destroy(); beats.splice(a, 1); } } if (LK.ticks % 60 == 0) { var columnWidth = 2048 / 4; var columnIndex = Math.floor(Math.random() * 4); var newBeat; switch (columnIndex) { case 0: newBeat = new BeatColumn1(); break; case 1: newBeat = new BeatColumn2(); break; case 2: newBeat = new BeatColumn3(); break; case 3: newBeat = new BeatColumn4(); break; } newBeat.x = columnIndex * columnWidth + columnWidth / 2; newBeat.y = 0; beats.push(newBeat); self.addChild(newBeat); } }); stage.on('down', function (obj) { var event = obj.event; var pos = event.getLocalPosition(self); var columnWidth = 2048 / 4; var columnIndex = Math.floor(pos.x / columnWidth); player.x = columnIndex * columnWidth + columnWidth / 2; }); });
===================================================================
--- original.js
+++ change.js
@@ -23,33 +23,33 @@
var self = Container.call(this);
var beatGraphics = self.createAsset('beatColumn1', 'Beat Graphics Column 1', .5, .5);
self.speed = 5;
self.move = function () {
- self.y += self.gameTimer <= 100 ? self.speed * 2 : self.speed;
+ self.y += self.speed;
};
});
var BeatColumn2 = Container.expand(function () {
var self = Container.call(this);
var beatGraphics = self.createAsset('beatColumn2', 'Beat Graphics Column 2', .5, .5);
self.speed = 5;
self.move = function () {
- self.y += self.gameTimer <= 100 ? self.speed * 2 : self.speed;
+ self.y += self.speed;
};
});
var BeatColumn3 = Container.expand(function () {
var self = Container.call(this);
var beatGraphics = self.createAsset('beatColumn3', 'Beat Graphics Column 3', .5, .5);
self.speed = 5;
self.move = function () {
- self.y += self.gameTimer <= 100 ? self.speed * 2 : self.speed;
+ self.y += self.speed;
};
});
var BeatColumn4 = Container.expand(function () {
var self = Container.call(this);
var beatGraphics = self.createAsset('beatColumn4', 'Beat Graphics Column 4', .5, .5);
self.speed = 5;
self.move = function () {
- self.y += self.gameTimer <= 100 ? self.speed * 2 : self.speed;
+ self.y += self.speed;
};
});
var Player = Container.expand(function () {
var self = Container.call(this);
@@ -68,8 +68,14 @@
self.updateTimer = function () {
if (self.gameTimer > 0) {
self.gameTimer--;
self.timerText.setText(self.gameTimer.toString());
+ if (self.gameTimer == 100) {
+ BeatColumn1.prototype.speed = 10;
+ BeatColumn2.prototype.speed = 10;
+ BeatColumn3.prototype.speed = 10;
+ BeatColumn4.prototype.speed = 10;
+ }
} else {
LK.showGameOver('You Are Buck!');
}
};
a forward facing brick with the writing "Stomp" Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a forward facing brick with the writing "Jab" Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A Krump Dancer wearing a snapback and Timberlands shoes Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a forward facing brick with the writing "Chest Pop" Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a forward facing brick with the writing "Arm Swing" Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
an urban street road near a boom box Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a concrete floor Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.