Merge pull request #6341 from samuele3hu/develop_fix

fix two bugs found in the testing
This commit is contained in:
James Chen 2014-04-22 15:09:10 +08:00
commit 83c1c74475
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
1f20f88e2a2985963fc6a2d89ea07be41e8e74d0
cd9c6d873768d211ba6ec6fe6d405f0bb1e2a135

View File

@ -27,7 +27,7 @@ Sprite1.__index = Sprite1
function Sprite1.addNewSpriteWithCoords(layer, point)
local idx = math.floor(math.random() * 1400 / 100)
local x = math.floor(math.mod(idx,5) * 85)
local y = math.floor(idx / 5 * 121)
local y = math.floor(idx / 5) * 121
local sprite = cc.Sprite:create("Images/grossini_dance_atlas.png", cc.rect(x,y,85,121) )
layer:addChild( sprite )
@ -88,7 +88,7 @@ function SpriteBatchNode1.addNewSpriteWithCoords(layer, point)
local BatchNode = layer:getChildByTag( kTagSpriteBatchNode )
local idx = math.floor(math.random() * 1400 / 100)
local x = math.floor(math.mod(idx,5) * 85)
local y = math.floor(idx / 5 * 121)
local y = math.floor(idx / 5) * 121
local sprite = cc.Sprite:createWithTexture(BatchNode:getTexture(), cc.rect(x,y,85,121) )
layer:addChild( sprite )