Sword Engine

Global:

Methods

M addVectors( vectors: Array.<Vector> ) → { Vector }

Parameters:
Name Type Description
vectors Array.<Vector>
Returns:

M angleBetweenVectors( vector1: Vector, vector2: Vector, type: "degree" ) → { number }

Parameters:
Name Type Description
vector1 Vector
vector2 Vector
type "degree" | "radian"
Returns:

M blastParticle( particle: Particle )

Blasts the particle
Not yet implemented

Parameters:
Name Type Description
particle Particle

the input particle

M calculateFPS( lasttime: number, currenttime: number ) → { number }

Parameters:
Name Type Description
lasttime number
currenttime number
Returns: → { number }

the result of the calculation

M distanceBetweenVectors( vector1: Vector, vector2: Vector ) → { number }

Parameters:
Name Type Description
vector1 Vector
vector2 Vector
Returns:

M getlength( ) → { number }

get length

Returns:

M getNewVelocityByAccelaration( velocity: Vector, accelation: Vector ) → { Vector }

returns a new velocity vector if the acceleration is applied to the velocity

Parameters:
Name Type Description
velocity Vector
accelation Vector
Returns:

M getRandomColor( ) → { string }

Returns: → { string }

a random hex color

M moveTowardVector( vector1: Vector, vector2: Vector, distance: number ) → { Vector }

returns a vector if a vector1 moves to vector2 by distance

Parameters:
Name Type Description
vector1 Vector
vector2 Vector
distance number
Returns:

M rotateVector( vector: Vector, angle: number ) → { Vector }

Rotates a vector by an angle

Parameters:
Name Type Description
vector Vector
angle number
Returns:

M scaleVector( vector: Vector, scale: number ) → { Vector }

Scales a vector by a factor

Parameters:
Name Type Description
vector Vector
scale number
Returns:

M showFPS( fps: number, color: string )

Parameters:
Name Type Description
fps number
color string

draws the fps on the screen

M subtractVectors( vectors: Array.<Vector> ) → { Vector }

Parameters:
Name Type Description
vectors Array.<Vector>
Returns:

M translateVector( vector: Vector, translation: Vector ) → { Vector }

Translates a vector by a vector

Parameters:
Name Type Description
vector Vector
translation Vector
Returns:
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.