Allow "rotating" a counter tile to alter its value

This commit is contained in:
Eevee (Evelyn Woods) 2020-12-07 22:07:20 -07:00
parent 35f040c8d7
commit 6d39fd3831

View File

@ -1078,12 +1078,18 @@ const SPECIAL_PALETTE_BEHAVIOR = {
return `logic_gate/${tile.gate_type}`;
},
rotate_left(tile) {
if (tile.gate_type !== 'counter') {
if (tile.gate_type === 'counter') {
tile.memory = (tile.memory + 9) % 10;
}
else {
tile.direction = DIRECTIONS[tile.direction].left;
}
},
rotate_right(tile) {
if (tile.gate_type !== 'counter') {
if (tile.gate_type === 'counter') {
tile.memory = (tile.memory + 1) % 10;
}
else {
tile.direction = DIRECTIONS[tile.direction].right;
}
},