User prompt
Make arrows twice as tall
User prompt
Make block_obstacle move faster and faster as it falls
User prompt
Extend arrows to be as tall as the screen
User prompt
Extend arrow size higher
User prompt
Make arrows complete cover the screen
User prompt
Make arrows take up half of the screen each against the sides
User prompt
Delete right_arrow and left_arrow assets
User prompt
Undo arrow movement
User prompt
Fix Bug: 'TypeError: LK.requestAnimationFrame is not a function. (In 'LK.requestAnimationFrame(movePlayerRight)', 'LK.requestAnimationFrame' is undefined)' in this line: 'LK.requestAnimationFrame(movePlayerRight);' Line Number: 98
User prompt
Make arrows control player movement by tap and hold
User prompt
Make arrows transparent
User prompt
Make arrow display against the sides of the screen
User prompt
Make arrows take of half of the screen each
User prompt
Hold arrows instead of tap
User prompt
Add arrows on either side to control movement
User prompt
Delete joystick
User prompt
Add joysticks to control player movement
User prompt
If either side of the screen is tapped or held on, move the player left or right
User prompt
Make player move when holding
User prompt
Make player move when either side of the screen is held
User prompt
Change Tap control to Hold
===================================================================
--- original.js
+++ change.js
@@ -60,43 +60,8 @@
self.getGamesPlayed = function () {
return self.gamesPlayed;
};
});
-// Joystick class
-var Joystick = Container.expand(function () {
- var self = Container.call(this);
- var joystickGraphics = self.createAsset('joystick_base', 'Joystick base', 0.5, 0.5);
- var knob = self.createAsset('joystick_knob', 'Joystick knob', 0.5, 0.5);
- knob.x = joystickGraphics.width / 2;
- knob.y = joystickGraphics.height / 2;
- self.isDragging = false;
- self.on('down', function (obj) {
- self.isDragging = true;
- var pos = obj.event.getLocalPosition(self);
- knob.x = pos.x;
- knob.y = pos.y;
- });
- self.on('move', function (obj) {
- if (self.isDragging) {
- var pos = obj.event.getLocalPosition(self);
- knob.x = pos.x;
- knob.y = pos.y;
- }
- });
- self.on('up', function () {
- self.isDragging = false;
- knob.x = joystickGraphics.width / 2;
- knob.y = joystickGraphics.height / 2;
- });
- self.getDirection = function () {
- var dx = knob.x - joystickGraphics.width / 2;
- var dy = knob.y - joystickGraphics.height / 2;
- return {
- x: dx,
- y: dy
- };
- };
-});
/****
* Initialize Game
****/
@@ -108,11 +73,8 @@
* Game Code
****/
// Game variables
var player = game.addChild(new Player());
-var joystick = game.addChild(new Joystick());
-joystick.x = 200; // Position joystick on the left
-joystick.y = 2732 - 200; // Position joystick near the bottom
player.x = 1024; // Center of the screen
player.y = 2732 - 100; // Near the bottom of the screen
var obstacles = [];
var isGameOver = false;
@@ -127,12 +89,8 @@
LK.effects.flashScreen(0x00ff00, 1000);
LK.showGameOver();
return;
}
-
- // Update player with joystick direction
- var joystickDirection = joystick.getDirection();
- player.update(joystickDirection);
stopwatch.updateTime();
// Generate obstacles
if (LK.ticks % 60 == 0) {