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

  • Home
  • SEARCH
  • 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 8394787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:08:39+00:00 2026-06-09T20:08:39+00:00

I am making a game that has a win state and a lose state.

  • 0

I am making a game that has a win state and a lose state. For each state, I would like to display a short animation of 2-3 seconds. The first animation consists of 60 PNGs, at a rate of 30 fps, and the second animation consists of 80 PNGs, also at 30fps. I have tried various methods, and searched extensively for a solution, but the top two results I keep finding are to use UIImageView animationImages and Core Animation. Using UIImageView works very nicely in the simulator, but takes forever to run the first time on the device. I figure this is because the images need to be loaded into memory. I am using “imageNamed” to populate the animationImages array, but I guess they need to be rendered the first time the animation is called? I have tried pre-rendering them when the app loads, and this seems to do the trick, but pre-rendering all those images takes nearly 10 seconds, which is not user friendly. I would also be open to using Core Animation, but I have very limited knowledge of it so a detailed explanation would be greatly appreciated. Thanks!

when you say that I need to load everything at the app’s startup, what exactly do you mean? Right now, I initialize both arrays of animation images when the app loads, like this:

// Create thinnestAnimation Array
thinnestAnimation = [[NSMutableArray alloc] init];
for(int i = 1; i <= 60; i++)
{
    UIImage *thinImage = [UIImage imageNamed:[NSString stringWithFormat:@"ThinnestJump_%d.png", i]];
    [thinnestAnimation addObject:thinImage];
}

thinAnimationImageView.animationImages = (NSArray *)thinnestAnimation;
thinAnimationImageView.animationDuration = 2.0;
thinAnimationImageView.animationRepeatCount = 1;

thinAnimationImageView is an IBOutlet in my interface, and I call [thinAnimationImageView startAnimating]; when I want to animate the sequence of images. This heavily lags on the first call, but is fine thereafter. Is there anyway to prevent it from lagging the very first time?

  • 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-09T20:08:40+00:00Added an answer on June 9, 2026 at 8:08 pm

    UIImageView‘s built-in animation features are a good way of doing it. However, you need to load everything before you need to animate, such as at the app’s startup. If you need multiple different animations to be ready, load multiple UIImageView objects at startup and call the one you need later, with its startAnimating method.

    There are other methods to animate as well, such as using Cocos2D which uses OpenGL for animation, much faster performance. But then you have build your app in a different framework altogether, which might be overkill depending on what else is going on in your app.

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

Sidebar

Related Questions

I am making a game that has several classes and each one do some
I'm making a mobile game that has some complex game logic. I'd like to
I am making a game that has its own level editor. The editor simply
I'm making a multiplayer flash game that has a lot of graphics/code. I'm having
I am making an android game that should display a message that you have
Let's say I'm making an Use Case for a game that has a scoring
I am making a game that has a table (attack bonuses). What is the
I want to implement a walking animation into my game that I am making,
I am making a java game that has a sidebar that displays a player's
I'm making a 3D game with OpenGL that basically has a world made entirely

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.