FoodHuntBasket.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /************************************************************************
  2. * FoodHuntBasket.js
  3. ************************************************************************
  4. * Copyright (c) 2021 Pedro Tonini Rosenberg Schneider.
  5. *
  6. * This file is part of Alfabetiza.
  7. *
  8. * Alfabetiza is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * Alfabetiza is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with Alfabetiza. If not, see <https://www.gnu.org/licenses/>.
  20. *************************************************************************/
  21. class FoodHuntBasket extends Object2D
  22. {
  23. constructor(name)
  24. {
  25. super(name);
  26. /** @type {FoodHuntPlayer} */
  27. this.player = null;
  28. }
  29. _update( /** @type {Number} */ delta)
  30. {
  31. this.position = this.player.position;
  32. }
  33. _draw( /** @type {Number} */ delta, /** @type {p5.Graphics} */ db)
  34. {
  35. db.rectMode(CENTER);
  36. db.fill(200);
  37. db.rect(0, 0, 110, 110);
  38. }
  39. }