bdoin/GCompris — pull request #7 by palbr (2012-09-27 20:11:41+00:00)
Title: maze-activity run-fast-mode

Email-context from the mailing list:

On 18.09.2012 23:25, Bruno Coudoin wrote:
> Le dimanche 16 septembre 2012 à 15:32 +0200, Peter Albrecht a écrit :
>> ... But something is confusing about [the maze-]activity: There
>> is an undocumented "run_fast"-mode.
>>
>> This means, you don't have to go through the maze step by
>> step, but tux walks automatically as long as the path is
>> unambiguous. This is very handy with larger mazes. But if
>> you don't understand it, this behaviour and its activation
>> is quite confusing.
>>
>> Looking at the source code, I found a few conditions,
>> affecting the run_fast-mode:
>>
>> 1) switching to level 1 run_fast is disabled
>> 2) switching to level 14 run_fast is enabled
>> 3) clicking on tux toggles run_fast-mode
>>
>> I think, this should be documented in the activity manual
>> "./src/maze-activity/maze.xml.in" with something like:
>> -------------------------- 8< --------------------------
>> Use the keyboard arrows to move Tux up to the door.
>>
>> From level 14 on, run-fast-mode will be enabled. This means
>> tux will walk all the way automatically until he reaches a
>> fork and you have to decide which way to go further.
>> If you want to use this feature in earlier levels or want to
>> disable it in advanced levels, click on tux to toggle the
>> run-fast-mode.
>> -------------------------- >8 --------------------------
>>
>> Best would be, if there was a symbol showing, whether
>> run-fast-mode is enabled or not. ;)

>You are not the first to complain about that. Are you interested in
>providing a patch. For example having a toggle button with a rabbit and
>a turtle to show the current status of this feature and to switch it on
>or off would be fine.

I used todays spare time to implement some patches for the problem described above:

I liked your idea about the rabbit/turtle button very much. But I did not know how to illustrate whether run-fast-mode is on / off with just a button. Should the button show the next state to switch to or the current state? In general, a "play" button starts playing. But that would mean, if run-fast-mode is enabled, a turtle would be shown in the upper left corner of the screen. This could be have been a bit confusing for children.

After a bit of thinking, I came up with the idea, to put an indicator directly on Tux. And since run-fast concerns walking, I decided, to let Tux put on some red running shoes, if run-fast-mode is enabled. ;)

You can toggle run-fast mode by clicking the toggle button (which is not changing its face ;) ) or clicking on Tux, which was also available in older versions. This is also described in the activity manuals. See commit 813e1a7

Run-fast mode is available "maze", "maze2DRelative" and "mazeInvisible".

I also fixed, what I considered a bug, concerning Tux running through the exit in run-fast-mode. See commit ecf814c.

So, once again, please have a look. :)