Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-17-2009, 08:11 PM   #3 (permalink)
fulvio
Registered Member
 
Join Date: Mar 2009
Posts: 42
fulvio is on a distinguished road
Default

Quote:
Originally Posted by rhfb View Post
Well if you can get the value of each brick (using similar code to your x and y values (i%8, i/8)) You could use a switch statement to create the correct imaged brick. I don't know how exactly the code would look since I haven't used switch statements in Obj-C yet. So basically you need to do two things.

a) get the correct value for that brick (some people would use two for loops to do the same thing you are doing with just one)
b) use that value to assign the image to the view.
Yeah, see that's kind of the idea I was thinking of. But I'm not sure how to create such an array that looks like the following and loop through it as well:

brickArray *brickLevel1 = {
{0,0,0,0,0,0,0,0},
{1,1,0,0,0,0,1,1},
{1,0,1,0,0,1,0,1},
{1,0,2,0,0,2,0,1},
{1,0,2,0,0,2,0,1},
{1,0,1,0,0,1,0,1},
{1,1,0,0,0,0,1,1},
{1,1,3,1,1,3,1,1}
};

I'm sure I could figure out the switch statement logic to replace the 1 with blue.png and the 2 with yellow.png, etc.

I'm just not 100% on the way to create that array and loop through it properly? Any ideas?

Last edited by fulvio; 03-17-2009 at 10:29 PM.
fulvio is offline   Reply With Quote
 

» Advertisements
» Online Users: 469
19 members and 450 guests
apatsufas, baja_yu, buggen, chenpo, ChrisYates, Feldspar, HowEver, ilmman, IphoneSdk, jbro, jeroenkeij, jNoxx, RobTaku, rraagg, samdanielblr, swelsh, taylor202, Trickphotostudios, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,636
Threads: 94,098
Posts: 402,804
Top Poster: BrianSlick (7,990)
Welcome to our newest member, samdanielblr
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:49 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.