Skip to content

2D tutorial bug #246

@LeonVincii

Description

@LeonVincii

2D tutorial Chapter 12: Collision Detection has the following bug:

// If the normal is anything but Vector2.Zero, this means the bat had
// moved outside the screen edge so we should reflect it about the
// normal.
if (normal != Vector2.Zero)
{
    _batVelocity = Vector2.Reflect(_batVelocity, normal);
}

the normal here needs to be normalised because the bat can hit in the corner and results in a (1, 1) normal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions