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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:39:56+00:00 2026-05-25T06:39:56+00:00

I am developing a game for the iPhone. The game basically animates objects on

  • 0

I am developing a game for the iPhone. The game basically animates objects on the screen, allowing a user to click on them. I am trying to use the MVC pattern. I have the functionality laid out as such:

Model:
Holds data about the targets (speed, relative size, image, etc)
Has timer running that adds targets to the list (should this be in the controller?)

Controller:
Subscribes to events fired from the model (such as target added)
Subscribes to events fired from the view (such as target clicked)

View:
Displays targets

The flow can be as follows:

  1. Controller tells Model to start game
  2. Model fires timer which says to add a target
  3. Controller hears event and passes it to view
  4. View adds image to screen (animating it)
  5. User clicks on image
  6. View fires event which says image was clicked
  7. Controller hears event and passes it to model
  8. Model removes target from itself

Lastly, I am unsure where to put the animation. Should the view construct the animation (based off of settings from the model)?

  • 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-05-25T06:39:57+00:00Added an answer on May 25, 2026 at 6:39 am

    I’d consider having the view or controller handle the animation so you can take advantage of Cocoa’s built-in animation support. For example it would go like this:

    1. View queries model for position
    2. View adds image to screen at position
    3. View queries model for velocity
    4. View computes new position after 0.1s and animates image to new position
    5. Cocoa fires animation complete event
    6. View hears event
    7. View computes new position after 0.1s more and animates image to new position

    And if targets can change velocity, you have some options. You can have the model fire events for velocity changes, and cancel the animation in progress and start a new one. Or you can just have the view requery the model each time an animation completes, ask for the valid position and velocity, and compute the next position. With the latter there would be some missynchronization between the model and the view, but with updates every 0.1s it wouldn’t get too far off. It depends how precise you need to be.

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

Sidebar

Related Questions

I am developing a 2d game for iPhone by using cocos2d. I use many
I'm developing a poker game in C#. At the moment I'm trying to get
I'm developing a simple 2D-game in OpenGL ES for the iPhone. My problem is
I'm developing a game for iPhone and is pretty far along, but one thing
I'm developing a game for iPhone and is pretty far along, but one thing
I am developing 2D game for iPhone, for that I need to handle collision
this is my question. I'm developing a game on iPhone with OpenGL ES. I
I'm developing an iPhone game and currently using AVAudioPlayer for playing background music and
I am developing an iPhone game in which birds bounce. I have set up
I am developing an iphone game using cocos2d and have it set to to

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.