Tag Info

New answers tagged

0

In this answer I assume you are using C++ Object Oriented Programming. If you are using another language, then hopefully you are still able to make use of my answer. Do what drumbumLOLcatz said, and do collision detecting. This link has some good examples in JavaScript, which is easy enough to understand and convert to any other language. And a quick ...


0

Maybe you should consider making a two dimensional array for the chunks, [0][0] being the top left chunk of the map. That way you always know which chunks are surrounding the player and if the player reaches an end, you can put the first chunks next to the last ones, if you want to make the map loop.


0

My solution to this problem would be to simply use OnColliderEnter: private void OnColliderEnter(Collision collision) { collision.rigidbody.AddExplosionForce(power, transform.position, radius, 0); collision.gameObject.SendMessage("Damager", Damage, SendMessageOptions.DontRequireReceiver); } This problem solution assumes that the slash execution is ...


1

In your collision function, instead of returning a boolean, return a string so that you can detect each face: function colCheck(args) { if(obj2.y > obj1.y + obj1.height) { return "u" } if(obj2.y + obj2.height < obj1.y) { return "d" } if(obj2.x > obj1.x + obj1.width) { return "r" } if(obj2.x + ...


1

What's Happening This is completely accurate physical behaviour, which can be explained using a free-body diagram and a little high school physics1: The mass of the block is m and g is the gravitational constant. Fa is the applied force. To understand why the block is not moving, we can write out the force balances in the x and y directions. x-Momentum ...



Top 50 recent answers are included