Code edit (8 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'addChild')' in or related to this line: 'LK.gui.topleft.addChild(coinsTxt);' Line Number: 553
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
make a class for an upgrade button
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'length')' in or related to this line: 'var itemGraphic = self.attachAsset(id, {' Line Number: 215
Code edit (3 edits merged)
Please save this source code
User prompt
add a class for a shopitem
Code edit (1 edits merged)
Please save this source code
User prompt
add a background graphic object for the shopwindow.
User prompt
make a class for a shopwindow object
Code edit (12 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'move_temp')' in or related to this line: 'ufo.move_temp();' Line Number: 489
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'STAR')' in or related to this line: 'self.type = enums.STAR;' Line Number: 189
Code edit (3 edits merged)
Please save this source code
User prompt
write a collision detection check between javelin and the starpowerups where it says 'todo:colliion detection here' in the code
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -216,9 +216,9 @@
self.scaleUp = Math.random() < 0.5 ? true : false;
self.scale.x = 0.4 + Math.random();
self.scale.y = self.scale.x;
self.scaleSpeed = 0.01 + Math.random() * 0.02;
- self.alpha = 0.5;
+ self.alpha = 1; //0.75;
self.reset = function () {
self.rotSpeed = 0.1 - Math.random() * 0.2;
self.speed = Math.random() * 5;
self.scaleUp = Math.random() < 0.5 ? true : false;
@@ -232,18 +232,15 @@
var ufoGraphics = self.attachAsset('ufoimage', {
anchorX: 0.5,
anchorY: 0.5
});
- self.x = 1000;
- self.y = 2710 / 2;
self.moveScale = 0;
- //self.scale = 0;
- self.move_temp = function () {
+ self._move_migrated = function () {
var t = LK.ticks / 100;
- //self.scale = 2 / (3 - Math.cos(2 * t));
+ //self.scale = 1200 / (3 - Math.cos(2 * t));
self.moveScale = 1800 / (3 - Math.cos(2 * t));
- self.x = 2048 / 2 + self.moveScale * Math.cos(t);
- self.y = 2780 / 2 + self.moveScale * Math.sin(2 * t) / 2;
+ self.x = 1024 + self.moveScale * Math.cos(t);
+ self.y = 1340 + self.moveScale * Math.sin(2 * t) / 2;
//console.log(self.x, self.y);
};
});
@@ -306,9 +303,9 @@
anchorX: 0.5,
anchorY: 0.5,
x: 974,
y: 1366,
- alpha: 0.5
+ alpha: 0.55
});
var moonSurface = game.addChild(new MoonSurface());
// Add the astronaut to the scene
var astronaut = game.addChild(new Astronaut());
@@ -340,22 +337,29 @@
javelin.x = astronaut.x - 70;
javelin.y = astronaut.y;
var started = false;
var thrown = false;
+var STARS_ON = false;
+var ASTEROIDS_ON = false;
+var UFO_ON = false;
var particles = [];
// TODO: After the first throw, if player survived, instead of going to game over, maybe offer a second launch,
// this time with an incoming asteroid field or lumnious field (powerups) in order to introduce those sequentially.
// There could even be text clues to introduce them. 'The javelin will accellerate passing through those energy fields.'
// Those asteroids are brittle. etc.
-for (var i = 0; i < 30; i++) {
- var starPowerup = new StarPowerup();
- starpowerups.push(starPowerup);
- game.addChild(starPowerup);
+if (STARS_ON) {
+ for (var i = 0; i < 30; i++) {
+ var starPowerup = new StarPowerup();
+ starpowerups.push(starPowerup);
+ game.addChild(starPowerup);
+ }
}
-for (var j = 0; j < 10; j++) {
- var asteroidPowerup = new AsteroidPowerup();
- starpowerups.push(asteroidPowerup);
- game.addChild(asteroidPowerup);
+if (ASTEROIDS_ON) {
+ for (var j = 0; j < 10; j++) {
+ var asteroidPowerup = new AsteroidPowerup();
+ starpowerups.push(asteroidPowerup);
+ game.addChild(asteroidPowerup);
+ }
}
//game.addChild(ufo);
// Create a method to launch a javelin
function launchJavelin() {
@@ -414,13 +418,14 @@
var playerHit = false;
var landedCounter = 0;
var windSpeedX = 2;
var windSpeedY = 2;
-var ufo = new Ufo();
-ufo.x = 1000;
-ufo.y = 1300;
-game.addChild(ufo);
-// Touch event to launch a javelin
+if (UFO_ON) {
+ var ufo = new Ufo();
+ ufo.x = 1000;
+ ufo.y = 1300;
+ game.addChild(ufo);
+}
game.on('down', function (x, y, obj) {
if (!started) {
started = true;
//gameLogo.alpha = 0;
@@ -505,8 +510,13 @@
instructionTxt.setText("Don't get hit! Tap to jump!");
instructionTxt.alpha = 1;
instructionTxt.y = -1200;
}
+ if (javelin.intersects(ufo)) {
+ javelin.attachAsset('aliensurfer', {
+ anchorY: 1
+ });
+ }
for (var i = starpowerups.length - 1; i >= 0; i--) {
t = starpowerups[i];
if (javelin.intersects(t)) {
if (t.type == enums.STAR) {
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.