-
Notifications
You must be signed in to change notification settings - Fork 4
Balloon
SimonStnn edited this page Mar 8, 2024
·
7 revisions
This class represents a balloon that is dislpayed on the screen.
classDiagram
class Baloon {
-element HTMLDivElement
-duration number
-popSound HTMLAudioElement
+isRising() boolean
+rise() void
+remove() void
+pop() Promise~void~
}
Creates a new balloon and appends it to the balloon container.
The balloon has no public attributes.
The balloon has no public properties.
Returns true
if the balloon is rising, false
otherwise.
Makes the balloon rise. If the balloon is already rising, this method does nothing.
Removes the balloon from the screen.
Tip
This should be called when the user didn't click the balloon.
Pops the balloon and calls the remove
method. Also will play the pop sound.
This will also increment the balloon count by 1.
Tip
This should be called when the user clicks the balloon.