chiark / gitweb /
atoms
6 years agoatoms.lisp: Rewrite `update-undo-redo-sensitivity'.
Mark Wooding [Fri, 22 Mar 2013 22:54:09 +0000 (22:54 +0000)]
atoms.lisp: Rewrite `update-undo-redo-sensitivity'.

Less duplication, and no hideous line-breaks.

6 years agoatoms.lisp: Fix undo/redo action sensitivity.
Mark Wooding [Fri, 22 Mar 2013 22:52:52 +0000 (22:52 +0000)]
atoms.lisp: Fix undo/redo action sensitivity.

Undo should be available after the first turn, but wasn't.  The reason
is twofold:

  * `update-undo-redo-sensitivity' was hooked onto :processing-move
    rather than :start-turn, which was just a mistake, though it seemed
    not to be because the order of the notifications was wrong; and

  * `perform-explosions', which is where :start-turn is issued, was
    being called before the undo record was laid down, whereas it should
    always have been afterwards.

6 years agoatoms.lisp: When restoring an unstable position, continue the animation.
Mark Wooding [Fri, 22 Mar 2013 22:34:41 +0000 (22:34 +0000)]
atoms.lisp: When restoring an unstable position, continue the animation.

Otherwise, the following thing goes wrong.  You make a move which starts
a chain reaction; you undo it before the reaction has resolved and there
are still atoms from other players; and then you redo the move.  At this
point, you have a static board and nobody can play, since both players
are :playing.

6 years agoatoms.lisp: Allow a single player.
Mark Wooding [Fri, 22 Mar 2013 22:34:41 +0000 (22:34 +0000)]
atoms.lisp: Allow a single player.

He can't win, but that's OK.  It still allows some experimentation with
the rules.

6 years agoatoms.lisp: Reorder the notifications in `play-cell'.
Mark Wooding [Fri, 22 Mar 2013 22:34:41 +0000 (22:34 +0000)]
atoms.lisp: Reorder the notifications in `play-cell'.

Really :processing-move should always come before :start-turn.

6 years agoatoms.lisp: Cancel the explosion animation when we restore a snapshot.
Mark Wooding [Fri, 22 Mar 2013 22:34:41 +0000 (22:34 +0000)]
atoms.lisp: Cancel the explosion animation when we restore a snapshot.

Otherwise we get terribly confused about who's supposed to be playing.

6 years agoatoms.lisp: A player about to make a move is active.
Mark Wooding [Fri, 22 Mar 2013 22:34:41 +0000 (22:34 +0000)]
atoms.lisp: A player about to make a move is active.

Fixes a bug in `game-update-scores' which you should never actually see,
since a player shouldn't become ready if the game's already been won.
But this was exposed by another bug, so I might as well fix it.

6 years agoInitial commit.
Mark Wooding [Fri, 22 Mar 2013 02:24:14 +0000 (02:24 +0000)]
Initial commit.