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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:47:49+00:00 2026-05-11T12:47:49+00:00

I’d like to animate multiple pieces for a game and i’d like to have

  • 0

I’d like to animate multiple pieces for a game and i’d like to have those pieces move in different directions so my current method of animating an entire view will no longer work.

I’m wondering what is the best practice for animating multiple items at once. (Note i’m rendering in 2d so i’m not currently interested in 3d soltuions.)

Thanks!

  • 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. 2026-05-11T12:47:49+00:00Added an answer on May 11, 2026 at 12:47 pm

    It’s relatively easy to animate multiple 2-D objects at once. There are two ways that you can go about it: animate UIViews or animate CALayers. In my testing, I’ve found little difference in performance when animating the two (both seem to support ~50 objects moving around at the same time at 60 FPS on the iPhone).

    To coordinate the animations of a series of UIViews, you’ll want to wrap any changes to the view geometry in a begin / commit animation block:

    [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:ANIMATIONDURATIONINSECONDS];  view1.frame = CGRectMake(newX1, newY1, view1Width, view1Height);  view2.frame = CGRectMake(newX2, newY2, view2Width, view2Height);  // Add other views here  [UIView commitAnimations]; 

    This will coordinate the motion of two or more views in a straight line to their new position over a duration of ANIMATIONDURATIONINSECONDS seconds. If you want the views to move independently of one another, create separate animation blocks for each of them.

    For more control over your animations, or to create cross-platform Mac / iPhone UI code, you may wish to use Core Animation CALayers. CALayers animate by default, so by setting

    layer.position = CGPointMake(newX, newY); 

    your layer will automatically animate to the new position. Note that by default the layer’s position is relative to its center, you can change that to the normal origin position by setting its anchorPoint property to 0,0.

    You can coordinate layer animations using a CATransaction:

    [CATransaction begin]; [CATransaction setValue:[NSNumber numberWithFloat:ANIMATIONDURATIONINSECONDS] forKey:kCATransactionAnimationDuration];       layer1.position = CGPointMake(newX1, newY1); layer2.position = CGPointMake(newX2, newY2); [CATransaction commit]; 

    For more advanced animations, you can create CABasicAnimations and CAKeyframeAnimations and apply those to your layers to move them along complex paths with specific timing and acceleration / deceleration.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have two tables with like below codes: Table: Accounts id | username |
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,

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.