OK I started using gamedevelop and got asking really many questions… Then I got a helping hand from the most helpful and kind community in game development world. So the only two questions left from me is,
How do you make gravity zero? and How to make abody behave like a solid?
If I get answers for these I AM SORTED.
P.S.: I tried using platform automatism but didn’t work.
I tried setting Gravity to the body’s coordinates but didn’t work.(the body goes flying in the bottom right corner)
edit: If you could make gravity 0 then physics could handle the solid thing.( I also suggest using asm.js for future GD versions)
I am making a puzzle game right now so the objects require to be solid(to prevent from overlapping).
Please reference the gdg:
I use a group to move away the solids from the gems. But on dragging the blue gem(for instance), the other blue gems will not move away. Only the rest of the colors will move.
I’ve used a group to represent all solids and tested but didn’t work
I’ve used groups to represent all gems but of that colour(for eg. Gems-Red means All Gems except of for red), but that didnt work either.
I’ve also tried another method(which will be easier to understand from the gdg that actually explaining) but doesn’t work again. 2D_Rubix.gdg (35.8 KB)
Interacting with instances of the same object is always tricky.
In your case, you could cheat the player.
Create an object AllGems, which will be offscreen but draggable.
When you click on a gem, teleport it off screen, put AllGems in the same coordinates, set AllGems’ animation to match the visual of the clicked gem.
With AllGems looking like the clicked gem, the player will think he’s dragging the real gem. But with this different object, you can manage the interactions with the other gems.
When AllGems isn’t dragged anymore, switch its coordinates with the gem offscreen (use its offscreen coordinates to identify the gem from the other gems).
BTW, you can use one object “Gem” with as many animations as there are different looking gems. Switch the animations to change their visual, and determine what kind they are (if animation = 1 then … if animation = 4 then …). It’s like using an object variable, without having one.