Skip to content

Commit

Permalink
tweaked values and add todos
Browse files Browse the repository at this point in the history
  • Loading branch information
pouyamer committed May 23, 2024
1 parent 6ea4e91 commit 621bd31
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
5 changes: 5 additions & 0 deletions src/Classes/firefly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,11 @@ class FireFly {
hAfterHittingMin === "max"
? hueRange.max
: getRandomNumberBetween(hueRange)

// TODO: generalize the above code
// to apply to all color values and size
// setValueBasedOnAfterHittingMin(instruction: "max" | "random" | "initial")
// setValueBasedOnAfterHittingMax(instruction: "min" | "random" | "initial")
}

handleMaxHueReached = () => {
Expand Down
8 changes: 5 additions & 3 deletions src/Config/colorValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const colorValueConfig: ColorValueConfigType = {

hslColorRange: {
h: {
min: 0,
max: 360,
min: 100,
max: 200,
},
s: {
min: 75,
Expand Down Expand Up @@ -50,7 +50,9 @@ const colorValueConfig: ColorValueConfigType = {
},

newHslColorValueAfterHittingMax: {
h: "min",
// TODO: ADD initial mode to this and size
// initial mode: value when it was first created
h: "random",
s: "min",
l: "min",
a: "min",
Expand Down
2 changes: 1 addition & 1 deletion src/Config/shaping.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const shapingConfig: ShapingConfigType = {
shape: "regularPolygram",
shape: "circle",
regularPolygon: {
sideCount: {
min: 5,
Expand Down
14 changes: 10 additions & 4 deletions src/Config/size.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
const sizeConfig: SizeConfigType = {
range: {
min: 1,
max: 30,
max: 50,
},

startingMethod: "max",
startingMethod: "random",

sizeChangeRangeOverTime: {
min: 0,
max: 0,
min: -1.3,
max: -1,
},

// TODO: Add RecalculateSizeChangeOverTimeWhenReachedMinOrMax
// also for colorvalues

// TODO: Add newLocation spawning after size or other color values reached min or max
// - also rotation and speed may reset

newSizeAfterHitMax: "random",
newSizeAfterHitMin: "random",

Expand Down
6 changes: 3 additions & 3 deletions src/Config/target.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const targetConfig: TargetConfigType = {
toggle: false,
count: 100,
followChance: 0.1,
count: 1000,
followChance: 1,
movementsTowardsTargetMode: "smooth",
randomMovementChance: 0.3,
targetResetTime_MS: 3000,
targetResetTime_MS: 1,
targetPickingMethod: "random",
}

Expand Down

0 comments on commit 621bd31

Please sign in to comment.