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 8508029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:02:27+00:00 2026-06-11T03:02:27+00:00

i Have two images generated like this – (void)moveImage:(UIImageView *)image duration:(NSTimeInterval)duration curve:(int)curve x:(CGFloat)x y:(CGFloat)y

  • 0

i Have two images generated like this

- (void)moveImage:(UIImageView *)image duration:(NSTimeInterval)duration
            curve:(int)curve x:(CGFloat)x y:(CGFloat)y
{
    // Setup the animation
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationCurve:curve];
    [UIView setAnimationBeginsFromCurrentState:YES];

    // The transform matrix
    CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y);
    image.transform = transform;

    // Commit the changes
    [UIView commitAnimations];

}
    - (void)alien {
    enemy =
    [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"alien.png"]];
    enemy.frame = CGRectMake(-100, 20, 50, 50);
    [self.view addSubview:enemy];

    // Move the image
    [self moveImage:enemy duration:5
              curve:UIViewAnimationCurveLinear x:460 y:0.0];  }
- (void)bullet4 {
    bullet =
    [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Bullet.png"]];
    bullet.frame = CGRectMake(carDude.center.x, 380, 5, 10);
    [self.view addSubview:bullet];

    // Move the image
    [self moveImage:bullet duration:3
              curve:UIViewAnimationCurveLinear x:0 y:-500.0];   }

I’m trying to hide them when they intersect. There can be many on the screen at the same time but i tried,

-(void)checkCollision {
    if(CGRectIntersectsRect(bullet.frame, enemy.frame)) {

    }
}

and no luck getting the images to do anything when they collide.

How can i get the image to hide and check collision?

  • 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-11T03:02:29+00:00Added an answer on June 11, 2026 at 3:02 am

    If you change the transform of a view, its frame doesn’t change (it can even become unvalid) and should be ignored.

    From the documentation:

    Warning If this property is not the identity transform, the value of the frame property is undefined and therefore should be ignored.

    Since all you’re doing is applying a translation transform, why don’t you animate the frame instead?

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

Sidebar

Related Questions

I have two images which i would like to compare and do different operations
I've got two tables that look like this: alt text http://www.brettrobichaud.com/images/linq.png I'm trying to
I have two images, both taken at the same time from the same detector.
I have two images on a WPF window that are on top of each
I have two images - 1)a rectangular one, displaying the actual content and 2)a
I have two images. One that is normal, and another that is more colourised.
We have two images with transparent sections that each have a map and separately
I have two images with which I am using in an anchor tag. I
I have two images (JPGs). Both are the same width but image2 is shorter
I have two images in the background of my html doc. One positioned top

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.