I searched, and searched. Only thing I saw was on lime for map.rotation
I have lime, but I am developing natively in Corona first to get a grip on things
First, load this code into Corona and launch it
The box will start falling, tap the screen to rotate.
…assuming you have seen the demo run
Note how the box continues bouncing down the 2 stair steps even though the objects have rotated clockwise.
I’ve been trying to figure out how to somehow group physics bodies? Is it possible?
I know NayGames was looking at something like this but on LIME which I think there is a limitation, so I’m trying it in just corona.
[code]
–Hide Status Bar
display.setStatusBar(display.HiddenStatusBar)
–load physics
local physics = require(“physics”)
physics.start()
–DRAW MODE
–“hybrid” “debug” “normal”
physics.setDrawMode( “hybrid” )
– Scale set to 60, cuz I felt like it :)_
physics.setScale( 60 )
–Set only Y gravity and 0 to X
physics.setGravity( 0, 2 )
–Load Audio
–template for my bg audio
local soundtrack = audio.loadStream(“media/insertsoundtrackhere.mp3”)
–make audio loop infinitely using -1
audio.play(soundtrack, {loops=-1})
–Load images
–(X position, Y position, X size, Y size)
local back = display.newRect(0, 0 , 700, 700)
back:setFillColor(100, 210, 33)
local rect1 = display.newRect( 110, 250, 100, 100 )
rect1:setFillColor(255,255,255)
physics.addBody( rect1,“static”, { friction=3, bounce=0.3, isGround = true } )
local rect2 = display.newRect( 210, 150, 300, 100 )
rect2:setFillColor(255,0,255)
physics.addBody( rect2,“static”, { friction=3, bounce=0.3, isGround = true } )
local box = display.newRect(20,20,50,50 )
box.x = 200; box.y = 20
box:setFillColor(100,50,111)
physics.addBody( box, { density=1.0, friction=10, bounce=0.2} )
–Set the reference to the interface and master groups
interfaceGroup = display.newGroup()
interfaceGroup.xReference = 2000
interfaceGroup.yReference = 2000
–Place images into groups (Layer them so what goes in back goes 1st
–Take the local object we created with a variable and insert into the Interface group we created earlier
interfaceGroup:insert(back)
interfaceGroup:insert(rect1)
interfaceGroup:insert(rect2)
–the x and yReference are referenced from 0 meaning upper left of the device.
–Now we are taking the interfaceGroup, and inserting into the MasterGroup
masterGroup = display.newGroup()
masterGroup.xReference = 150
masterGroup.yReference = 150
masterGroup:insert(interfaceGroup)
–masterGroup.x and .y reference - where the center of the rotation will be on screen
–+++++EXPERIMENTAL PHYSICS GROUP LOCK CODE
–Place code to rotate map and physics here :)…thats if and when it’s possible
----+++++EXPERIMENTAL PHYSICS GROUP LOCK CODE+++++++++++++++++++
– Touch Response
local function buttonActionR()
transition.to(masterGroup, { rotation=90, time=500, delay=0 } )
end
masterGroup:addEventListener( “touch”, buttonActionR )
[/code] [import]uid: 61600 topic_id: 13068 reply_id: 313068[/import]