Oklahoma City Casual and Mobile Game Development

I design and develop casual games for desktop, mobile, Android, and iProducts (think Words with Friends and Angry Birds). I am currently employed as a Flash Games Software Developer. I also build games on the side incorporating the latest industry technologies, which allows me the opportunity to experiment with and develop the most advanced, visually appealing, and most of all engaging and fun gaming experiences.  Anyone looking for desktop and or mobile games design and development for Android, iPhone/iPad, AIR, PC and Mac please contact me here for further discussion. You can also fill out the contact form at the bottom of this or any other page; just include in the subject “All Fun In Games!”…

AS3: Moving a Starling object with Nape

For those who may not have been able to find anything about this or just not figured it out yet, here is an effective way to animate the coordinates of a Starling Movieclip while keeping the Nape body physics in tact:

 

setup body.graphic as a Starling Object

animate the body.graphic within an EnterFrameEvent:

public function animate(EnterFrameEvent:Event):void {      
     body.graphic.x +=  10; 
     body.graphic.y += 10; 
     //here is where the black magic begins      
     updatePos(body); 
}

 

now the update:

public static function updatePos(body:Body):void {      
     body.velocity.x = (body.graphic.x - body.position.x) / GameSpace.timeStep;     
     body.velocity.y = (body.graphic.y - body.position.y) /  GameSpace.timeStep;      
     //timeStep is determined by you, so change and tweak it until you get it right     
     //I am currently using: GameSpace.timeStep = 1 / 90; 
} 

 

This will update the body KINEMATIC or DYNAMIC body along with the associated body.graphic.
Keep in mind that your space.step will need to be updated as well as the amount of space covered by your EnterFrameEvnt to get the right balance of movement of body, speed and collision/sensor checks…

 

- Nape moves me