Game like Gyro--Help

How can i make circles that are coming randomly on the screen with different colors and so they can be absorbed like in Gyro game ?

Here is my code(for now) :

local spinner = display.newImage( “circle.png”)

spinner.x, spinner.y = display.contentCenterX, display.contentCenterY

local adjustment = 0

local PI = 3.14159265358

local function onTouch(e)

if(e.phase == “began”) then

local dx = e.x - spinner.x

local dy = e.y - spinner.y

adjustment =   math.atan2(dy,dx) * 180 / PI - spinner.rotation

end

if(e.phase == “moved”) then

local dx = e.x - spinner.x

local dy = e.y - spinner.y

spinner.rotation = (math.atan2(dy,dx) * 180 / PI)  - adjustment

end

end

Runtime:addEventListener(‘touch’, onTouch)

Here is my picture of circle,but it will be better after some time. :smiley:

  1. Please link a specific game or video of a game so we can see the effect you are seeking to reproduce.  Is this what you mean?:

https://www.youtube.com/watch?v=LYE42ZuDN2Q

(Note: I’m sure it is, but sometimes folks make requests assuming we all know the game they’re talking about.)

  1. Oh, and please remember to post code in code blocks.

formatyourcode.jpg

I answered a similar question to this in my August answer pack, but I’m not sure how much it will help you.  

http://www.youtube.com/watch?v=bpctrL7gWn0&t=10m54s

Posting code link shortly.  Look below…

Sorry for that.Yes, I thought for this game: https://play.google.com/store/apps/details?id=pl.submachine.gyro

If you can help me, i will be great.

I modified the code from the answer pack to be close to what you’re trying to do:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/09/GyroMechanics.zip

Other useful links:

  1. Please link a specific game or video of a game so we can see the effect you are seeking to reproduce.  Is this what you mean?:

https://www.youtube.com/watch?v=LYE42ZuDN2Q

(Note: I’m sure it is, but sometimes folks make requests assuming we all know the game they’re talking about.)

  1. Oh, and please remember to post code in code blocks.

formatyourcode.jpg

I answered a similar question to this in my August answer pack, but I’m not sure how much it will help you.  

http://www.youtube.com/watch?v=bpctrL7gWn0&t=10m54s

Posting code link shortly.  Look below…

Sorry for that.Yes, I thought for this game: https://play.google.com/store/apps/details?id=pl.submachine.gyro

If you can help me, i will be great.

I modified the code from the answer pack to be close to what you’re trying to do:

http://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2015/09/GyroMechanics.zip

Other useful links: