Constructor
new snowflake((number), (number))
Constructor function for snowflake
Parameters:
Name | Type | Description |
---|---|---|
(number) |
minr - Minimum value of the radius for the snowflake | |
(number) |
maxr - Maximum value of the radius for the snowflake |
- Source:
Methods
applyForce(force)
apply a force to the snowflake so that it can be affected by gravity and
wind
Parameters:
Name | Type | Description |
---|---|---|
force |
p5.Vector | The force to be applied to the snowflake. |
- Source:
getRandomRadius() → {number}
function to get random radius which is more likely to be small
- Source:
Returns:
random number between minr and maxr
- Type
- number
offScreen() → {boolean}
function to calculate if the snowflake has moved off screen
- Source:
Returns:
true if the snowflake is off the screen
- Type
- boolean
reset()
returns the snowflake to the top of the screen with new variables
- Source:
show()
draws the snowflake
- Source: