![]() ![]() For example, the small rectangle button is hit then a small rectangle is spawned. I put all my shapes into those two categories. ![]() medium bodies (80X20) then later I will add large bodies. So, in this code I split my bodies into two categories: 1. Local bodyA = fixtureA:getBody ( ) local bodyB = fixtureB:getBody ( ) print ( "collision!!" )įlow = flow + 1 end end if flow = 8 then print ( "game is over" ) end Rec_medium:addEventListener (Event.MOUSE_UP, onMouseUp, rec_medium ) -adding the rectangle to the stage Rec_medium:addEventListener (Event.MOUSE_MOVE, onMouseMove, rec_medium ) Rec_medium:addEventListener (Event.MOUSE_DOWN, onMouseDown, rec_medium ) ![]() Rec_medium.isFocus = false -add the event listeners for the new rectangle Rec_mediumBnt:addEventListener ( "click", Rec_small:addEventListener (Event.MOUSE_UP, onMouseUp, rec_small ) -adding the rectangle to the stage Rec_small:addEventListener (Event.MOUSE_MOVE, onMouseMove, rec_small ) Rec_small:addEventListener (Event.MOUSE_DOWN, onMouseDown, rec_small ) Rec_small.isFocus = false -add the event listeners for the new rectangle ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |