cocos2d-x physics nodes slide along other - cocos2d-x

I am developing a game using cocos2d-x with built-in physics engine. In this game, user try to put object as stack and keep them balance.
However, i got a problem when i try to put an object on other one, it makes two objects slide along each other
I tried set friction value but nothing changes. I noticed that when i put a dynamic object on a non-dynamic object it's fine but when i put a dynamic object on other dynamic object, the problem (sliding along) will be happened.
I also create a gif demonstrate my problem because of my bad English.
http://makeagif.com/i/0lSVdW
Sorry i don't have enough reputation to post images.
I would appreciate any help!

Related

ConcurrentModificationException in a Java game

I am at the early stages of developing a 2d shooter game (Picture Metal Slug) using JAVA. I want to be able to shoot many bullets at the time. In order to do so i use a Set to control the current bullets on the screen, each time you click you spam a bullet, adding it to the screen and to the set of bullets (so in each frame, you move each bullet in the set according to their speed).
My problem is that if I click fast enough I get an
ConcurrentModificationException
Is there a data structure able to add and remove fast enough different objects without getting such exception? I can not find any that suit me.
Thanks in advance
The data structure able to suit your requirements is a ConcurrentHashMap, check:
http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html

LibGdx game dev shooting bullets

So basically every time i shoot, a new dynamic body is created with linear impulse , after constantly shooting my bullets game starts to get slow( it's obvious because i constantly create a new object..). What should i do to avoid this problem, i tried deleting objects, bodies?
Thank you for your answers in advance.
I'm still new to Java, but the way I understand it is that if anything references an object, that object won't be picked up by the recycler. Triple check all of your arrays and lists to make sure one isn't filling up with bullets. Display the sizes of your arrays while playing to see if one is acting weird.
For each bullet you probably want to see if it is off screen. If so, remove it from the list/array.
I know I am late but for future readers, Libgdx has something called object pooling specifically meant for things like this.

Alternativa3D: Actionscript3: How to avoid z-fighting in imported 3DS model?

I can't seem to find a specific solution for my problem so I hope someone here can help me.
I am experimenting with alternativa 3D in Actionscript3 and I managed to upload a textured .3DS model from 3D Max.
The object is a complex spaceship that wasn't intended to be used in a game but I wanted to use it as an example.
The problem is:
Since the imported model is complex it has a lot of overlapping parts. Alternativa z-sorting engine don't react well to this overlapping and the output is jittery texture(i don't know how else to call it) in the overlapping places.
I know next time to model my objects with as less overlapping parts as possible but I am sure this problem will reappear in other forms in the future.
The Alternativa documentation suggests using Decal objects instead of Mash objects but I can't seem to convert imported object Mashs to Decay objects.
Any help will be appreciated.
If you have a model where faces directly intersect one another, then I'd suggest this, not the engine, is the problem.
A well-built 3d model shouldn't have any intersecting faces - you may not notice or think it's a problem in a program like 3dsMAX, you can get away with it more - but it'll certainly show up in a real-time engine.

Create video movie from dynamic content

I have an application (actionscript) that displayes a slideshow from dynamic content written in xml. The slideshow runs in flashplayer. Now i have been asked to display the content as a video file format. Is it possible to do such a thing?
Thanks
To answer Your Question,
If I understand you correctly, and you want to create either timeline or scripted animation, and have as3 record what appears, then the answer is Yes.
Below is a great example:
http://www.zeropointnine.com/blog/updated-flv-encoder-alchem/
Really, all you have to do is to make all your actions and child animations happen inside a single Sprite or MovieClip, and then after every frame, copy the pixels from that object as it appears for that frame, and store those pixel in a ByteArray or even a Vector array of BitmapData.
That being said, once you have the data you will need to learn about encoding; yet, there are a ton of libraries out there that can help you avoid having learn a file spec and make an encoder from scratch.
Hope this helps.

Actionscript guru puzzle

Can someone suggest a workaround to the following problem:
I want to make an application that will create an area on stage that will be filled with images. Firstly, the images have to be 'saved' on an array. The problem for me is that I want this to be quite generic. I mean, according to a configuration file(?) or some constants(?), one build of the application may result to an SWF that will create a Rectangle area on stage filled with some graphics from virtual folder 1, while another build of the same application may result to one rectangle area and one triangle area each one filled with graphics from virtual folder 1, and folder 2 respectively.
I have stuck here sometime now. Can you suggest a workaround to this?
I'm not sure I completely understand your question, but I've been creating a somewhat similar application in AS3 which reads from a text-file using a URLLoader, and then parses that text to figure out which images to display on screen. It's quite easy to do basic parsing using the built in String library methods. Would this technique work for your problem?