mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Level class created and gravity editable.
This commit is contained in:
22
tilorswift/js/dialog/DialogGravity.js
Normal file
22
tilorswift/js/dialog/DialogGravity.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import Dialog from "./Dialog.js";
|
||||
import TilorswiftGravityUpdatedEvent from "../events/TilorswiftGravityUpdatedEvent.js";
|
||||
|
||||
export default class DialogGravity extends Dialog
|
||||
{
|
||||
constructor(gravity)
|
||||
{
|
||||
super();
|
||||
this.setMessage('Gravitation einstellen');
|
||||
this.inputGravity = this.createInputNumber('Stärke', gravity, 0, 10, 0.01);
|
||||
this.createButton('Abbrechen');
|
||||
this.buttonOk = this.createButton('OK');
|
||||
this.buttonOk.addEventListener(
|
||||
'click',
|
||||
() => {
|
||||
window.dispatchEvent(
|
||||
new TilorswiftGravityUpdatedEvent(parseFloat(this.inputGravity.value))
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user