我对iPhone/iPad的游戏开发完全陌生。
我的代码已经开始工作了,所有10个气球都漂浮在空中,但我有几个问题:
气球应该按顺序或随机顺序排列。他们把肌腱移到边缘,然后球员应该用鼠标把气球移回正确的位置。多么?
什么是正确的维数(x,y),使我的气球在屏幕上同样显示和定位?
,
您的反馈非常感谢。
发布于 2013-02-27 05:57:18
如果您想要多个气球,那么使用一个表就容易多了。你可以用很少的努力就能得到你想要的多少个栏杆。
Balloons = {} -- track all baloons
Function addBalloon(x,y,xVel,yVel)
Tab = {x = x, y = y, vel = {x = xVel, y = yVel}}
Table.insert(balloons,tab)
End
Function moveAllBalloons()
For_,i in pairs(balloons) do
i.x = i.x + i.vel.x
i.y = i.y + i.vel.y
End
End
Function isPlaying
For _,i in pairs(balloons)
If --[[mouse.x]] <= i.x - (balloon.width/2) and --[[other parameters here]] then
PlaySound
End
End
End对于不同的困难,你可以做如下的事情
if L1 then
Num1 = math.random(3,15)
Num2 = math.random(3,15
OpFind = math.random(3)
If opfind == 1 then
Operation = "+"
Elseif opfind == 2 then
Operation = "-"
Elseif opfind ==3 then
Operation = "*"
End
ElseIf L2 then
num1 = math.random(7,50)
Num2 = math.random(7,50)
OpFind = math.random(4)
If opfind == 1 then
Operation = "^"
Elseif opfind == 2 then
Operation = "%"
Elseif opfind ==3 then
Operation = "*"
Elseif opfind == 4 then
Operation == "/"
End
Endhttps://stackoverflow.com/questions/9654343
复制相似问题