moving 1 to another position if keyhit is true?

BlitzMax Forums/BlitzMax Beginners Area/moving 1 to another position if keyhit is true?

Haha, that's pretty much the implementation you want - just replace the code in your moveBlock() function with the code I've given you (with small changes).

BoxPos starts at 0. From your code, you have a 10 x 10 array, so ArraySize would be 10. I'm assuming your box starts off at array location [0,0], so array[0,0] = 1.

When you press the key, array[0,0] becomes 0, boxPos is incremented by 1, and array[0,1] becomes 1.

When boxPos is 9, array[0,9] would equal 1. Pressing the key now would make array[0,9] equal 0, boxPos = 10, then array[1,0] equal 1. This is because of the way the / and Mod operators work.

This is the sort of thing you want, isn't it?

Ryan