0
votes
0answers
94 views

How to find correct offset to adjust sprite to the position of box2D body after rotation

I am trying to implement phsyics with the as3 box2d port. I currently have a b2body for each of some certain sprites in my game and I am able to update the sprite's positions correctly from the ...
2
votes
1answer
39 views

Why can't I swap fixtures on collision in Box2D?

I'm trying to swap the fixtures associated with a body after colliding with a specific obstacle. I can listen to the collision event by extending b2ContactListener. I tested it with a trace and it's ...
1
vote
2answers
410 views

Making the player walk on walls in box2d

I'm making a game in stencil where players walk form left to right along randomly generated walls. I cant use waypoints, since the walls' shapes and positions are unpredictable. Here's a descriptive ...
1
vote
2answers
1k views

Moving player in Box2d without forces

How do I move player with keyboard without applying forces? If I do playerBody.setLinearVelocity(new B2Vec2(0, 2)) it moves the player but when I release the key for movement, the ball is continuously ...
1
vote
0answers
165 views

Flick Kick like game with box2d and flash as3 [closed]

What would be the best approach for creating a game like flick kick with box2d and AS3?. To make my self more clear, what i would like to do is to use the physics of box2d in the z-axis, i know that ...
1
vote
1answer
2k views

Setting a Box2D Bodies Center?

How do I set the center of a fixture/body consisting of multiple shapes (triangles)?
2
votes
1answer
879 views

How to detect collisions in AS3?

I'm trying to make a simple game, when the ball falls into certain block, you win. Mechanics: The ball falls through several obstacles, in the end there are two blocks, if the ball touches the left ...
0
votes
2answers
2k views

AS3 > Mouse Event not happening?

Background: Trying to make a ball appear in the same location the mouse is positioned. Using Box2D Library. Working on a class file (.as) Issue: The mouse event does not work (I click but nothing ...
0
votes
1answer
434 views

How can I respond to mouse events in AS3?

Background: Trying to make a simple "drop the ball" game. The code is located inside the first frame of the timeline. Nothing more is on the stage. Issue: Using QuickBox2D I made a simple If ...
0
votes
1answer
417 views

AS3: StageWidth for BOX2D?

I know BOX2D uses meters, and AS3 uses pixels. I'm trying to create objects which are limited to the stageWidth. If I do this variable: for (var i:int = 0; i<(stage.stageWidth); i++){...} ...
0
votes
1answer
493 views

AS3: limit objects to stage width?

I want to limit the creation of objects acording to the stage width. My method is the following: for (var i:int = 0; i<7; i++){ If I put something like this, it won't work for (var i:int = ...
3
votes
1answer
982 views

How to get local point inside a body where mouse click occurred in box2d?

I need to find out the point inside a body, lets say a rectangular object, where the mouse was clicked on. I'm makin a game where the force will be applied depending on where the mouse was clicked on ...
4
votes
3answers
648 views

What do I need to change in Box2D to work in pixels?

Box2D seems to be set up in such a way that you cannot work in pixels (i.e. physics scale = 1). It produces very strange results as it hits maximum speed limits at low speeds and looks very strange. ...
6
votes
3answers
5k views

Polygon/Shape definition changes in Box2D 2.1

I was going through a pretty good tutorial on Box2D here, but I ran into a problem when he made a b2PolygonDef, because the tutorials were made in 2.0, and I'm using 2.1. I could download 2.0 I guess, ...