Code edit (1 edits merged)
Please save this source code
User prompt
Create a new UprootButton class that has the same logic as the PlanterButton
User prompt
Duplicate the PlanterButton as UprootButton and PlanterButton classes
Code edit (9 edits merged)
Please save this source code
User prompt
Please remove PLOT_EXTRA_LINGER
Code edit (4 edits merged)
Please save this source code
User prompt
When collecting a fruit, create a PopupEffect (adding it to the effectsList) above the player
User prompt
create a PopupEffect class inheriting from the ConfigContainer class and taking in a fruitName and config params. The class contains a SymbolText element which slowly increases it's y value and disappears after 1 second
Code edit (1 edits merged)
Please save this source code
User prompt
after performing the player collection check, fruit should fall towards the planet at a fixed rate, stopping when it reaches the planet's radius distance
User prompt
fruit should fall towards the planet at a fixed rate
Code edit (9 edits merged)
Please save this source code
User prompt
In the planterButtonCallback function, instead of setting the targetPoint to 0, set targetPoint to the angle between the planet and the self's positions
Code edit (1 edits merged)
Please save this source code
User prompt
When a fruit is collected, increment the cropsHarvested stat
User prompt
When the trader buttoncallback is called, increment the salesRejected stat if the accepted param is false, otherwise increment the salesDone stat if it was fully completed
User prompt
When an asteroid impacts the planet, increase the stats.asteroidImpacts value by 1
Code edit (10 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: trader.handleTradeCallback is not a function' in or related to this line: 'trader.handleTradeCallback(false);' Line Number: 1946
Code edit (4 edits merged)
Please save this source code
User prompt
Add an LK.timeout of 500ms before creating the player in the ship
Code edit (1 edits merged)
Please save this source code
Code edit (9 edits merged)
Please save this source code
User prompt
The TraderDialogue's setTint should flash the dialogueBackground object the tint colour for 500ms
Code edit (9 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -44,9 +44,8 @@
textAssets[i].setText(newText);
}
}
function setFill(newFill) {
- console.log(newFill);
textFill = newFill;
mainAsset.fill = newFill;
}
function buildTextAssets(newText) {
@@ -410,9 +409,9 @@
function refreshGraphics() {
if (self.graphics) {
self.graphics.destroy();
}
- self.graphics = self.createAsset(self.type + (self.growStage - 1), {
+ self.graphics = self.createAsset(self.type + self.growStage, {
anchorX: 0.5,
anchorY: 1,
scaleX: Math.random() < 0.5 ? 1 : -1
});
@@ -1281,9 +1280,9 @@
self.destroy();
}
}
if (traderDialogue) {
- traderDialogue.setTint(checkValue(trade.sellName, trade.sellAmount) ? TEXT_DEFAULT_FILL : '#FF0000');
+ traderDialogue.setTint(checkValue(trade.sellName, trade.sellAmount) ? 0xFFFFFF : 0xFF0000);
}
}
function handleTradeCallback(accepted) {
var closeDialogue = false;
@@ -1322,9 +1321,9 @@
} else if (buyName === 'credits') {
// Player selling Fruit for Credits
var value = valueFactor * FRUIT_DETAILS[sellName].value;
var quantity = Math.max(1, inventory.getQuantity(sellName));
- sellAmount = randomInt(Math.max(1, quantity * TRADER_INVENTORY_MIN), quantity * TRADER_INVENTORY_MAX);
+ sellAmount = Math.max(TRADER_MINIMUM_BUY, randomInt(quantity * TRADER_INVENTORY_MIN, quantity * TRADER_INVENTORY_MAX));
buyAmount = Math.round(sellAmount * value);
} else {
// Fruit exchange
var multiplier = 1 + Math.random() * (TRADER_EXCHANGE_MULTIPLIER - 1);
@@ -1396,8 +1395,9 @@
self.setTint = setTint;
;
function setTint(tint) {
tradeSell.setFill(tint);
+ LK.effects.flashObject(dialogueBackground, tint, 500);
}
function createTradePart(name, amount, config) {
if (name === 'credits') {
return tradeSymbols.addChild(new SymbolText(amount, 'currencySymbol', {
@@ -1505,11 +1505,11 @@
var CROSSHAIR_PERIOD = 1.25 * GAME_TICKS / MATH_2_PI;
;
// Inventory settings
var INVENTORY_ROWS = 1;
-var INVENTORY_COLS = 8;
-var INVENTORY_ICON_SCALE = 0.5;
-var INVENTORY_SLOT_SIZE = 100;
+var INVENTORY_COLS = 7;
+var INVENTORY_ICON_SCALE = 0.55;
+var INVENTORY_SLOT_SIZE = 115;
;
// Asteroid settings
var ASTEROID_SPAWN_CHANCE = 0.001;
var ASTEROID_DROP_CHANCE = 0.1; // 10% chance
@@ -1536,8 +1536,9 @@
var TRADER_TIME_MAX = 50 * GAME_TICKS;
var TRADER_COST_VARIANCE = 0.1;
var TRADER_INVENTORY_MIN = 0.25;
var TRADER_INVENTORY_MAX = 1.5;
+var TRADER_MINIMUM_BUY = 5;
var TRADER_FRUIT_OFFER_MIN = 1;
var TRADER_FRUIT_OFFER_MAX = 3;
var TRADER_EXCHANGE_MULTIPLIER = 5;
var TRADER_FRAME_OFFSET_X = 0.1;
@@ -1591,9 +1592,9 @@
growthVariance: 10 * GAME_TICKS
},
plantFlower: {
blueprint: PlantFlower,
- stages: 4,
+ stages: 6,
fruit: 'fruitFlower',
growthTime: 40 * GAME_TICKS,
growthVariance: 10 * GAME_TICKS
},
@@ -1618,9 +1619,9 @@
},
fruitStalk: {
value: 5,
type: 'red',
- plant: 'plantBean'
+ plant: 'plantStalk'
},
fruitEyeball: {
value: 15,
type: 'red',
@@ -1706,9 +1707,10 @@
cropsHarvested: 0,
cropsOverrun: 0,
weedsPulled: 0,
salesDone: 0,
- salesRejected: 0
+ salesRejected: 0,
+ distanceRun: 0
};
var winningStats = {};
var winningTick = -1;
var winningTime = '';
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.