Advertisement
xealgo

JS composition

Sep 19th, 2011
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Actor(//put arguments here) {
  2.     var actor = new GameObject();
  3.     var thinkDelay = 0;
  4.     var agroRadius = 0;
  5.     ...
  6.     var create:function(...){
  7.         actor.addComponent(ai..);
  8.         actor.addComponent(life..);
  9.         actor.addComponent(physics..);
  10.         actor.addComponent(rendering..);
  11.         actor.addComponent(animation..);
  12.         actor.addComponent(etc..);
  13.     }
  14. }
  15.  
  16. var zombie = new Actor();
  17. zombie.thinkDelay = 5;
  18. zombie.agroRadius = 25;
  19. zombie.create();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement