Skip to content

Commit

Permalink
fix: fixed pit trap hitbox being too small
Browse files Browse the repository at this point in the history
  • Loading branch information
Picoseconds committed Aug 7, 2020
1 parent b4b609c commit e62567d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/moomoo/Physics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function moveTowards(player: Player, angle: number, speed: number, deltaTime: nu
* @param gameObj the GameObject to test collision for
*/
function collidePlayerGameObject(player: Player, gameObj: GameObject) {
return collideCircles(player.location, 35, gameObj.location, gameObj.realScale);
return collideCircles(player.location, 35, gameObj.location, gameObj.data === ItemType.PitTrap ? 0.3 * gameObj.realScale : gameObj.realScale;
}

function tryMovePlayer(player: Player, delta: number, xVel: number, yVel: number, state: GameState) {
Expand Down
3 changes: 2 additions & 1 deletion src/moomoo/Player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class Player extends Entity {
public spdMult: number = 1;

public upgradeAge = 2;
public invincible = false;

public foodHealOverTime = 0;
public foodHealOverTimeAmt = 0;
Expand Down Expand Up @@ -312,7 +313,7 @@ export default class Player extends Entity {
this.angle,
getScale(item),
-1,
item === ItemType.PitTrap ? 0.3 * getScale(item) : undefined,
undefined,
item,
this.id,
getGameObjHealth(item)
Expand Down

0 comments on commit e62567d

Please # to comment.