1

I am creating a board game that can have both human and bot players.

My first version, which uses the Transcript, is ready. So now I want to make a better looking, more user friendly version using Morphs. The problem is when I start the game with only bot players. Only the end board is shown, whereas I would like to see each move that has been played, each change on the board.

I have tried lots of things, with forced updates of the morph or the world. I have tried to use step, stepTime and startStepping.

The latter shows my I am missing something: step is called for the first time when the game is over. Also: I have no idea what to put in step. Adding and removing submorphs is done by other methods, as well as a call to morph changed.

So: how can I see morph changes, without any interaction like clicks?

Sander de Jong
  • 351
  • 6
  • 18
  • There are many implementors of `#step`. Have you looked at them? – Leandro Caniglia Mar 04 '23 at 18:50
  • @LeandroCaniglia I have looked at some. But I guess the biggest problem is that step is only called after the game is practically over. Even though I call startStepping for the morph at its initialization. – Sander de Jong Mar 04 '23 at 18:58
  • Have you confirmed that by, e.g., sending something to the Transcript in the `#step` method? Also check the `#stepTime` of your board morph. – Leandro Caniglia Mar 04 '23 at 19:12
  • 2
    Just adding Transcript show: ‘’ anywhere in the game loop solved the problem. Now that I write this, I think that I will remove the step related methods and see what happens. Will post the results here. – Sander de Jong Mar 05 '23 at 10:43

1 Answers1

0

step methods are not necessary, the only thing that is needed is:

World doOneCycle

anywhere in the game loop.

The “solution” with writing an empty string to the Transcript, as given in a comment, probably causes the world to do a cycle.

Sander de Jong
  • 351
  • 6
  • 18