User prompt
update the wind bar percent text
User prompt
update the sixth finger strengh bar
User prompt
The sixth finger bar behavior not work. Redo it all for being like the power bar
User prompt
Fix Bug: 'Timeout.tick error: sixthFingerLabel is not defined' in this line: 'sixthFingerLabel.setText('Sixth Finger Strength: ' + Math.round(self.progress) + '%');' Line Number: 206
User prompt
show the sxith finger bar percent text
User prompt
update the stith finger bar and show the percent be update to the increment and decrement
User prompt
update all the bar after launch
User prompt
Fix Bug: 'TypeError: self.sixthFingerBar.show is not a function' in this line: 'self.sixthFingerBar.show();' Line Number: 315
User prompt
all the bar need the same comportment than the power bar
User prompt
update the skin humidty bar like the power bar
User prompt
update and show the skin humidyty bar
User prompt
update and show the skin humidyty bar percent
User prompt
the skin humidyty has to update in the same way the the power bar
User prompt
the sith finger bar need to have the same comportment that the power bar
User prompt
show the percent of the sixth finger bar
User prompt
show the percent off all the bars
User prompt
show the incerment and increment percent update of the bars
User prompt
show the percent off all the bar only one time
User prompt
show the percent off all the bars
User prompt
show all the percent off the all bars
User prompt
The bar have to stop increment and decrementing after being click
User prompt
all the bar have to be 150 pixel up
User prompt
al the bar has to bee 200 pixel upper
User prompt
reduce the space bewten all the bar by half
User prompt
the bar has to have all the same space betwen them
var SkinHumidityBar = Container.expand(function () {
var self = Container.call(this);
var skinHumidityBarGraphics = self.createAsset('skinHumidityBar', 'Skin humidity bar display', 0, 0.5);
var skinHumidityLabel = new Text2('Skin Humidity', {
size: 400,
fill: "#ffffff",
align: 'center'
});
skinHumidityLabel.anchor.set(0.5, 0);
skinHumidityLabel.x = 1024;
skinHumidityLabel.y = self.height;
self.addChild(skinHumidityLabel);
self.width = 375;
self.height = 75;
self.x = 1024 - self.width / 2;
self.y = 2732 - (4 * self.height + 3 * 100);
self.visible = false;
self.isShowing = false;
self.progress = 50;
self.show = function () {
self.visible = true;
self.isShowing = true;
self.incrementProgress = LK.setInterval(function () {
if (self.progress < 100 && self.direction !== -1) {
self.updateProgress(self.progress + 2);
} else if (self.progress >= 100) {
self.direction = -1;
}
if (self.progress > 0 && self.direction === -1) {
self.updateProgress(self.progress - 2);
} else if (self.progress <= 0) {
self.direction = 1;
}
}, 50);
};
self.hide = function () {
self.visible = false;
self.isShowing = false;
LK.clearInterval(self.incrementProgress);
};
self.updateProgress = function (value) {
self.progress = value;
skinHumidityBarGraphics.scale.x = self.progress / 100;
skinHumidityLabel.setText('Skin Humidity: ' + self.progress + '%');
};
});
var SixthFingerBar = Container.expand(function () {
var self = Container.call(this);
var sixthFingerBarGraphics = self.createAsset('sixthFingerBar', 'Sixth finger bar display', 0, 0.5);
var sixthFingerLabel = new Text2('Sixth Finger Strength', {
size: 400,
fill: "#ffffff",
align: 'center'
});
sixthFingerLabel.anchor.set(0.5, 0);
sixthFingerLabel.x = 1024;
sixthFingerLabel.y = -self.height;
self.addChild(sixthFingerLabel);
self.width = 375;
self.height = 75;
self.x = 1024 - self.width / 2;
self.y = 2732 - (3 * self.height + 2 * 100);
self.visible = false;
self.isShowing = false;
self.progress = 50;
self.show = function () {
self.visible = true;
self.isShowing = true;
self.incrementProgress = LK.setInterval(function () {
if (self.progress < 100 && self.direction !== -1) {
self.updateProgress(self.progress + 6);
} else if (self.progress >= 100) {
self.direction = -1;
}
if (self.progress > 0 && self.direction === -1) {
self.updateProgress(self.progress - 6);
} else if (self.progress <= 0) {
self.direction = 1;
}
}, 50);
};
self.hide = function () {
self.visible = false;
self.isShowing = false;
LK.clearInterval(self.incrementProgress);
};
self.updateProgress = function (value) {
self.progress = value;
sixthFingerBarGraphics.scale.x = self.progress / 100;
sixthFingerLabel.setText('Sixth Finger Strength: ' + self.progress + '%');
};
});
var WindBar = Container.expand(function () {
var self = Container.call(this);
var windBarGraphics = self.createAsset('windBar', 'Wind bar display', 0, 0.5);
var windLabel = new Text2('Wind', {
size: 400,
fill: "#ffffff",
align: 'center'
});
windLabel.anchor.set(0.5, 0);
windLabel.x = 1024;
windLabel.y = -self.height;
self.addChild(windLabel);
self.width = 375;
self.height = 75;
self.x = 1024 - self.width / 2;
self.y = 2732 - (2 * self.height + 100);
self.visible = false;
self.isShowing = false;
self.strength = 50;
self.direction = 1;
self.show = function () {
self.visible = true;
self.isShowing = true;
self.updateWind = LK.setInterval(function () {
if (self.strength < 100 && self.direction !== -1) {
self.strength++;
} else if (self.strength >= 100) {
self.direction = -1;
}
if (self.strength > 1 && self.direction === -1) {
self.strength--;
} else if (self.strength <= 1) {
self.direction = 1;
}
windBarGraphics.scale.x = self.strength / 100;
windBarGraphics.scale.x *= self.direction;
windLabel.setText('Wind: ' + self.strength + '%');
}, 50);
};
self.hide = function () {
self.visible = false;
self.isShowing = false;
LK.clearInterval(self.updateWind);
};
self.updateWindDisplay = function () {};
});
var RestartButton = Container.expand(function () {
var self = Container.call(this);
var buttonGraphics = self.createAsset('restartButton', 'Restart button', 0.5, 0.5);
self.x = 2048 / 2;
self.y = 2732 - 200;
buttonGraphics.on('down', function () {
LK.showGameOver();
});
});
var PowerBar = Container.expand(function () {
var self = Container.call(this);
var powerBarGraphics = self.createAsset('powerBar', 'Power bar display', 0, 0.5);
var powerLabel = new Text2('Power', {
size: 400,
fill: "#ffffff",
align: 'center'
});
powerLabel.anchor.set(0.5, 0);
powerLabel.x = 1024;
powerLabel.y = -self.height;
self.addChild(powerLabel);
self.width = 375;
self.height = 75;
self.x = 1024 - self.width / 2;
self.y = 2732 - self.height;
self.visible = false;
self.isShowing = false;
self.progress = 50;
self.show = function () {
self.visible = true;
self.isShowing = true;
self.incrementProgress = LK.setInterval(function () {
if (self.progress < 100 && self.direction !== -1) {
self.updateProgress(self.progress + 3);
} else if (self.progress >= 100) {
self.direction = -1;
}
if (self.progress > 0 && self.direction === -1) {
self.updateProgress(self.progress - 3);
} else if (self.progress <= 0) {
self.direction = 1;
}
}, 50);
};
self.hide = function () {
self.visible = false;
self.isShowing = false;
LK.clearInterval(self.incrementProgress);
};
self.updateProgress = function (value) {
self.progress = value;
powerBarGraphics.scale.x = self.progress / 100;
powerLabel.setText('Power: ' + self.progress + '%');
};
});
var Hand = Container.expand(function () {
var self = Container.call(this);
self.move = function (position, stone) {
self.x = position.x;
if (!stone.isLaunched) {
stone.x = self.x;
}
};
var handGraphics = self.createAsset('hand', 'Moving hand at the bottom', 0.5, 0.5);
self.x = 0;
self.y = 2732 - handGraphics.height / 2;
self.direction = 1;
self.speed = 5;
});
var Stone = Container.expand(function () {
var self = Container.call(this);
self.launch = function (hand, powerBarProgress, windBarStrength, sixthFingerBarProgress, skinHumidityBarProgress) {
self.x = hand.x;
self.y = hand.y;
self.direction = -Math.PI / 2;
var averagePower = (powerBarProgress + windBarStrength + sixthFingerBarProgress + skinHumidityBarProgress) / 4;
self.launchPower = averagePower * 19.2;
self.speedX = self.launchPower * Math.cos(self.direction) * 0.01;
self.speedY = -self.speedY * 0.7;
self.isLaunched = true;
self.distanceTraveled = 0;
self.bounceChance = 1;
LK.setScore(0);
};
var stoneGraphics = self.createAsset('stone', 'Stone for ricochet', .5, .5);
self.speedX = 0;
self.speedY = 0;
self.direction = 0;
self.isLaunched = false;
self.move = function (lake) {
self.x += self.speedX;
self.y += self.speedY;
self.speedX *= 0.90;
self.launchPower *= 0.95;
if (self.isLaunched) {
self.speedY += self.launchPower * 50;
}
if (self.isLaunched) {
self.distanceTraveled += self.speed;
LK.setScore(Math.floor(self.distanceTraveled));
if (lake.checkRicochet(self) && Math.random() < self.bounceChance) {
self.direction = -Math.PI / 2;
self.speedX = self.launchPower * Math.cos(self.direction) * 0.01;
self.speedY = self.launchPower * Math.sin(self.direction) * 0.01;
self.bounceChance = 1;
}
if (Math.abs(self.speedY) < 0.1) {
self.speedX = 0;
self.speedY = 0;
if (!self.isStopped) {
LK.setTimeout(function () {
LK.showGameOver();
}, 2000);
self.isStopped = true;
}
}
}
};
});
var Lake = Container.expand(function () {
var self = Container.call(this);
var lakeGraphics = self.createAsset('lake', 'Lake for stone ricochet', .5, .5);
self.checkRicochet = function (stone) {
if (stone.intersects(this)) {
return true;
}
return false;
};
});
var Game = Container.expand(function () {
var self = Container.call(this);
self.windBar = null;
self.sixthFingerBar = null;
self.powerBar = self.addChild(new PowerBar());
self.powerBar.isShowing = false;
self.powerBar.hide();
self.powerBar.show = function () {
self.powerBar.visible = true;
self.powerBar.isShowing = true;
};
self.powerBar.hide = function () {
self.powerBar.visible = false;
self.powerBar.isShowing = false;
};
LK.stageContainer.setBackgroundColor(0x008080);
var lake = self.addChild(new Lake());
lake.x = 2048 / 2;
lake.y = 2732 / 2;
var hand = self.addChild(new Hand());
self.powerBar = self.addChild(new PowerBar());
var stone = self.addChild(new Stone());
stone.x = hand.x;
stone.y = hand.y;
self.scoreTxt = new Text2('0', {
size: 150,
fill: "#00ff00"
});
LK.gui.topCenter.addChild(self.scoreTxt);
LK.gui.topCenter.addChild(self.scoreTxt);
var isGameOver = false;
var ricochets = 0;
var restartButton = self.addChild(new RestartButton());
restartButton.visible = false;
LK.on('tick', function () {
if (!stone.isLaunched) {}
stone.move(lake);
if (stone.isLaunched) {
var distance = Math.sqrt(Math.pow(stone.x - hand.x, 2) + Math.pow(stone.y - hand.y, 2));
LK.setScore(Math.floor(distance));
self.scoreTxt.setText(LK.getScore().toString());
}
});
var clickCount = 0;
stage.on('down', function (obj) {
clickCount++;
if (clickCount === 2) {
self.windBar = self.addChild(new WindBar());
self.windBar.show();
} else if (clickCount === 3) {
self.sixthFingerBar = self.addChild(new SixthFingerBar());
self.sixthFingerBar.show();
} else if (clickCount === 4) {
self.skinHumidityBar = self.addChild(new SkinHumidityBar());
self.skinHumidityBar.show();
}
if (!stone.isLaunched && self.powerBar && self.powerBar.isShowing === false && clickCount === 1) {
self.powerBar.show();
} else if (!stone.isLaunched && self.powerBar.isShowing && clickCount === 5) {
stone.launch(hand, self.powerBar.progress, self.windBar ? self.windBar.strength : 50, self.sixthFingerBar ? self.sixthFingerBar.progress : 50, self.skinHumidityBar ? self.skinHumidityBar.progress : 50);
self.powerBar.hide();
}
});
stage.on('move', function (obj) {
var event = obj.event;
var pos = event.getLocalPosition(self);
hand.move({
x: pos.x
}, stone);
});
});
A nice lake Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A hand Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small stone Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A power bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A power bar Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A restart button Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.