|
|
|
|
|
by kaoD
3160 days ago
|
|
I think it's just a case of leaky abstraction. I'd change the API to something like: robot.action = { action: 'jump' };
robot.action = { action: 'move', amount: 4 };
etc.
Or if you want to keep the action creators: robot.action = robot.jump();
robot.action = robot.move(4);
Which makes it obvious that there can only be a single action per loop call. |
|