destination.js 446 B

1234567891011121314151617181920212223
  1. function Destination(startx, starty) {
  2. var position = {x : startx, y: starty};
  3. this.init = function(canvas) {
  4. };
  5. this.update = function(canvas) {
  6. };
  7. this.draw = function(context, offset) {
  8. context.beginPath();
  9. context.strokeStyle = "#000000";
  10. context.rect(position.x - 5, position.y - 5, 10, 10);
  11. context.stroke();
  12. };
  13. this.getPosition = function() {
  14. return position;
  15. }
  16. this.visit = function(hero) {
  17. hero.addCoin();
  18. }
  19. }