Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Gregorski

macrumors newbie
Original poster
Jan 27, 2009
19
0
I've got an idea for a game but I'm after some advice on coding method, specifically whether I will be able to use UIImageViews rather than learning OpenGL.

My idea requires a top-down view of a game area/map. This will need to scroll over several "pages" (i.e screen areas). Let's say, for example, this is a car racing game where the track covers an area of 4 iphone-screens x 4 iphone-screens. Would I be able to create the whole map as a UIImageView and move it around so the correct area is visible. Would I also be able then to create the cars as UIImageViews and move them appropriately. Would hit testing be easy for tracking whether the car is on the track etc or has hit the barrier? Alternatively, should I be looking at learning OpenGL to achieve this. I have a clear idea of what I want to achieve, I just need some pointers as to how to start off, specifically with the map scrolling to begin with and possibly with the sprites. I think the game mechanics/logic/internals (whatever you want to call it) are fairly straightforward for me to code.

Any input would be greatly appreciated. I'm new to Objective-C, iPhone SDK, and games programming, but in no way new to programming in general.
 
Your idea would work with both things. However, OpenGL will get you a lot further in terms of scalability and performance (and even battery life, I believe).

About the hit testing being easy: it'll vary with the complexity of your hit shapes and speeds.

For instance, I'm working on a game that has very fast objects moving around. Hit testing will often have to retrace that object's step in order to find out if it collided in between frames. But I doubt a car racing game will have such issues.
 
For instance, I'm working on a game that has very fast objects moving around. Hit testing will often have to retrace that object's step in order to find out if it collided in between frames. But I doubt a car racing game will have such issues.

lets say its a first per shooter you are making, if the user presses the forward key, then check if with that extra movement if the user will hit the wall, if he does then stop him
Thats a better way than having to re-trace your steps, also if your game slows right down im guessing theres a small chance you could briefly appear outside of the game boundaries
 
lets say its a first per shooter you are making, if the user presses the forward key, then check if with that extra movement if the user will hit the wall, if he does then stop him
Thats a better way than having to re-trace your steps, also if your game slows right down im guessing theres a small chance you could briefly appear outside of the game boundaries

For simple games this is true. However a lot of the more advanced titles run seperate graphics and physics engines (each running in seperate threads may I add) and doing this would be a pain in the ass as well as a huge performance killer as in every draw frame you would have to update the physics which is *usually* unnecessary.

EDIT: WOO and this post made me a 6502! :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.