Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: PlantNode is undefined' in or related to this line: 'var FarmNode = PlantNode.expand(function (config) {' Line Number: 168
User prompt
Rename the Farm class to FarmNode, additionally, the FarmNode should inherit from the PlantNode
User prompt
PlantNode should be inherit from ConfigContainer
Code edit (4 edits merged)
Please save this source code
User prompt
create a Fruit class which inherits from the ConfigContainer but takes in a `fruitName` as the first argument and the `config` as the second
Code edit (1 edits merged)
Please save this source code
User prompt
Add a `setItem` function to the InventorySlot class which takes in an itemName variable and, creates and attaches an asset (id of itemName) to the inventorySlot, center anchored
Code edit (4 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: setQuantity is not defined' in or related to this line: 'self.adjustQuantity = setQuantity;' Line Number: 467
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
Use bordertext instead of text2 for the quantity
User prompt
InventorySlots should display their quantities as text along their bottom edge
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: self is undefined' in or related to this line: 'self.adjustItem = function (item, quantity) {' Line Number: 541
User prompt
Add an adjustItem function to the Inventory which takes in an item (string) and a quantity (number). Check which InventorySlot has the item using the index slot, or assign it to the first available empty slot
User prompt
Add a self.item and self.quantity variables to the InventorySlot class
User prompt
Add an itemIndex map to the Inventory class
Code edit (2 edits merged)
Please save this source code
User prompt
In the asteroid update function, before the final return statement, check the distance squared between the asteroid and the planet's radius and return true
User prompt
When calling transitionPlanet, destroy all asteroids
User prompt
rename the constant `ASTEROID_SIZE` to `ASTEROID_MARGIN` and update all references that use it
Code edit (1 edits merged)
Please save this source code
User prompt
Asteroids should have a slightly random scale. Make sure to add any constants to the global
===================================================================
--- original.js
+++ change.js
@@ -454,26 +454,26 @@
anchorX: .5,
anchorY: .5
});
var selectionContainer = self.addChild(new Container());
- var quantityText = self.addChild(new BorderedText('0', {
+ var quantityText = self.addChild(new BorderedText(0, {
size: 30,
anchorX: .5,
anchorY: .5,
- y: INVENTORY_SLOT_SIZE / 2.05
+ y: INVENTORY_SLOT_SIZE / 2.2
}));
frame.width = INVENTORY_SLOT_SIZE;
frame.height = INVENTORY_SLOT_SIZE;
;
- self.setQuantity = setQuantity;
+ self.adjustQuantity = adjustQuantity;
self.selectionContainer = selectionContainer;
self.index = index;
self.item = null;
self.quantity = 0;
;
- function setQuantity(newQuantity) {
+ function adjustQuantity(newQuantity) {
self.quantity = newQuantity;
- quantityText.setText(String(newQuantity));
+ quantityText.setText(newQuantity);
}
;
self.on('down', function () {
self.parent.selectSlot(self.index);
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.