You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was working on a game in Love2D and decide to port it to Monogame. Finding Humper helped me a lot since I was using Bump in Love2D but I did run into a issue I didn't have in bump:
I start off with a world with a width of 480 and height of 280 and cell size of 64 and 56 spheres (a 16 by 16 AABB) falling, the green number counts the spheres in the world, and make them fall, most of them bounce back using the default collision response but some of them pass through the floor. Am I doing something wrong or is this a bug?
The sphere have the following collision response:
floatnx=0,ny=0;floatdt=(float)gametime.ElapsedGameTime.TotalSeconds;_vy=Math.Max(_vy+(_gravity*dt),_maxHeight);nx=Position.X+(_vx*dt);ny=Position.Y+(_vy*dt);varmove=_box.Move(nx,ny,(collision)=>{if(collision.Other.HasTag(EntityType.Wall)){returnCollisionResponses.Bounce;}returnCollisionResponses.Cross;});foreach(IHithitinmove.Hits){if(hit.Box.HasTag(EntityType.Wall)){if((hit.Normal.X<0&&_vx>0)||(hit.Normal.X>0&&_vx<0)){_vx=_vx*-1;}if((hit.Normal.Y<0&&_vy>0)||(hit.Normal.Y>0&&_vy<0)){_vy=_vy*-1;}}}Position=newVector2(_box.X,_box.Y);if(_box.Y>480)// if they tunnel through the floor...{_entities.Remove(this);}
The walls don't have a response since they are static.
The text was updated successfully, but these errors were encountered:
Hi,
I was working on a game in Love2D and decide to port it to Monogame. Finding Humper helped me a lot since I was using Bump in Love2D but I did run into a issue I didn't have in bump:
I start off with a world with a width of 480 and height of 280 and cell size of 64 and 56 spheres (a 16 by 16 AABB) falling, the green number counts the spheres in the world, and make them fall, most of them bounce back using the default collision response but some of them pass through the floor. Am I doing something wrong or is this a bug?
The sphere have the following collision response:
The walls don't have a response since they are static.
The text was updated successfully, but these errors were encountered: