Board Thread:General Discussion/@comment-24454571-20140204220440/@comment-173.72.38.64-20140509210347

Just to address some points:

You don't explain exactly how you were using GFILL with random numbers, so it's difficult to diagnose why it "wasn't working", but I could make a few guesses. If the coordinates were outside the limits of the screen, a rectangle would not appear. If the colour of the rectangle were the same as the background, there would be no visible change.

FOR loops can be nested, as long as you use different variables. If you use the same variable, you'll get odd behaviour that will probably upset and/or confuse you.

Pixels are SMALL, generally too small to be game elements. You might want to consider using characters as your game elements, at least for starters, and use LOCATE and PRINT a single character (or PNLSTR for the lower screen), instead of GPSET.

Each character is 8 pixels wide; for Brilliance360's example (with upper-left PNLSTR coordinates 5,1 and lower-right 7,3), the TCHX,TCHY coordinates for the upper-left corner of the upper-left character is 5*8,1*8, or TCHX=40, TCHY=8. The upper-left corner of the lower-right character at 7,3 is 7*8,3*8, or 56,24; since the character is 8*8, the bottom-right is these coordinates plus 7,7, or TCHX=63, TCHX=31. If you want the touch-sensitive area to start halfway from the side of the character, add 4 to the appropriate coordinate, etc..

And some abstract advice, since you're a beginner. One of the things that makes programming complex and difficult is not the concepts and entities themselves, it is the number of relationships between them, the number of ways they can interact. For two entities, A and B, you might consider two interactions: A runs into B, and B runs into A. For 10 different entities, there are 90 such pairwise interactions, and that's not even counting interactions between three entities, or four, or five... A well-prepared programmer will have thoroughly considered every single type of interaction between entities that can possibly interact (or know for sure that such interaction is impossible, and why it is impossible) before even beginning to type anything.

Good luck!