出版社:人民邮电出版社
出版日期:2014-1
ISBN:9787115331755
作者:(澳)Jayant Varma
页数:358页
bug:4.2.11 移动角色的例子代码有个小BUg
有一行判断小球是否超出屏幕范围的判断是if newX > dimensions[3] or newX < dimensions[0] then speed.x = - speed.x ;endif newY > dimensions[4] or newY < dimensions[1] thenspeed.y = - speed.y ;end这里的屏幕 是把坐标放在一个数组里local dimensions = {0,0,320,480};这样来做的 作者一定是 C++出身 因为C++中才是index以0开始但是Lua中都是table 都是以1开始的所以if newX > dimensions[3] or newX < dimensions[1] then speed.x = - speed.x ;endif newY > dimensions[4] or newY < dimensions[2] thenspeed.y = - speed.y ;end估计是手误 希望初学者不要对此产生疑惑