Category

Game

Created by

Andreas Dreier

Name

Chess

Uploaded

15.07.2008

 

Download

Content of ZIP file

  Chess.ric 1     1     1 116  
  Chess.rpa

 

Description

This example is only a study which should show how complex a RIC file can be. The following picture was drawn by a single call of the RIC file Chess.RIC:

 

 

By forwarding up to 110 parameters you can define each time when you show the picture how it will be displayed on the NXT screen. For example the parameters 0 to 63 define which figure should be shown on each of the 64 chess fields. There is only one Sprite element inside the file which contains all possible images which should displayed:

 

 

For displaying the figure on Field A1 you only have to know the offset of the white tower within the Sprite image. It's pixel position 32 from the left side. As we know that the field on A1 is black we have to copy the image from the second line of figures. So we have to use the vertical offset of 8. As result we find the image for the black tower on chess field A1 on position [32,8] with a size of 7 x 7. Knowing all this values the black tower image can be copied by using a single CopyBits command.

 

And all the other fields on the display will be filled on the same method.