win-destroyer-ts
Version:
A modern recreation of the timeless Desktop Destroyer game developed by Ing. Miroslav Nemecek, written in TypeScript.
38 lines (37 loc) • 1.19 kB
TypeScript
import { Game, WeaponObject } from './interfaces';
import ParticleGenerator from './ParticleGenerator';
import { WeaponOptions, Coordinates2D, Dimensions2D } from './types';
export declare class Weapon implements WeaponObject {
animatedParticle: boolean;
animationCount: number;
cursorOffset: Coordinates2D;
damagePoints: number;
fireRate: number;
game: Game;
name: string;
particleAnimationDuration: number;
particleGenerator: ParticleGenerator;
particleOffset: Coordinates2D;
particleSpriteDimensions: Dimensions2D;
sfx: string[];
spriteFrames: number;
spriteH: number;
spriteRenderer: HTMLDivElement;
spriteW: number;
sprites: {
cursor: string;
particles: string[];
staticParticles: string[];
};
viewFrame: HTMLDivElement;
constructor(game: Game, sfx: string[], sprites: {
cursor: string;
particles: string[];
staticParticles: string[];
}, options: WeaponOptions);
/** Pack the renderer into the frame and return content to be rendered */
spawn(): HTMLDivElement;
/** Fire a single shot */
fire(): Promise<void>;
}
export default Weapon;