I need to know how to code a grid using the touch screen, so when i touch a square, in the grid, it'll place a wight block! [dosnt matter if its a BG or SP]
Also, i need to be able to count how many there are on screen, and it needs to be in a value such as 1 or 2 if theres 1 or 2 on screen.
Grid help?
Root / Programming Questions / [.]
zagg2000Created:
for a grid of 8x8 squares (for example) you would convert the touch coordinates like this: gridX=touchX DIV 8 * 8 gridY=touchY DIV 8 * 8 keeping track of how many squares exist is simple, just add 1 to a variable every time you create a square, and subtract 1 if you remove a squareI'll try it. thanks man.
for a grid of 8x8 squares (for example) you would convert the touch coordinates like this: gridX=touchX DIV 8 * 8 gridY=touchY DIV 8 * 8 keeping track of how many squares exist is simple, just add 1 to a variable every time you create a square, and subtract 1 if you remove a squareWhats gridX For?
for a grid of 8x8 squares (for example) you would convert the touch coordinates like this: gridX=touchX DIV 8 * 8 gridY=touchY DIV 8 * 8 keeping track of how many squares exist is simple, just add 1 to a variable every time you create a square, and subtract 1 if you remove a squarei got that, but how do i place multiple SPRITE'S?
It might be easier to use PRINT (there is a block character) instead of sprites or bg. Also, I would recommend using a 2-D array to keep track of which part of the grid has been touched. I have a program like this if you want to look at it.
I haven't looked at this in a while, but here it is: ZSDNE384. Sorry about the late reply.
"7SDNE384" Sorry about the typo. Midterms=not much sleep-> brain thinks 7 is Z.