User prompt
spawn 'Cactus', behaves the same way as "Bighorn"
Code edit (1 edits merged)
Please save this source code
User prompt
delete bighorn as soon as it collides with dunebuggy
User prompt
delete bighorn if collides with dunebuggy or if it leaves the screen
User prompt
if dunebuggy collides with "Bighorn", decrease Tires by 3%
User prompt
start tires at 100%
Code edit (2 edits merged)
Please save this source code
User prompt
randomly spawn 'Bighorn', drop down from top with speed 15
User prompt
if fuel =0, then game over
Code edit (2 edits merged)
Please save this source code
User prompt
decrease fuel by 1 gallon for every 3 distance
User prompt
Fuel is not showing 25
User prompt
start "Fuel:" at 25 Gallons, decrease it by 1 gallon for every 3 distance
User prompt
start Distance at 0, increase distance by 0.1 for every 1 second
User prompt
rename "Score" to "Distance:"
User prompt
add "Tires:" text below fuel
User prompt
Add "Fuel:" in white text below score
User prompt
delete "obstacle" and "supply"
User prompt
i can't see tires label
Code edit (1 edits merged)
Please save this source code
User prompt
add white text below health bar, "Tires"
Code edit (1 edits merged)
Please save this source code
User prompt
position "Fuel" next to health bar
User prompt
Put white Text "Fuel" to the left of heralth bar
User prompt
delete obstacle and supply boxes
/**** * Classes ****/ //<Assets used in the game will automatically appear here> // DuneBuggy class to represent the player's vehicle var DuneBuggy = Container.expand(function () { var self = Container.call(this); var buggyGraphics = self.attachAsset('duneBuggy', { anchorX: 0.5, anchorY: 0.5 }); self.speed = 5; self.update = function () { // Update logic for the buggy, if needed }; }); // HealthBar class to represent the fuel bar var HealthBar = Container.expand(function () { var self = Container.call(this); var healthBarGraphics = self.attachAsset('healthBar', { anchorX: 0.5, anchorY: -1.5, color: 0x00FF00, width: 500 }); self.update = function () { // Update logic for the health bar, if needed }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Add track as background var track = game.attachAsset('track', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 }); var duneBuggy = game.addChild(new DuneBuggy()); duneBuggy.x = 2048 / 2; duneBuggy.y = 2732 - 200; var obstacles = []; var supplies = []; var score = 0; var scoreTxt = new Text2('Distance: 0 Miles', { size: 100, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); // Initialize the health bar and add it to the game var healthBar = new HealthBar(); healthBar.x = 2048 / 2; healthBar.y = scoreTxt.y + scoreTxt.height + 10; // Position it under the score game.addChild(healthBar); // Add a label for the health bar var healthBarLabel = new Text2('Fuel', { size: 80, fill: "#ffffff" }); healthBarLabel.anchor.set(5.5, 0.75); healthBarLabel.x = healthBar.x - healthBar.width / 2 - 10; healthBarLabel.y = healthBar.y + healthBar.height / 2; LK.gui.top.addChild(healthBarLabel); // Add a label for the tires var tiresLabel = new Text2('Tires', { size: 80, fill: "#ffffff" }); tiresLabel.anchor.set(0.5, .75); tiresLabel.x = 2048 / 2; tiresLabel.y = healthBar.y + healthBar.height + 10; LK.gui.top.addChild(tiresLabel); game.update = function () { // Increase score by 0.1 for every 1 second if (LK.ticks % 60 == 0) { score += 0.1; scoreTxt.setText('Score: ' + score.toFixed(1)); } }; game.down = function (x, y, obj) { duneBuggy.x = x; }; game.move = function (x, y, obj) { duneBuggy.x = x; }; game.up = function (x, y, obj) { // No action needed on up event };
===================================================================
--- original.js
+++ change.js
@@ -75,9 +75,9 @@
var tiresLabel = new Text2('Tires', {
size: 80,
fill: "#ffffff"
});
-tiresLabel.anchor.set(0.5, 0);
+tiresLabel.anchor.set(0.5, .75);
tiresLabel.x = 2048 / 2;
tiresLabel.y = healthBar.y + healthBar.height + 10;
LK.gui.top.addChild(tiresLabel);
game.update = function () {
sheep
Sound effect
crash
Sound effect
yelp
Sound effect
rabbit
Sound effect
runner
Sound effect
runner
Sound effect
roar
Sound effect
airwrench
Sound effect
liquid
Sound effect
music
Music
crash2
Sound effect
yehaw
Sound effect
woohoo
Sound effect
bird
Sound effect
splat
Sound effect
splat
Sound effect
gascanbonus
Sound effect
tirebonus
Sound effect