Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. var BusView = new Class({
  2. initialize: function (x,y,t)
  3. {
  4.  
  5. this.sprite = new sprite(t,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. this.tex = phoenix.loadTexture("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, this.tex);
  33. }
  34. }
  35. }
  36. });
  37.  
  38. var grid = new Grid(10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement