This repository has been archived on 2025-04-27. You can view files and clone it, but cannot push or open issues or pull requests.
Servers-Under-Maintenance-G.../classes/Trashbin.js

21 lines
507 B
JavaScript

class Trashbin extends GameObject {
constructor(x, y) {
super(x, y);
this.clickable = true;
this.acceptsItem = true;
this.hitbox = new Hitbox(this.x, this.y + 5, Game.TILESIZE, Game.TILESIZE - 5);
}
draw() {
Game.c.drawImage(Assets.trashbin, this.x, this.y);
}
passItem(item) {
if (Game.player.distance(this) < Game.TILESIZE) {
Assets.sounds.trash.play();
if (Game.gamestate == "tutorial" && Game.tutorialStep == 30) {
tutorialStep();
}
return true;
}
return false;
}
}