Skip to main content
deleted 412 characters in body
Source Link

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

    }

    position += velocity * directionNormalized;```

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

    }

    position += velocity * directionNormalized;

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }
```
deleted 1 character in body
Source Link

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

        }

    position += velocity * directionNormalized;

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

        }

    position += velocity * directionNormalized;

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

    }

    position += velocity * directionNormalized;
deleted 5 characters in body
Source Link

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

        if (velocity != Vector2.Zero){

            if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
                DirectionalCollisionCheck(obj);
            }

            directionNormalized = Vector2.Normalize(direction * direction);

        }

    position += velocity * directionNormalized;

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

        if (velocity != Vector2.Zero){

            if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
                DirectionalCollisionCheck(obj);
            }

            directionNormalized = Vector2.Normalize(direction * direction);

        }

    position += velocity * directionNormalized;

So, I broke out some old physics formula books and had some sort of a revelation. I added updateTime = (float)gameTime.ElapsedGameTime.TotalSeconds; into the main update function of the character and changed the following code and now it seems to work (?):

    private float accelDistance = 20f;
    private float decelDistance = 60f;
    public float velocityMaximum = 180f;
    private float updateTime;

    public float Acceleration { protected get { return accelDistance * updateTime; } set { accelDistance = value; } }
    public float Deceleration { protected get { return decelDistance * updateTime; } set { decelDistance = value; } }
    public float VelocityMaximum { protected get { return velocityMaximum * updateTime; } set { velocityMaximum = value; } }

The diagonal normalization seems to work with the following code changed as well:

    Vector2 directionNormalized = Vector2.Zero;

    if (velocity != Vector2.Zero){

        if (SimpleCollisionCheck(objects, out GameObject obj) == true) {
            DirectionalCollisionCheck(obj);
        }

        directionNormalized = Vector2.Normalize(direction * direction);

        }

    position += velocity * directionNormalized;
deleted 1 character in body
Source Link
Loading
Source Link
Loading