Tag Info

New answers tagged

0

Since this is a top down shooter, and you have the basic shooting done, here is a 5 minute piece of (untested) incomplete code that allows for the creation of bullets at different angles. public class Bullet { protected Texture2D texture; protected Vector2 position; protected Vector2 angularVelocity; /// <summary> /// Defines a ...


0

Here's the simplest math function for velocity based objects utilizing parametrics. x += cos(theta); y += sin(theta); The end. It's really quite simple because speed is a scalar, but we want speed and direction, in essence, a vector -VELOCITY, thus we end up splitting our speed vector into x and y components as needed by a dimensional object. You can ...


0

I have answered this before, not that difficult, although this method is only as accurate in relation to how many points, perfect accuracy is when the number of points you use reaches infinity. have a vector that is the flying bullet, it starts at exit of muzzle with a direction and speed. have a vector of gravity, a vector of air resistance. have a force ...


0

Sounds like your talking about inertial force, if right go further right, that sounds like interia. Record previous movement use that as inertia value. If rocket adds rotation of x, it will same rotation for every iteration of x time. If you are talking about gravity, isn't that just a translation of the object some distance based on current speed * time ...


1

Your drawings seem inconclusive with respect to axis names and signs. Just going by the first illustration, you could say approximately: _playerSpeedY = 2 _playerSpeedX = -1 // going to the left, negative! radians = atan2(_playerSpeedY, _playerSpeedX) degrees = radians * 57.29577951 I get radians = 2.0344439357957027 and degrees = 116.56505117080718 ...



Top 50 recent answers are included