lunduniversity / introprog-scalalib

Scala library with simple-to-use utilites for students of introductory programming. http://cs.lth.se/pgk/api
BSD 2-Clause "Simplified" License
60 stars 13 forks source link

Lack of documentation / information for how BlockWindow works? #44

Closed dixine55 closed 3 months ago

dixine55 commented 10 months ago

During the SnakeLab there's some confusion regarding how drawBlock() in BlockWindow works.

This is partly due to the fact that if you instantiate a BlockWindow class in REPL (which students repeatedly are told to play around in) and then use the drawBlock() function, nothing happens.

A solution would be to perhaps have a very primitive code that shows the functionality in a working state, where students can play around as REPL doesn't provide that functionality and still not give away too much, so there's still learning potential.

For example the code found here could possibly help; https://github.com/dixine55/BlockWindow-functionality

Another solution would be to inside of the introprog Documentation mention that drawBlock only works inside of a gameLoop, and specify what that is and how to initiate one.

bjornregnell commented 3 months ago

Now here: https://github.com/lunduniversity/introprog-scalalib/blob/master/src/main/scala/introprog/examples/TestBlockGame.scala#L72

TODO: add explanation in docs of gameLoop

bjornregnell commented 3 months ago

Fixed in https://github.com/lunduniversity/introprog-scalalib/commit/74a56caf0677390b1baa8f27b96962979db997b0