Simplify movement triggering code | create helper basic control utility method
This commit is contained in:
@@ -144,6 +144,13 @@ public class DefaultCharacter extends MovableSprite implements Character {
|
||||
return animation.getFuture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Movement move(Direction direction) {
|
||||
var movement = prepareMovement(direction);
|
||||
layer.pushMovement(movement);
|
||||
return movement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean move(Movement movement) {
|
||||
if (super.move(movement)) {
|
||||
|
||||
Reference in New Issue
Block a user