RemoteSnake.js 871 B

1234567891011121314151617181920212223242526272829303132333435
  1. var o0 = require('o0');
  2. var o0CC = require('o0CC');
  3. var o0Game = require('o0Game');
  4. cc.Class({
  5. extends: require('Snake'),
  6. properties: {
  7. },/*
  8. addHead:function(){
  9. this.head = new cc.Node('head');
  10. this.body.push(this.head);
  11. this.head.parent = this.node;
  12. this.head.rotation = Math.random() * 360;
  13. //this.tag = o0Game.CollisionTag.Head;
  14. this.addGraphic(this.head);
  15. },
  16. addBody:function(){
  17. if(this.node.active == false)
  18. return;
  19. var i = this.body.length;
  20. this.body.push(new cc.Node('body'+i));
  21. this.node.addChild(this.body[i],-i);
  22. this.body[i].x = this.body[i-1].x;
  23. this.body[i].y = this.body[i-1].y;
  24. this.body[i].rotation = this.body[i-1].rotation;
  25. this.addGraphic2(this.body[i]);
  26. },/** */
  27. });
  28. //module.exports = Snake;