我是这样写的 就是不知道怎么设置类似在 cocos2dx 里面的m_uID 值 有什么方法可以设定精灵的类型吗 游戏是消除星星
有哪位大神能帮忙下 刚接触cocos2d-x + lua
local function add_star(layer)
local pos_x = 16;
local pos_y = 16;
array = CCArray:create();
math.randomseed(os.time());
math.random();
for i=1, 100 do
local star_num = math.random(5);
star_sprite = CCSprite:createWithSpriteFrameName(string.format(“star%d.png”, star_num));
star_sprite:setPosition(pos_x, pos_y);
star_sprite:setTag(i);
pos_x = pos_x + 32;
if pos_x > 304 then
pos_x = 16;
pos_y = pos_y + 32;
end
array:addObject(star_sprite);
layer:addChild(star_sprite,1);
end
end