diff --git a/docs/balloons/default.md b/docs/balloons/default.md index 2e1995d2..be50f3e3 100644 --- a/docs/balloons/default.md +++ b/docs/balloons/default.md @@ -12,10 +12,10 @@ class Default { +spawn_chance: number$ +<< get >>name: string +<< get >>options: BalloonOptions - +<< get >>balloonImageUrl: string - +<< get >>popSoundUrl: string +balloonImage: HTMLImageElement +popSound: HTMLAudioElement + +<< get >>balloonImageUrl: string + +<< get >>popSoundUrl: string +constructor() #originalPath(path: string) string +build() void @@ -28,34 +28,12 @@ class BalloonOptions { dir_name: string imageUrl: string popSoundUrl: string + size: [number, number] riseDurationThreshold: [number, number] swingDurationThreshold: [number, number] + swingOffset: number + waveDegrees: number } Default <|-- BalloonOptions ``` - -## Inheriting - -To create a new balloon, extend the `Default` class and implement the abstract methods. - -```ts -class Example extends Default { - public static readonly spawn_chance: number = 0.25; - // @ts-ignore - public get name(): 'example' { - return 'example'; - } - - public get options(): BalloonOptions { - return { - ...super.options, - // Override options here - // e.g. the image url - imageUrl: 'example.svg', - }; - } -} -``` - -In this example the `Example` class extends the `Default` class and overrides the `spawn_chance`, `name` and `options` properties. The options property overrides the image url to `example.svg`. Pop-a-loon will look for this `example.svg` file in the `resources/balloons/example` directory.