Click the green flag; watch the cat chase the gem. Press space to reveal the magic! Features: * Accelerates away from starting point * Decelerates towards destination * Smooth change of direction * Picks up change of destination even if cat is in motion Sorry, it took me more than 8 blocks. I also took the liberty of introducing a helper sprite, but codegolf rules did not prohibit this. The algorithm is 11 blocks in total: 6 in the cat, 5 in the helper. Other blocks are not part of the algorithm; works equally well without them. * 2 more blocks in the helper, to reveal the magic. * 5 blocks in the 'destination' sprite, to give the cat a moving target. Destination might as well have been a stationary sprite with zero blocks, but that makes the overall experience a 'single shot', which is quite boring to look at. Instructions from original project: "try to make a smooth glide block in less than 8 blocks"
The implementation is extremely simple. It doesn't even use variables. The trick is that the cat does not follow the gem directly, but instead follows an invisible 'helper' that follows the gem. BUGS: * Once the cat has caught up with the destination, it starts shaking. * A 180° change of direction is not smooth.