Sword Engine

Class: Particle

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
Returns:

S M colidedWithParticleArray( particleArray: Array.<Particle> ) → { boolean }

Parameters:
Name Type Description
particleArray Array.<Particle>
Returns: → { boolean | 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
Returns:

S M colidedWithRectArray( rectArray: Array.<Rectangle> )

Parameters:
Name Type Description
rectArray Array.<Rectangle>
Returns:

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
Made By Vedik Dev - Himanshu Jangid
sword-engine Copyright © 2021 Himanshu.
Documentation generated by JSDoc 3.6.7 on Tue Nov 30 2021 23:12:55 GMT+0530 (India Standard Time) using the TSDoc template.