Hello everyone, i’m creating a simple game but i’m having a problem, I have wrote this code as an example of what i want to do:
physics = require ("physics") physics.start( ) ball = display.newImageRect("Ball.png", 15, 15, {x=0,y=0}) physics.addBody(ball, 'dynamic' , {radius=7.5,bounce=0.8}) local downhill = display.newRect( 130, 130, 1500, 150 ) physics.addBody( downhill,"static" ) downhill.rotation = 2
In this code a ball goes downhill and you can see it going down but the image doesn’t rotate, to get the effect of rotating i must put:
ball:applyAngularImpulse( 0.01 )
How can i get the same effect without doing that? I’m making a game where you basically launch a ball to break some brick and can’t make the ball image rotate. Thanks in advance!