hi,
I’m trying to draw a triangle and set the collision boundaries to it and fill the Shape with colour. I’ve seen the example for drawing the Star, but it didn’t show how to set collision boundaries. I also read the example on adding collision boundaries complex Shapes, which are in the form of Images (Triangle.png).
What i’m trying to do is combine the two. and also fill the shape with colour.
So i used the display.newLine to set the centre of the Shape and then draw the collision boundaries. If i use display.newLine to draw a full Triangle, it gives a rectangular boundary .
This is what i could come up with.
Would appreciate some code to fix it
thanks
local triangle = display.newLine( 160, 240, 160, 240 )
triangleShape = { 0,-35, 37,30, -37,30 }
physics.addBody( triangle, "static", { density=0.9, friction=0.5, bounce=0.3, shape=triangleShape } )
triangle:setFillColor( 210, 38, 42 )
[import]uid: 10542 topic_id: 3685 reply_id: 303685[/import]