One Day

March 25, 2010 11:21 PM By JoshuaCaputo , In ,

Blast Off!


I have put in a solid couple of hours into to learning some things and developing the application the way I want to. A lot of things are probably going to change but this gives me somewhere to start and it gets me "officially" started.

I decided to start out with the game's engine. I think this is obviously a wise decision that needs no explanation.

First I created two NSMutableArrays: one to hold the UIImageViews and one to hold their  locations which I stored as CGPoints. When the application loads  the arrays load their images and place them at their corresponding points. Before it makes them visible on the screen it decides their respective colors, for example, each block has a 50/50 chance of being red, as well as a 50/50 chance of being green.

I made sure I could read all of the data simply by using NSLogs. Tapping on a block will tell you it's position, color, and item number.

But here is where the really important stuff happens. I made an invisible UIView that has a frame of whatever you drag it to be and a center of the middle of the point where you touch down and the point you release or drag to. For example if I touch down on the very top left block and then drag my finger all the way to the bottom left it will select all of the blocks on the screen, but if I were to instead drag my finger only 3 units to the right and 5 down it would select all of the blocks in that field. Its pretty neat :).

I feel as if I have a pretty good start here for just learning all these things today. And for only have been working on them for one day.

0 comments:

Post a Comment