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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:22:23+00:00 2026-06-14T00:22:23+00:00

In my game a objects (bodies) move each frame and it does not matter

  • 0

In my game a objects (bodies) move each frame and it does not matter I use Box2D or Nape.

    //for example
var body:Body = createNewBall();
addChild( body.graphic );
    addEventListener( Event.ENTER_FRAME, loop);

    private function loop():void {
    space.step(1/30, 10, 10);
    }

But Starling use animation with jugglers. Perhaps it somehow affects performance.

var body:Body = createNewBall();
addChild( body.graphic );
var tween:Tween = new Tween(body.graphic, 2);
tween.animate("x", glX);
tween.animate("y", glY);
Starling.juggler.add(tween);

But how to use the jugglers in case enter_frame animation?

  • 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-14T00:22:24+00:00Added an answer on June 14, 2026 at 12:22 am

    When using a physics engine usually you won’t animate your objects by regular Tween added to the starling juggler, but instead you just update the position of the graphic object according to the positon calculated by the engine on each step. You are going to need to use an ENTER_FRAME so you can make the engine advance each step. Using your posted code, you could do something like:

      //for example
      var body:Body = createNewBall();
      addChild( body.graphic );
    
      //callback to update graphic position
      body.graphicUpdate = updateBallGraphics;
    
      addEventListener( Event.ENTER_FRAME, loop);
    
      private function loop():void
      {
        space.step(1/30, 10, 10);
      }
    
      private function updateBallGraphics(b:Body):void
      {
        b.graphic.x = b.position.x;
        b.graphic.y = b.position.y;
      }
    

    There is a great tutorial on gotoandlearn.com about using Starling and Nape that covers this, and all the basics you’ll need to get started. Hope this helps!

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

Sidebar

Related Questions

I am designing an app which tracks data on Game objects. Each Game has
I have a database with lots of game objects, which is being queried by
I am writing an application (a multiplayer game) where objects need to be passed
I am doing a game where I create objects and kill them frequently. I
I am trying to send objects across a socket for a game, but they
I work on a 2D shooter game with lots of moving objects on the
In a game i'm programming, I use a composite object for all entities within
Here's a simple example: class World<S extends Sprites, B extends Bodies> { // Both
So I want to create a function that creates game objects in my XNA
I'm trying to do collision check on my game objects. I have a multimap,

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.