Advertisement
Guest User

Untitled

a guest
Jun 1st, 2013
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Entita.prototype.draw = function (){
  2.     this.context.rect(this.posizione_x,this.posizione_y,this.width,this.height);
  3.     this.context.stroke();
  4. };
  5. Entita.prototype.clear = function () {
  6.     // this.context.clearRect(this.posizione_x, this.posizione_y, this.width, this.height);
  7.      //Richiamo il metodo per la creazione di un rettangolo con background
  8.      this.context.clearRect(this.posizione_x-4, this.posizione_y-4, this.width+10, this.height+10);
  9.      
  10. };
  11. Entita.prototype.enlarge = function (w,h) {
  12.      this.clear();
  13.      this.width     =   w;
  14.      this.height    =   h;
  15.      this.draw();
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement