SHARE
TWEET

Untitled

a guest Jul 17th, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var BusView = new Class({
  2.     initialize: function (x,y)
  3.     {
  4.    
  5.         this.sprite = new sprite(false,vec2(x,y), true, false);
  6.        
  7.         this.sprite.cells( vec2(50,50) );
  8.        
  9.         this.id = -1;
  10.        
  11.         this.sprite.frame = 4;
  12.     },
  13.    
  14.     setID: function (id) {
  15.         this.id = id;
  16.         this.sprite.frame = 1;
  17.     },
  18. });
  19.  
  20. var Grid = new Class({
  21.     initialize: function (size) {
  22.         this.views = [];
  23.        
  24.         //this.sprite = new sprite('./data/property.png',vec2());
  25.         //this.sprite.visible = false;
  26.         phoenix.loadTexture(project.path("./data/property.png"), true);
  27.        
  28.         for (i = 0; i < size; i++)
  29.         {
  30.             for (j = 0; j < size; j++)
  31.             {
  32.                 this.views[i*100 + j] = new BusView(i*65,j*65);
  33.             }
  34.         }
  35.     }
  36. });
  37.  
  38. var grid = new Grid(10);
RAW Paste Data
Top