【发布时间】:2014-05-21 22:48:27
【问题描述】:
for i = 1, groupA:getNumChildren() do
local sprite = groupA:getChildAt(i)
if cute.anim[1]:collidesWith(sprite) then
youLoose()
end
end
local function youLoose()
local font3 = TTFont.new("billo.ttf", 20, " 1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ,?")
local text7 = TextField.new(font2, "gameover")
text7:setPosition(200, 100)
stage:addChild(text7)
GameLost = Bitmap.new(Texture.new("gameover.jpg"))
Background : removeFromParent()
groupA : removeFromParent()
stage: addChild(GameLost)
alert()
end
它给出了一个错误,上面写着'attempt to call global youLoose (a nil value),我哪里做错了?
【问题讨论】:
-
这意味着
cute.anim[1]没有collidesWith方法。 -
这是什么游戏引擎,gideros?无论如何,您应该为库添加标签。
-
@Schollii:是的,它的 gideros。