Skip to content

rectangleCollision (and possibly others) seem to break with constant acceleration mechanic  #12

@jbockmon

Description

@jbockmon

I have a platfomer with a constant acceleration built in to simulate gravity:

let playerGravity = 0.2;
playerSprite.vy += playerGravity;

collision detection for playerSprite and array of sprites that are allowed to collide with the playerSprite:

if( b.hitTestRectangle(playerSprite, collSprites[i])){
b.rectangleCollision(playerSprite, collSprites[i], false);

where:

b = new Bump(PIXI);

on "impact" where playerSprite lands on top of a tile with which it can collide first aligns the playerSprite to the tile, then after ~1 second @ 60fps, the playerSprite disappears. Movement is also hindered after collision to whole tiles before playerSprite disappears.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions