I have two questions I have been stumped with and I am sure they are simple solutions I have not yet been able to find answers for!
1) I have gravity pull all objects down off the screen and new objects show up at the top. All objects get faster the further down the screen they go, as their velocity increases from the gravity. Great. However, I do not want the velocity of a particular object to ever change. I want it to be very slow, and stay at the same speed from top to bottom. As a ghetto fix I have setup a timer and applied a force against it to slow it down for now, this shouldn't be a viable long-term solution?
2) Shape defintion - I have some very large, and strange shaped objects (imagine the letter S or Z). They are images so I am just using the image size for the shape right now, however, if something is inside the empty areas of the letters, collision should not occur. These files use a transparent background, is there a way to detect transparency and if not, what would be the best way to define the areas of this object so that another object can go inside these empty areas but not the actual letters?
Comments
For 2, there's no way to do this within Gideros itself (i.e., look at alpha areas and build up list of convex polygons). You can use 3rd party tools that will automatically decompose a complex shape into multiple convex polygons. Some of the tools include Box2d Editor (http://code.google.com/p/box2d-editor/) and Physics Editor (http://www.physicseditor.de/). Physics Editor added support for Gideros in version 1.0.9 (see note in: http://www.physicseditor.de/download/) but I've never used it. I made a very amateur attempt a while back to use the Box2d Editor w/ Gideros @ https://github.com/ndoss/gideros_playground/tree/master/box2d_editor_example.
Likes: avo
You could also do it by hand but I imagine that would be very time consuming.
edit: aha ndoss with a faster and better answer
Likes: ndoss
EDIT: I suppose I could also put it on a timer and set it's position slightly below it's current position etc... and define the object as static? Would be nice to just have a VelocityIncrease = false type option though. Lol
Problem is, when there are many objects, they can collide and change force direction.
You can also try to combine, low gravity with applying force in direction of gravity (not against it).
Don't forget about linear dampening for bodies. I think it is possible to increase it to work against gravity.
Last thing that comes to mind, you could tween a static or kinetic body, so it moves the way you need at speed what you need.
There are plenty of solutions, just need to experiment, to find most suitable for you.
I only have 2 objects I do not want to have the speed increase on. At any given time, there are about 6-10 objects, 3 walls, and 2 objects I don't want to increase the speed on displayed on the screen.