Bullet class
muhammadtarek opened this issue · 0 comments
muhammadtarek commented
Control all bullets state, removal and damage control
class BulletsObserverr {
bullets: Bullet[]
}
interface Bullet {
id: string,
imgELement: HTMLImageELement,
/**
* Image URL
*/
img: string,
/**
* Damage number
*/
damage: number,
/**
* Who created the bullet
*/
creator: Creator
/**
* Current bullet position
*/
position: Position,
/**
* Move bullet by setInterval each 1 second
*/
move: () => void
}
Interfaces should be implemented as Object
s
interface Creator {
player: number,
enemy: number
}
interface Position {
x: number,
y: number
}