Questions tagged [nape]

Nape is a powerful, fast, and friendly 2D Rigid Body physics engine for AS3/Haxe. Nape is open-source and free to use for personal and commercial projects.

Nape is a 2D rigid body physics engine designed for games, written in Haxe, and supporting all Haxe targets. Nape is compiled into .swc libraries for AS3 users.

Nape is higher performing than Box2D solutions in AS3/Haxe, and its memory usage is stable and far less than Box2D. Nape supports the majority of Box2D features, as well as many features not included in Box2D such as the geometric utilities, the high-level callbacks system, and more sophisticated buoyancy.

28 questions
0
votes
1 answer

Which AS3 physics engine can replay a simulation consistently?

I'm currently using the Nape physics engine for a "Peggle" style game in ActionScript 3.0. It is very easy to use, and runs smoothly. However, The only difficulty I'm running into with Nape is replaying the exact same simulation. Even if I supply…
chamberlainpi
  • 4,854
  • 8
  • 32
  • 63
0
votes
0 answers

Nape Resulting Impulses

I'm trying to make the player body, when certain condition is met, to go up few "meters" then stop slowly in the "air" and come down. The gravity is 600 public var gravity:Number = 600; public var space:Space = new Space(new Vec2(0, gravity)); I…
RAO
  • 71
  • 1
  • 13
0
votes
0 answers

Nape event when ready?

Is there a way to check/listen for the simulation to be ready ? I'm using a lot of objects so the scene and the engine take time to init. Is there an event in Nape that is dispatched when its ready ? Dispatching at the end of my init scene function…
Eric
  • 9,870
  • 14
  • 66
  • 102
0
votes
1 answer

Nape space.step and constant impulse

I have a weird issue. If I move a body in nape every ENTER_FRAME (to get a constant movement) using a vector var vec:Vec2 = new Vec2(40,0); and apply it as impulse with body.applyImpulse(vec);, when I 'render' the scene doing space.step(1 /…
Eric
  • 9,870
  • 14
  • 66
  • 102
0
votes
1 answer

starling and napephys updating hand anchor

I am currently using the native stage to calculate the physic bodies in nape physics world i am using, the display objects are built on starling engine. I am wondering if this is the best way to mix starling and nape together (using native stage on…
Eran
  • 1,628
  • 16
  • 31
0
votes
2 answers

Nape Physics ShapeDebug seems to be scaled

i have a strange problem with a simple nape demo... here's my code package com.secretpackage { import flash.display.Sprite; import flash.events.Event; import flash.text.TextField; import nape.phys.Body; import nape.shape.Circle; …
Michael
  • 792
  • 1
  • 7
  • 14
0
votes
1 answer

Nape Physics AS3 - Simple Tennis Game

I'm developing a very simple tennis game using Nape: A rigid object (a tennis racket) follows the mouse coordinates and hits another object that has the property of bouncing. I read many examples of Nape, but I don't know how to setup the tennis…
Miguel Lara
  • 183
  • 1
  • 12
0
votes
2 answers

Nape Physics or Actionscript physics?

I got a question regarding using Nape Physics with Actionscript 3.0. I have a concept which involves 20-300 of balls appear on the screen with no gravity. With no gravity I mean that there is nowhere where the ball will fall too. Just see it like…
Banzboy
  • 113
  • 1
  • 2
  • 8
0
votes
3 answers

nape remove body in collision

I have a function that detects when the objects collide but how do I delete one of them? private function fruitToFloorCollision(collision:InteractionCallback):void { // TODO Auto Generated method stub trace('fruit…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
1 answer

nape removing body from the space

When I sue the following code the body graphic is removed, however in debug mode I can still see the outline of the body which would suggest the body still exists. How do I totally remove this body? private function updateGraphics(b:Body) { …
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
1 answer

nape - targeting only one body

I have a few body in nape one is a loop of 'baddies' the other is a single 'hero' I call my updateGraphics function but how to I taget the hero within this function, I have tried hero.userData.graphic.x but it passes in an array of bodies, is there…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
0
votes
1 answer

nape making a body follow the mouse

I have a dynamic body in name and want to make its x position follow the mouse, is this possible. player = new Body(BodyType.DYNAMIC); player.shapes.add(new Polygon(Polygon.rect(400, 350, 100, 150))); player.shapes.add(new…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
-1
votes
1 answer

How to Use .as Exported File from PhysicsEditor

The question was here for a long time with bounty and no satisfying solution for me. I erased the first post and am posting instead a question that can be answered quickly with a yes or no so I can proceed with my doings. If you could answer it…
RAO
  • 71
  • 1
  • 13
1
2