I'm in the beginning process of creating my first 2d game and it's apuzzle game (sort of like bejeweled) where I would have 7 different images randomly spreadout across in a 7x7 grid totaling 49 images total.Basically there would be a way to match pieces and make themdisappear, then the pieces above would fill the new empty spaces, and then new random pieces wouldappear to fill the gaps left at the top of the screen.

I have been struggling with this I know how to load images etc. but Icant seem to wrap my head around getting the basic getting this basic structure set upwhere it's actually usable. I cannot find any tutorials etc that cover this sort of thing. Ifsomeone could give me any pointers, or point me in a direction that my fill in the gaps forwhat I am looking for that would be greatly appreciated.

where you can use .remove(int index) to delete "disappear" pieces. Then you can use .add(Bitmap name) to add the new image to the end of the list. Using 7 ArrayLists allows you to keep separate accounting for each column in your grid.

What I am struggling with now is removing an item from the arraylist that i "touch".For example I have a 7 by 7 grid separated into 7 vertical arraylists with 7 random images populating the whole grid,how do it up so when I touch the screen on a particular image, that image will disappear.

I have my touch event setup to get the coordinates and I can remove an item by specifying the index number in .remove. however I am having trouble translating where I touch, to the the arraylist item(s)

Pardon my inexperience here but I have been banging my head against the wall with no resolve.

What I am struggling with now is removing an item from the arraylist that i "touch".For example I have a 7 by 7 grid separated into 7 vertical arraylists with 7 random images populating the whole grid,how do it up so when I touch the screen on a particular image, that image will disappear.

I have my touch event setup to get the coordinates and I can remove an item by specifying the index number in .remove. however I am having trouble translating where I touch, to the the arraylist item(s)

Pardon my inexperience here but I have been banging my head against the wall with no resolve.

Thanks

Hey

Im not the biggest expert on this subject, but i have some basic knowledge.I guess you have to make a "virtual" grid too...like defining 7x7 blocks but each block have to contain the image height and width and then divide your "cursor" result with 7..

The best way to do this is to create a subclass of Bitmap that contains the position as a data member(s). Then, you use the onTouchEvent() method coupled with the KEY_DOWN field to gather the touches, once a touch is received, you need to use the location of the touch and the positions of the various Bitmap subclasses to determine which "tile" was touched. Another options is to make the grid from buttons and set the background of each button to a square image. This will allow you to automatically inherit the onClick() method of the button.