Code Monkey home page Code Monkey logo

pandorasbox's People

Contributors

cruor avatar demojameson avatar

Stargazers

 avatar

Watchers

 avatar

pandorasbox's Issues

DrivableCar Bugs

  1. Audio.Play should be inside HitSpring, otherwise the audio will play each frame

    foreach (Spring spring in scene.Entities.Where(e => e is Spring))
    {
    if (this.CollideCheck(spring))
    {
    Audio.Play("event:/game/general/spring", this.BottomCenter);
    HitSpring(spring);
    }
    }

  2. When speed.X happens to be exactly 0, then facing will be 0, so sprites.scale.X = 0, which make sprites disappear

    private void HitSpring(Spring spring)
    {
    if (this.springDelay == 0) {
    this.speed.Y -= spring.Orientation == Spring.Orientations.Floor ? 240f : 140f;
    this.speed.X += spring.Orientation == Spring.Orientations.WallRight ? -180f : (spring.Orientation == Spring.Orientations.WallLeft ? 180f : 0);
    this.facing = Math.Sign(this.speed.X);
    this.springDelay = this.springGrace;
    this.springMethod.Invoke(spring, null);
    }
    }

  3. Either we should check invincibility in OnCollideH, or we should check crashed when updating nitroActive
    Currently if we enable invincibility, car crashes, then we (still on car) can no longer change the direction, but we can still press dash to make the car move, that's really weird

    private void OnCollideH(CollisionData data)
    {
    if (Math.Abs(speed.X) > this.maxSpeed * 0.85)
    {
    this.crashed = true;
    this.talker.Visible = false;
    if (driver != null && !driver.Dead)
    {
    driver.Die(Vector2.Zero);
    }

    private void updateSpeed()
    {
    this.speed.Y = Calc.Approach(this.speed.Y, 200f, 400f * Engine.DeltaTime);
    // Madeline is not "in" the car yet
    if (this.enterDelay > 0)
    {
    return;
    }
    this.nitroActive = driver != null && !driver.Dead && this.currently_driving && Input.Dash && this.nitroDuration > Engine.DeltaTime;
    // Nitro is allowed in air, but can only go forward
    if (this.nitroActive)
    {
    float newSpeed = this.speed.X + this.facing * this.nitroAcceleration * Engine.DeltaTime;
    this.speed.X = MathHelper.Clamp(newSpeed, -this.maxSpeed, this.maxSpeed);
    }

  4. If we have upward speed, and we don't press dash, then there's no speed clamp in updateSpeed, ok that sounds reasonable
    but hitting a left wall spring gives us upward speed and speed.X += 180f, so we will get speed.X = 564 after hitting such a spring
    in this case if we hit a right wall spring, our speed will be 384 > maxSpeed * 0.85, so we will still crash into right wall!
    maybe we should rewrite HitSpring to ensure that, if we hit a right wall spring, then our speed will be atmost 0 (or maybe atmost -180)

    if (!(this.speed.Y >= 0 && this.speed.Y <= Calc.Approach(0f, 200f, 400f * Engine.DeltaTime)))
    {
    return;
    }

    celeste

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.