Wednesday, April 22, 2015

STENCYL How to create a checkerboard on the screen?



At the beginning we need only one scene. We will not need any actors.




First, add the event on stage "Drawing"


Then we create a loop with a counter 64, because ultimately we want to create an array of 8x8.


Let's see what he's doing "floor of" rounds a number down.

0 / 8 Zero divided by eight after using the floor will be 0
1 / 8 One divided by eight  after using the floor will be 0
8 / 8 Eight divided by eight after using the floor will be 1
9 / 8 Nine divided by eight after using the floor will be 1







Now try to see how it works with the "remainder of"








And now it looks like the end of our work.


THE END



























No comments:

Post a Comment