Skip to content

physics don't work when angle is -90 or 90 #29

Description

@yonimal676

This problem is caused from the velocityX being impossibly tiny (7.717558E-5 for example).

so one solution might be setting velocityX to 0 AS IT SHOULD BE when the angle is 90 or -90.

I've tried it and it's not the problem.

Found the source of the bug:

if (ball.velocityY == 0 || ball.x >= ball.range * ball.ratioPXtoM)
                ball.velocityY *= -1;

To be honest i have no idea why it was there in the first place, but that happens sometimes...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions