Code edit (1 edits merged)
Please save this source code
User prompt
particle's update function should make them spread briefly and then disappear.
Code edit (9 edits merged)
Please save this source code
User prompt
create a function that creates a small dust particle explosion
Code edit (7 edits merged)
Please save this source code
User prompt
Please fix the bug: 'ReferenceError: austroanut is not defined' in or related to this line: 'if (austroanut.y < 818) {' Line Number: 196
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
update the score and scorelabel text every frame when thrown is true.
Code edit (13 edits merged)
Please save this source code
User prompt
make a score label top center of screen
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (10 edits merged)
Please save this source code
User prompt
create an actionmeter at the bottom of the screen
Code edit (11 edits merged)
Please save this source code
User prompt
make a text label at the bottom of the screen: "Tap to throw the javelin"
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
update the javelin.moce() function so that the javelin orbits the moon.
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
Add the astronaut to the scene
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -25,15 +25,19 @@
self.gravity = 0.1; // Simulate low gravity on the moon
self.rotation = -0.30;
self.orbitSpeed = 0.045;
self.angle = 4.6;
+ self.radius = 570; //670 - 20 * (100 / 20);
+ console.log('radius ' + self.radius);
self.move = function () {
- self.radius = 670 - 20 * (100 / 20);
- self.angle = (self.angle || 0) + self.orbitSpeed;
+ //self.radius = 670 - 20 * (100 / 20);
+ //self.angle = (self.angle || 0) + self.orbitSpeed;
+ self.angle = (self.angle || 0) + speed;
self.angle %= Math.PI * 2;
self.x = moonSurface.x + self.radius * Math.cos(self.angle);
self.y = moonSurface.y + self.radius * Math.sin(self.angle);
- self.rotation = self.angle + Math.PI / 2;
+ self.rotation = self.angle + Math.PI / 2 + 0.2;
+ self.radius -= 0.075;
};
});
// Moon surface class for visual effect
var MoonSurface = Container.expand(function () {
@@ -96,8 +100,15 @@
fill: "#ffffff"
});
instructionTxt.anchor.set(0.5, 3); // Sets anchor to the center of the bottom edge of the text.
LK.gui.bottom.addChild(instructionTxt);
+// Create a score label at the top center of the screen
+var scoreTxt = new Text2('0', {
+ size: 65,
+ fill: "#ffffff"
+});
+scoreTxt.anchor.set(0.5, 0); // Sets anchor to the center of the top edge of the text.
+LK.gui.top.addChild(scoreTxt);
// Create an action meter at the bottom of the screen
var actionMeter = new Container();
var actionMeterGraphics = actionMeter.attachAsset('actionMeter', {
anchorX: 0.5,
@@ -129,9 +140,9 @@
instructionTxt.alpha = 0;
actionMeter.alpha = 1;
actionMeterPointer.alpha = 1;
} else if (!thrown) {
- speed = minSpeed + 1150 / (actionMeterPointer.x - 450) * (maxSpeed - minSpeed);
+ speed = minSpeed + (actionMeterPointer.x - 450) / 1150 * (maxSpeed - minSpeed);
//speed = maxSpeed - speed;
console.log('speed ' + speed);
launchJavelin();
} else {}
pixelart. a beautiful moon.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart a beautiful starry sky seen in empty outer space.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. a javelin used for olympic games and athletics. Just the spear itself, horizontally laid out in the image. It should be a slim metal spear, pointy in both ends, and with a grip somewhere off center of the shaft.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. a metallic triangular pointer.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart lettering of the word 'LUNAR' with some blank space around it.
replace inpainted area with transparency.
pixelart. asteroid with craters. subtle shading.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixelart. asteroid with craters. subtle shading.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
A small light yellow star.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
delete the inpainted areas.
Pixelart. A background window for an in-game shop, with a space theme. The center part should be a large blank area with space for the items and labels for sale in the game shop. The blank space could have the form of a black computer screen inside a spaceship.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixelart. An icon of a an arm holding javelin with fire around it.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Turn in-painted area solid blue like the area around it.
Pixelart. A rectangular silvery button with the text 'CLOSE'.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.