Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8669915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:35:27+00:00 2026-06-12T18:35:27+00:00

I am trying to set up an animation where a ball has a velocity,

  • 0

I am trying to set up an animation where a ball has a velocity, and is accelerated towards touch points. First, I successfully transcribed an app from a tutorial that worked flawlessly, from http://www.youtube.com/watch?v=buFCoj2jqDk&feature=relmfu .

But when I tried to introduce the concept of velocity, I appear to have failed at the vector math. I wanted to simply subtract two vectors from each other, but I didn’t get the syntax right for that until I went to the verbose option below.

The app gives a “Breakpoint 1.1”

Relevant code below:

@interface ViewController : UIViewController {UIImageView *spritey; CGPoint vee; CGPoint acc;}
@property (nonatomic, retain) UIImageView *spritey;
@property (assign) CGPoint vee;
@property (assign) CGPoint acc;
@end

//.m
- (void)viewDidLoad
{
[super viewDidLoad];
spritey = [[UIImageView alloc] initWithImage: [UIImage imageNamed:@"cloud2.png"]];
[spritey setFrame:CGRectMake(60,60,50,50)];
[self.view addSubview:spritey];
vee=CGPointMake(0,0);
}
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
    UITouch *myTouch=[ touches anyObject];
    [UIView beginAnimations:@"moveTo" context:NULL];
    [UIView setAnimationDuration: 2.25];
    [UIView setAnimationBeginsFromCurrentState:YES];
    CGPoint newTarget=[myTouch locationInView:self.view];
    vee=CGPointMake(vee.x+(newTarget.x-spritey.center.x)/10,
                    vee.y+(newTarget.y-spritey.center.y)/10);
   spritey.center=CGPointMake(spritey.center.x+vee.x,spritey.center.y+vee.y);
   //spritey.center=[myTouch locationInView:self.view];
   [UIView setAnimationDelegate:self];
   [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
   [UIView commitAnimations];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T18:35:29+00:00Added an answer on June 12, 2026 at 6:35 pm

    Stopping at a breakpoint is a debugging tool, not an error, according to our friend here:
    "Thread 1: stopped at breakpoint" error when initializing an NSURL object

    Somehow I must have turned one on.
    Going to View–> Navigators –> Show Breakpoint Navigator bought me to a place where I could delete it.

    Code now works as intended!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to set up Cancan within an app of mine and having trouble with
I'm trying to set up a pretty basic hover animation in jQuery. Mouse over
I'm trying to place some animation in my app. I'm using an ImageView and
i have been trying to make a bouncing ball animation.I have got everything right
I am trying to set up a simple animation in an Android activity where
I'm trying to do a simple animation with ImageButtons, when I set it up
I'm trying to set the animation for the view to move up when keyboard
I am completely new to world of jQuery. I am trying to set animation
I've been trying to set css3 animation to load after the entire page load
I'm trying to set up a simple animation that takes an image on the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.