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
Code edit (1 edits merged)
Please save this source code
Code edit (1 edits merged)
Please save this source code
User prompt
Please fix the bug: 'TypeError: starpowerups[i].move_not_really_migrated_but_still is not a function' in or related to this line: 't = starpowerups[i].move_not_really_migrated_but_still();' Line Number: 353
===================================================================
--- original.js
+++ change.js
@@ -3,9 +3,10 @@
****/
var AsteroidPowerup = Container.expand(function () {
var self = Container.call(this);
//var starGraphics = self.attachAsset('starpowerup', {
- var starGraphics = self.attachAsset('asteroidpowerup', {
+ self.r = Math.random() < 0.33 ? '1' : Math.random() < 0.5 ? '2' : '3';
+ var starGraphics = self.attachAsset('asteroidpowerup' + self.r, {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * (2 * Math.PI)
});
@@ -149,12 +150,12 @@
});
self.x = 1024; // Center horizontally
self.y = 2732 / 2; // Position at the center of the screen
});
-var RockParticle = Container.expand(function () {
+var RockParticle = Container.expand(function (type) {
var self = Container.call(this);
// Create a simple square shape for the particle
- var particleGraphics = self.attachAsset('asteroidpowerup', {
+ var particleGraphics = self.attachAsset('asteroidpowerup' + type, {
anchorX: 0.5,
anchorY: 0.5
});
self.width = 25 + Math.random() * 25;
@@ -173,12 +174,12 @@
self.destroy();
}
};
});
-var StarParticle = Container.expand(function () {
+var StarParticle = Container.expand(function (type) {
var self = Container.call(this);
// Create a simple square shape for the particle
- var particleGraphics = self.attachAsset('starpowerup', {
+ var particleGraphics = self.attachAsset('starpowerup' + type, {
anchorX: 0.5,
anchorY: 0.5
});
self.width = 25 + Math.random() * 25;
@@ -199,9 +200,11 @@
};
});
var StarPowerup = Container.expand(function () {
var self = Container.call(this);
- var starGraphics = self.attachAsset('starpowerup', {
+ self.r = Math.random() < 0.5 ? '' : '1';
+ var starGraphics = self.attachAsset('starpowerup' + self.r, {
+ //var starGraphics = self.attachAsset('starpowerup', {
anchorX: 0.5,
anchorY: 0.5,
rotation: Math.random() * (2 * Math.PI)
});
@@ -230,8 +233,33 @@
self.x += windSpeedX + self.speed;
self.y += windSpeedY + self.speed;
};*/
});
+var Ufo = Container.expand(function () {
+ var self = Container.call(this);
+ var surfaceGraphics = self.attachAsset('ufo', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.vely = 0;
+ self.velx = 0;
+ self.x = 1000;
+ self.y = 2710 / 2;
+ self.scale = 0;
+ self.move = function () {
+ var t = LK.ticks;
+ self.scale = 2 / (3 - Math.cos(2 * t));
+ self.x = self.scale * Math.cos(t);
+ self.y = self.scale * Math.sin(2 * t) / 2;
+ //console.log(self.x, self.y);
+ /*
+ if (self.x < 200){
+ } else if (self.x > 1800){
+ }
+ if (self.y)
+ */
+ };
+});
/****
* Initialize Game
****/
@@ -265,20 +293,20 @@
game.addChild(particle);
particles.push(particle);
}
}
-function createStarExplosion(x, y, count) {
+function createStarExplosion(x, y, count, type) {
for (var i = 0; i < count; i++) {
- var particle = new StarParticle();
+ var particle = new StarParticle(type);
particle.x = x;
particle.y = y;
game.addChild(particle);
particles.push(particle);
}
}
-function createRockExplosion(x, y, count) {
+function createRockExplosion(x, y, count, type) {
for (var i = 0; i < count; i++) {
- var particle = new RockParticle();
+ var particle = new RockParticle(type);
particle.x = x;
particle.y = y;
game.addChild(particle);
particles.push(particle);
@@ -326,8 +354,12 @@
javelin.y = astronaut.y;
var started = false;
var thrown = 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);
@@ -336,8 +368,10 @@
var asteroidPowerup = new AsteroidPowerup();
starpowerups.push(asteroidPowerup);
game.addChild(asteroidPowerup);
}
+var ufo = new Ufo();
+game.addChild(ufo);
// Create a method to launch a javelin
function launchJavelin() {
/*var javelin = new Javelin();
javelin.x = 1024; // Launch from center horizontally
@@ -473,8 +507,9 @@
t.y = 0;
t.reset();
}
}
+ ufo.move();
if (started && !thrown) {
actionMeterPointer.x += actionMeterPointer.speed;
if (actionMeterPointer.x > 1600 || actionMeterPointer.x < 450) {
actionMeterPointer.speed *= -1;
@@ -490,16 +525,16 @@
for (var i = starpowerups.length - 1; i >= 0; i--) {
t = starpowerups[i];
if (javelin.intersects(t)) {
if (t.type == enums.STAR) {
- createStarExplosion(t.x, t.y, 10);
+ createStarExplosion(t.x, t.y, 10, t.r);
//speed += 0.001;
//javelin.radius += 1;
liftBoostActive = true;
liftBoostCounter += 10;
liftBoostResetCounter += 10;
} else if (t.type == enums.ROCK) {
- createRockExplosion(t.x, t.y, 10);
+ createRockExplosion(t.x, t.y, 10, t.r);
}
// Handle collision effect, e.g., increase score, create explosion, etc.
//LK.setScore(LK.getScore() + 50); // Example score increase
//t.destroy(); // Remove the starpowerup from the game
@@ -510,16 +545,16 @@
}
if (liftBoostActive) {
if (liftBoostCounter > 0) {
liftBoostCounter--;
- javelin.radius += 3;
- javelin.rotation += 0.1;
+ //javelin.radius += 3;
+ speed += 0.001;
} else {
lifeBoostCounter = 0;
if (liftBoostResetCounter > 0) {
liftBoostResetCounter--;
- javelin.radius -= 3;
- javelin.rotation -= 0.1;
+ //javelin.radius -= 3;
+ speed -= 0.001;
} else {
liftBoostResetCounter = 0;
liftBoostActive = false;
}
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.