Code edit (3 edits merged)
Please save this source code
User prompt
In the fruit constructor, set the default graphic's rotation to face toward the planet
Code edit (3 edits merged)
Please save this source code
User prompt
In the Inventory class, display a BorderedText underneath the slots which says: "Cannot grow on this planet" and toggle its visibility in the refreshAllowed slot based on `allowedTypes.includes(itemType)`
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: baseNode is undefined' in or related to this line: 'if (!baseNode.tryAction()) {' Line Number: 163
User prompt
Fix Bug: 'ReferenceError: type is not defined' in or related to this line: 'selector.toggleAllowed(allowedTypes.includes(type));' Line Number: 839
Code edit (6 edits merged)
Please save this source code
User prompt
add an empty background container to the planet (created before the graphic is set). When transitionPlanets is called, the ship should be added to the new planet's background as a child
Code edit (1 edits merged)
Please save this source code
User prompt
Create a new InventorySelector class. The selector and cross assets should be moved into there and replaced with this class
User prompt
Add a cross asset to the inventory. It should be added to the same parent as the selector
User prompt
Remove the console.log
Code edit (4 edits merged)
Please save this source code
User prompt
plant class refreshGraphics should also randomly flip the x scale
Code edit (5 edits merged)
Please save this source code
User prompt
When the farmGraphics are clicked, call the tryPlantFruit function
Code edit (3 edits merged)
Please save this source code
User prompt
explosions should have their initial rotation set to face the planet
User prompt
explosions should start with 0.5 alpha and fade it out over its lifetime and also double its scale over its lifetime
User prompt
Create a global effectsList array and call updateList(effectsList) in the on tick callback. Explosion effects should be added to this list in their constructor
User prompt
When asteroids impact, they should create an explosion effect where they landed
User prompt
Move the angle, and fruitX,Y calculations into the if statement for fruitDiamondDust creation
User prompt
Instead of asteroids always creating a diamondDustFruit on impact, add a ASTEROID_DROP_CHANCE global of 0.1 (10% chance)
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -252,9 +252,10 @@
if (self.harvestable) {
if (self.growStage === self.growStages) {
new Fruit(self.fruit, {
x: self.parent.x,
- y: self.parent.y
+ y: self.parent.y,
+ rotation: self.parent.rotation
});
}
self.destroy();
return true;
@@ -964,9 +965,9 @@
var self = ConfigContainer.call(this, config);
var fruitGraphics = self.attachAsset(fruitName, {
anchorX: 0.5,
anchorY: 0.5,
- rotation: Math.atan2(self.y - planet.y, self.x - planet.x)
+ rotation: MATH_HALF_PI
});
fruitGraphics.scale.set(PLANT_FRUIT_SCALE);
;
self.fruitName = fruitName;
pixel art of a tiny planet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a planet. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of an alien currency symbol. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a planet made of gold ore. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
plain black background with stars. 2d repeating Texture.
pixel art of a asteroid. Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a cute alien farmer, side view. Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a rocky explosion.. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art flame particle. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a large white, empty, rectangular, speech bubble. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
pixel art of a red chevron. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
Pixel art of yellow grapes. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.