andengine polygon body and box2d collision - android

I recently changed my bodies from rectangle to polygons
and got a weird bug and I can't figure it out why its happening.
When my "player" body touch another body - with a negative angle he just stack on it.
My player X velocity is always constant 5
when I'm switching the body back to rectangle it working fine
Does any one fimiliar with this bug? or have any idea what can cause it?

Found a bug in andengine:
When I put 3 point in the same button line this will cause the bug I write above:
To fix that you need to make sure that on evry line on the poligon there are only 2 points!
Works fine now :)

Related

unity Bézier Path creator android moving problem is start laggy when scene changed

Im using bêziers path not vertex one. And in editor(windows) there is
no problem with it. im building for android and trying to play with
galaxy m21. first scene is completely normal. but when it comes for
other scenes it start moving laggy (because of path follower i think).
(im not talking about side walks just movement to forward along the
path)
there is 4 scene and this is looping when click next level in the end.
if we return to first scene that one starts to laggy movement.
game is a little city we move in streets so i was thinking maybe
render based problem so i delete every gameobject about city it became
almost some kind of empty space and tried, same problem.
also i was using different gameobject to follow pathfollower so i
remove that and put my player directly inside pathfollower but it
remains same. when i go next level it starts moving laggy not smooth.
(i understand it because there is trail and shaking time to time)
finaly i add game manager's awake() System.GC.Collect();
Resources.UnloadUnusedAssets(); maybe it helps when nextlevel loaded.
but still it is laggy forward movement.
any idea what is going on? i can take any suggestion thanks for help.
i just find it i was using Dotween for side movement but it was using x,y and z That was my problem.
I dont know how it works when its first loaded. I mean if i load the game and play it works first level but other levels starting >
-sorry i dont know exactly word but its lagging/freezing in the movement.-
But if i close app and start again, that same level works just fine.
Anyway i just tried to disable that script at tried and i see no shaking/freezing in the trail so, i think that was the problem, thats my fault i think like i said, i'm new :)
now i try use tween except the z or try completely diffrent thing.

lbgdx - Particle Effect is not rendering

I have a problem attaching a Particle Effect, made by the particle editor, in my android code. It is just not rendered in runtime, even if the duration of the effect should be around 3 sec and it is positioned on the center of the screen.
As I can see some few other users faced with this kind of problem before but every answer they got didn't help me.
Here is my code:
// in creating
effect = new ParticleEffect();
effect.load(Gdx.files.internal("effects/prova2.p"), Gdx.files.internal("effects"));
effect.setPosition(Gdx.graphics.getWidth()/2, Gdx.graphics.getHeight()/2);
effect.start();
//in rendering
effect.draw(game.batch, delta);
Also I tried to change "delta" with my world step value (1/40f) or calling Gdx.graphics.getDelta() but that doesn't seem to be the problem.
It seems like you're not updating the particle effect.
Try including:
effect.update(delta);
effect.draw(game.batch);

AS3 Rotating MovieClip around specific point on stage, no matter where the MovieClip is

I'm making a game in flash sc6, air for android.
So let's say that my character is added to the stage at this position:
character.x = 400;
character.y = 200;
I have a MOUSE_DOWN function that moves the back ground (so it looks like the character is moving).
Now I want a function that, when it's triggered, makes the back ground rotate around the character.
It should be so that no matter what the coordinates of the back ground is, it should always rotate around the character (400, 200)
Has anyone got any information or answers to how to do this?? Any code would also be helpfull
Thanks in advance :)
You're going to want to change the registration point of the background. This can be done using a simple transform matrix.
see
AS3: setting registration point of a DisplayObject with actionscript?

Android MapView path.draw draws crazy polygon lines all over the place

I've been struggling for a couple of weeks now with google's android mapview.
I'm drawing a large amount of polygons with a large amount of points. on average 15 polygons and around 1000 points each.
The first issue I experienced was performance... No surprise. After doing some testing I realised the culprit is projection.ToPixel() which I successfully bypass when the users pans by simply moving all my points in the direction by x amount of pixels (the difference), however when zooming I have no choice but to make use of the toPixel method.
Is there possibly a more efficient way of modifying my points depending on the zoom level? after some research I've found examples on how to do this with circles and other shapes, but I have no clue where to begin with reshaping polygons, any ideas on this?
The second issue i'm having is that when I have the entire polygon in view all is grand, but when I pan over the map bounds (where the map is effectively starting again to the left and right) on any side the polygon lines seem to reach and stretch out across the map bounds causing crazy spaghetti lines all over the place! I take it what's happening is that the path.close() or path.LineTo() methods think the shortest path is flying halfway across the world to reach the next point which causes these lines. I have no idea how to address this. I simply can't ignore points that do not fall within the current lon/lat spans because that (obviously) causes the polygon to change shape al the time!
Has anyone experienced this issue and how can one go about solving it? I'm not even sure what I should be googling!?
UPDATE 1:
The problem can be easily solved by preventing the mapview from looping. Is there some way to prevent the mapview from looping the world!?!?

How to implement a DrawLine function ?

Question : Is there any better way to implement a function that draws line on the screen other than drawing circles on the input points ?
Details : I am trying to write a function which basically will draw a line.However the line will not be a regular colored line. This line will let user to copy pixels from one image to another trough that line , you can think It like "history brush" or "stamp" on Photoshop . My first thought was just get the points and draw circles on each point. Which is working but not smooth and have some bugs. The first problem is it is not working if user sweep his finger too fast. I thought it would solve problem if i can fill the dots between two points and then draw the line which is kind of work but this time drawing gets very slow. One other problem is that it never looks smooth.
Bresenham's line algorithm
Isn't the BitmapShader what you're looking for?

Categories

Resources