ios - Animating uiview continously using Core Graphics in ios7 -


i creating game bubble shooter uiview object animate continuously based on screen touched. able animate uiview object based on touch event problem is, stops @ touch point clicked..i used uiview animation giving 1 sec animate ball. don't want stop ball @ point , want automatically go forward direction clicked , should take care of screen size ball (uiview) not go out of view.this code.

-(void)touchesended:(nsset *)touches withevent:(uievent *)event {  gametimer = [cadisplaylink displaylinkwithtarget:self selector:@selector(updatedisplay:)];  [gametimer addtorunloop:[nsrunloop currentrunloop]formode:nsdefaultrunloopmode]; } -(void) updatedisplay:(cadisplaylink*)sender {                           if (lasttime == 0.0)                         {                            // first time through, initialize lasttime                              lasttime = previoustimestampvalue;                            }                          else                          {                               timedelta = sender.timestamp - lasttime; // update lasttime                              lasttime = sender.timestamp;                                ballrect.origin.x += ballvelocity.x * timedelta;                              ballrect.origin.y += ballvelocity.y * timedelta;                               [self checkcollisionwithscreenedges];                         }                     [currentballview setframe:ballrect];                     // currentballview.center = ballrect.origin;    } 


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -