C new Particle( position: Vector, width: number, mass: number, color: string, velocity: Vector, name: string ) → {void}
Parameters:
Name | Type | Description |
---|---|---|
position |
Vector | position of the object |
width |
number | width of the object |
mass |
number | mass of the object |
color |
string | color of the object |
velocity |
Vector | velocity of the object |
name |
string | name of the object |
Extends
Methods
-
S M colidedWithParticle( particle: Particle ) → { boolean }
-
Parameters:
Name Type Description particle
Particle -
S M colidedWithParticleArray( particleArray: Array.<Particle> ) → { boolean }
-
Parameters:
Name Type Description particleArray
Array.<Particle> the result of the collision or the particle that colided or false
-
S M colidedWithRect( rect: Rectangle ) → { boolean }
-
Parameters:
Name Type Description rect
Rectangle -
S M colidedWithRectArray( rectArray: Array.<Rectangle> )
-
Parameters:
Name Type Description rectArray
Array.<Rectangle> -
S M draw draw the particle on the canvas in every frame( )
-
-
S M drawLine( angle: number )
-
Parameters:
Name Type Description angle
number angle of the line
draw the partcle as a line with angle on the canvas in every frame -
S M gravitateTo( particle: Particle )
-
Parameters:
Name Type Description particle
Particle