Hi.
Is here anyone who knows how aa game is working? The most problematic for me is how to insert ball into the spinning wheel and start spin it to.
Hi.
Is here anyone who knows how aa game is working? The most problematic for me is how to insert ball into the spinning wheel and start spin it to.
Can you provide more detail on what you’re asking?
Thanks
Rob
Hey!
@Rob Miracle – There is a game on google play called “aa” If you type “aa game” it will be the first one.
@neitvar – You can use a weld joint to make the object stick to the spinning ball in the middle.
–SonicX278
I don’t have my Android tablet with me right now and I can’t tell much from the screen shots. The community will likely have to help you.
Rob
It’s working but what about that line holding (visually) wheel and ball? When I try to add this it collide with ball and throw it away.
local physics = require("physics") local background = display.newImage("background.jpg") background.width = display.contentWidth background.height = display.contentHeight background.x = display.contentCenterX background.y = display.contentCenterY local wheel = display.newImage("wheel.png") wheel.width = display.contentWidth / 3 wheel.height = display.contentWidth / 3 wheel.x = display.contentCenterX wheel.y = display.contentCenterX local ball = display.newImage("ball.png") ball.width = display.contentWidth / 10 ball.height = display.contentWidth / 10 ball.x = display.contentCenterX ball.y = display.contentHeight - (display.contentWidth / 10) \* 3 physics.start() physics.setGravity(0,0) physics.addBody(wheel,"static") physics.addBody(ball,"dynamic") local spinningwheel = transition.to(wheel,{time = 5000,iterations = -1,rotation = 360}) local function jointlistener() if ball.y - wheel.y \<= display.contentHeight / 4 then ball:applyForce(0,0) physics.newJoint("weld",ball,wheel,ball.x,ball.y,wheel.x,wheel.y) end end Runtime:addEventListener("enterFrame",jointlistener) local function taplistener() ball:applyForce(0,-30) Runtime:removeEventListener("tap",taplistener) end Runtime:addEventListener("tap",taplistener)
Can you provide more detail on what you’re asking?
Thanks
Rob
Hey!
@Rob Miracle – There is a game on google play called “aa” If you type “aa game” it will be the first one.
@neitvar – You can use a weld joint to make the object stick to the spinning ball in the middle.
–SonicX278
I don’t have my Android tablet with me right now and I can’t tell much from the screen shots. The community will likely have to help you.
Rob
It’s working but what about that line holding (visually) wheel and ball? When I try to add this it collide with ball and throw it away.
local physics = require("physics") local background = display.newImage("background.jpg") background.width = display.contentWidth background.height = display.contentHeight background.x = display.contentCenterX background.y = display.contentCenterY local wheel = display.newImage("wheel.png") wheel.width = display.contentWidth / 3 wheel.height = display.contentWidth / 3 wheel.x = display.contentCenterX wheel.y = display.contentCenterX local ball = display.newImage("ball.png") ball.width = display.contentWidth / 10 ball.height = display.contentWidth / 10 ball.x = display.contentCenterX ball.y = display.contentHeight - (display.contentWidth / 10) \* 3 physics.start() physics.setGravity(0,0) physics.addBody(wheel,"static") physics.addBody(ball,"dynamic") local spinningwheel = transition.to(wheel,{time = 5000,iterations = -1,rotation = 360}) local function jointlistener() if ball.y - wheel.y \<= display.contentHeight / 4 then ball:applyForce(0,0) physics.newJoint("weld",ball,wheel,ball.x,ball.y,wheel.x,wheel.y) end end Runtime:addEventListener("enterFrame",jointlistener) local function taplistener() ball:applyForce(0,-30) Runtime:removeEventListener("tap",taplistener) end Runtime:addEventListener("tap",taplistener)