Objective C - Aggro with Images

Posted by Will on Game Development See other posts from Game Development or by Will
Published on 2012-02-17T14:39:50Z Indexed on 2012/03/19 2:17 UTC
Read the original article Hit count: 359

Filed under:
|
|

I have three UIImageViews. enemy1, enemy1AggroBox and mainSprite. What I want to do is when mainSprite and enemy1AggroBox interect, I want enemy1 to start moving towards mainSprite. Basically creating aggro for a game.

if(CGRectIntersectsRect(mainSprite.frame, enemy1AggroBox.frame)){
//Code here//
}

My plan would be to call this method in viewDidLoad. I'm not using any sort of framework like cocos2d or OpenGLES. If you need to see any more code just ask.

© Game Development or respective owner

Related posts about game-design

Related posts about iphone