hi guys i am just hanging with something strange physics problem it will be nice if anyone points me in right direction or solve this issue
here is the code
[lua]display.setStatusBar( display.HiddenStatusBar )
local physics = require “physics”
physics.start()
local x = -10
local y = -10
physics.setGravity(x,y)
physics.setDrawMode(“hybrid”)
local height = display.contentHeight
local width = display.contentWidth
local ground = display.newRect(0,height - 1,width,1)
physics.addBody(ground,“static”)
local ceiling = display.newRect(0,0,width,1)
physics.addBody(ceiling,“static”)
local leftWall = display.newRect(0,0,1,height)
physics.addBody(leftWall,“static”)
local rightWall = display.newRect(width - 1,0,1,height)
physics.addBody(rightWall,“static”)
local beamShape = {-75,-20,75,-20,75,-10,-75,-10}
local triShape1 = {-70,-15,-50,15,-30,-15}
local triShape2 = {70,-15,50,15,30,-15}
local img = display.newImage(“trampoline.png”)
img.x = 240
img.y = 160
physics.addBody(img,“dynamic”,
{ density=3.0, bounce=0.2, shape=beamShape },
{ density=2.0, bounce=0.31, shape=triShape1 },
{ density=2.0, bounce=0.31, shape=triShape2 })
–img.isFixedRotation = true
local function callMe()
y = y * -1
x = x * -1
physics.setGravity(x,y)
print(y)
print(“called”)
end
timer.performWithDelay(2500,callMe,0)[/lua]
see the effect after uncommenting the img.isFixedRotation = true and with commenting the same
this is my problem
u need trampoline.png from eggBraker example
Thanks in advance [import]uid: 12482 topic_id: 10722 reply_id: 310722[/import]
