chiark / gitweb /
6 years agoatoms.lisp: Call `player-turn-begin' from the main loop.
Mark Wooding [Sun, 24 Mar 2013 01:43:29 +0000 (01:43 +0000)]
atoms.lisp: Call `player-turn-begin' from the main loop.

This will prevent huge recursion when multiple robots play each other.
Also, make sure that the first player is told at the beginning of the

6 years agoatoms.lisp: Style cleanup.
Mark Wooding [Sun, 24 Mar 2013 01:40:35 +0000 (01:40 +0000)]
atoms.lisp: Style cleanup.

6 years agoatoms.lisp: Multiple player types.
Mark Wooding [Sun, 24 Mar 2013 01:40:18 +0000 (01:40 +0000)]
atoms.lisp: Multiple player types.

Keep a list of player type names and classes, and allow the user to
fiddle with player types in the `new game' dialogue.

6 years agoatoms.lisp: Don't start the game automatically.
Mark Wooding [Sun, 24 Mar 2013 01:22:28 +0000 (01:22 +0000)]
atoms.lisp: Don't start the game automatically.

Also, rename the default players.

6 years agoatoms.lisp: Move `export' calls to near the appropriate definition.
Mark Wooding [Sun, 24 Mar 2013 01:21:40 +0000 (01:21 +0000)]
atoms.lisp: Move `export' calls to near the appropriate definition.

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.