I am trying to make a square and I am getting this error:
level1.lua:16: bad argument #1 to 'setAsBox' (b2PolygonShape expected, got number)
stack traceback:
Here is my code:
local square = b2.PolygonShape.setAsBox(20, 20, 0, 0, 0)
square:setFillStyle(Shape.NONE)
square:setLineStyle(1, 0x000FF, 2)
self:addChild(square) |
So why am I getting this error? I can't seem to find anything I did wrong.
-Thankyou in advance!!
I am a programming noobie, so thanks in advance for helping me out and answering my questions!
Comments
require "box2d"
In example:
The second example just draws a square on the screen, and returns a sprite you can scale, rotate, and such.
Hope it helps
Eli
Likes: QuasarCreator