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
User prompt
Fix Bug: 'TypeError: mainAsset.fill is undefined' in or related to this line: 'mainAsset.fill.set(textFill = newFill);' Line Number: 110
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
The traderGraphics should start at scaleX,scaleY of 0,0 and be set in the update statement to: `1 - counter / TRADER_SPAWN_TIME` after setting the position
Code edit (7 edits merged)
Please save this source code
User prompt
The traderGraphics should start at a random point within TRADER_SPAWN_RADIUS, and move towards the 0,0 position over TRADER_SPAWN_TIME
User prompt
Add 5 globals: `TRADER_SPAWN_RADIUS = 1000`, `TRADER_SPAWN_TIME = 2 * GAME_TICKS`, `TRADER_MOVE_ANCHOR = 0.25`, `TRADER_MOVE_ROTATION = 0.15` and `TRADER_MOVE_INTERVAL = 5`
User prompt
Fix Bug: 'ReferenceError: trader is not defined' in or related to this line: 'var traderGraphics = self.attachAsset('trader', {' Line Number: 1300
User prompt
Trader graphics should start off screen and move towards it's 0,0 point
Code edit (1 edits merged)
Please save this source code
Code edit (13 edits merged)
Please save this source code
User prompt
Fix Bug: 'SecurityError: Permission denied to access property "removeChild" on cross-origin object' in or related to this line: 'baseDestroy();' Line Number: 529
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: t is undefined' in or related to this line: 'symbolAsset = self.attachAsset(newSymbol, {' Line Number: 183
Code edit (2 edits merged)
Please save this source code
User prompt
in the transitionPlanets function, destroy all traders and reset the array
User prompt
in the transitionPlanets function, destroy all asteroids and reset the array
Code edit (6 edits merged)
Please save this source code
User prompt
Remove any remaining console logs
Code edit (1 edits merged)
Please save this source code
Code edit (4 edits merged)
Please save this source code
User prompt
Add an asset with id "point" to BorderedSymbol and SymbolText
===================================================================
--- 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.