Help with Stacking game

Hello,

I'm currently working on a stacking game with box2d as physics engine.

I searched a lot on the internet and i learned that i had to use a movieclip with all the box2d objects in it, and move that (container) movieclip if i want to move the whole stack up and down.

I have done that but theres a problem left. When i drop a cube and it turns, the whole shape is stretched.

Demo: http://www.aymeric.nl/box2demo.swf

How can i keep the rectangle rectangular and not square when i turns? Do i have to use globaltolocal or something?

Thanks!
Judging by how the rectangles rotate, looks like the Box2D objects are actually squares, and the movieclip (the container) is stretched vertically. When the "rectangles" rotate 90 degrees, they're still rectangles with the long sides on the left and right sides. Whether or not the Box2D objects are in separate sprites/movieclips or being redrawn each frame, a stretched container would have this effect. (Unless the Box2D objects ARE in separate sprites/movieclips but are redrawn inside of them each frame, then it's either a stretched big container or stretched individual containers of the Box2D objects, but maybe I'm overthinking this).
Thanks for your response.

The cube is indeed square. I made the rectangle vertically big because i move it down when you click. so its possible to stack higher than the top of the stage.

What do you think is the best option to make the cubes square instead of stretched?

Thanks
If you resized the container rectangle in the stage rather than remaking the rectangle when editing the container, that would be the problem. So the best way is to stretch it back to normal size (or delete it), then edit the container by remaking or resizing the rectangle when you're editing the container itself (not on the stage) (then add it back in the stage if you deleted it).
If you plan on making the container be any size, then I suggest to draw the rectangle inside the container by code.
Thank you

You're a genius 😉

That part works like a charm now.

Now can i work on the right positioning of the black floor bar where i stack the cubes on.

Thanks again (can i do something for you perhaps?)
You're welcome. -]

Original thread: https://box2d.org/forum/viewtopic.php?t=7771