Rotation-Direction changed & Slow-Down Fields and Logic added

This commit is contained in:
gohlkeMax
2021-07-01 14:46:18 +02:00
parent 0a0752d4e5
commit e46b5f12e5
5 changed files with 51 additions and 36 deletions

View File

@@ -1,3 +1,5 @@
var maxField = 15;
class Player {
constructor(name) {
this.name = name;
@@ -6,7 +8,13 @@ class Player {
}
move_by(amount) {
this.position += amount;
if(this.position > 11){
this.position++;
}else if(this.position+amount > 11){
this.position = 12;
}else{
this.position += amount;
}
}
}