Beispiel #1
0
 public GameScene(Game game)
 {
     this.game = game;
     map = new Map(groundLayer);
     role = new Role("imgs/role1", new CCPoint(0, 0), groundLayer, map);
     this.addChild(groundLayer);
     this.schedule(update, AppContext.UPDATE_INTERVAL);
 }
Beispiel #2
0
        public Role(string roleImgPath, CCPoint position, CCLayer layer, Map map)
        {
            this.map = map;
            this.layer = layer;
            Col = (int)position.x;
            Row = (int)position.y;
            if (!string.IsNullOrEmpty(roleImgPath))
            {
                Sprite = CCSprite.spriteWithFile(roleImgPath);
                Sprite.position = new CCPoint(position.x * AppContext.MAP_WIDTH + 15, position.y * AppContext.MAP_WIDTH + 15);

                layer.addChild(Sprite);
            }

            OringinGround = map.GroundList[Row * Map.Width + Col];

            GetPathNodeList();
        }