UNPKG

bp-prism-game

Version:
83 lines (82 loc) 1.97 kB
import { GameService } from '../../service/game.service'; import { SceneryClass } from '../scenery.class'; import { ImageLoadedEnum } from '../../enum/image-loaded.enum'; /** * The Water Class */ export declare class WaterClass extends SceneryClass { /** * The water waves image */ private waveImages; /** * The scale ranges */ private scaleRanges; /** * The animationTimer for the waves */ private animationTimers; /** * The assetTimes for the waves */ private assetTimers; /** * Constructor * @param gameService The GameService * @param ctx The ctx * @param guid The guid of the alien * @param imageType The type of water */ constructor(gameService: GameService, ctx: CanvasRenderingContext2D, guid: number, imageType: ImageLoadedEnum); /** * Get the wave scale */ private getWaveScale; /** * Get the wave position based on the scale * @param scale The scale of the wave */ private getWavePosition; /** * Configure a wave * @param wave The wave to configure */ private waveConfiguration; /** * Load the Water Images * * @param waterImageType The water type */ private loadWaterImages; /** * Draw everything necessary */ protected draw(): void; /** * Add the wave scale * @param wave The wave */ private addWaveScale; /** * Calculate the X Boundary * @param waveData The wave model */ private calculateXBoundary; /** * Calculate the Y Boundary * @param waveData The wave model */ private calculateYBoundary; /** * Validate The Timer * @param now The current animation time * @param index The current timer index */ private validateTimer; /** * Animate the Scenery * @param now the current time */ animate(now?: number): void; }