Split language and tutorial, add gamepad settings

This commit is contained in:
LoveEevee
2019-04-16 21:06:41 +03:00
parent a4d938e888
commit f05b2518f3
26 changed files with 1036 additions and 835 deletions

View File

@@ -1,6 +1,7 @@
class Gamepad{
constructor(bindings, callback){
this.bindings = bindings
this.callback = !!callback
this.b = {
"a": 0,
"b": 1,
@@ -87,6 +88,9 @@ class Gamepad{
for(var name in bindings[bind]){
var bindName = bindings[bind][name]
this.checkButton(gamepads, this.b[bindName], bind, callback, force[bindName])
if(!this.b){
return
}
}
}
break
@@ -136,6 +140,11 @@ class Gamepad{
}
}
clean(){
clearInterval(this.interval)
if(this.callback){
clearInterval(this.interval)
}
delete this.bindings
delete this.b
delete this.btn
}
}