Class: snowflake

snowflake((number), (number))

Class containing all the information necessary to draw and carry out physics for a snowflake.

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:

Documentation generated by JSDoc 3.6.3 on Sat Jun 11 2022 20:52:08 GMT+0100 (BST)