Change Radius of ball on the fly

hay everyone, I am making a game with a tiny ball, where you need to click on it to shoot it. On the device it is hard to click, so I increased the radius but that caused the ball to hit things too early. So, I am wondering if it is possible to set the radius of the ball to big, and then when the ball is clicked or shot, it becomes small?

–Thanks in Advance-- [import]uid: 86879 topic_id: 15807 reply_id: 315807[/import]

create a circle that’s bigger then the ball but not visible and have it follow the balls x, y then set all touch events to this but leave all collision events on ball [import]uid: 7911 topic_id: 15807 reply_id: 58381[/import]

You are a genius! [import]uid: 86879 topic_id: 15807 reply_id: 58384[/import]

glad I could help [import]uid: 7911 topic_id: 15807 reply_id: 58385[/import]

One other thing, I can’t seem to create a global variable. For example the score the user received on level one display on level 2. Do you know how to do this? [import]uid: 86879 topic_id: 15807 reply_id: 58394[/import]

is each level in a different file or all in one file [import]uid: 7911 topic_id: 15807 reply_id: 58403[/import]

different lua file [import]uid: 86879 topic_id: 15807 reply_id: 58405[/import]

are you using director
[import]uid: 7911 topic_id: 15807 reply_id: 58406[/import]

yes sir [import]uid: 86879 topic_id: 15807 reply_id: 58408[/import]

if using director 1.4 you can pass params from one file to another

director:changeScene( params, file, fx )

params must be a table

heres an example but uses popup instead of changeScene

http://developer.anscamobile.com/forum/2011/09/29/director-popup-error [import]uid: 7911 topic_id: 15807 reply_id: 58410[/import]

I am not catching on this one, can you elaborate a little bit. I couldn’t figure it out form the other forum area either=( [import]uid: 86879 topic_id: 15807 reply_id: 58420[/import]

say this the items you need to pass to each level

score = 100

director:changeScene( { sc = score }, “level2”, “fade” )

then in level 2

function new( params )

score = params.sc[1]

and repeat for each level [import]uid: 7911 topic_id: 15807 reply_id: 58426[/import]

This didn’t work for me =( I changed everything for my needs, but it didn’t change the scene [import]uid: 86879 topic_id: 15807 reply_id: 58435[/import]

could you post some code [import]uid: 7911 topic_id: 15807 reply_id: 58439[/import]

1.lua

score1 = display.newText(“0”, 0, 0, “ChalkDust”, 13)
score1:setTextColor(255, 255, 255)
score1.x = 60
score1.y = 40
localGroup:insert(score1)

when the ball is hit
score1.text = score1.text + (“1”)

director:changeScene( { sc1 = score1 }, “2”, “fade” )
2.lua

function new( params )

scorebs1 = params.sc1[1]
scorebs1.x = 400
scorebs1.y = 40
end

[import]uid: 86879 topic_id: 15807 reply_id: 58441[/import]

not sure if it will pass an object never tried what it will pass is the value of score and you create a new score text object or maybe try leaving the [1] off im not at home on my computer to make sure its right [import]uid: 7911 topic_id: 15807 reply_id: 58444[/import]

Ok, when you know, could you please please email kurtbringsjord@swelloapplications.com with the info.

–Thanks SOOO much for all of your help, you have been huge! [import]uid: 86879 topic_id: 15807 reply_id: 58445[/import]

try

sc1 = { score1 }

director:changeScene( sc1, “2”, “fade” )
then in 2.lua

scorebs1 = sc1[1]

think this will work still not sure about pass the text image though
[import]uid: 7911 topic_id: 15807 reply_id: 58447[/import]

It didn’t work =( [import]uid: 86879 topic_id: 15807 reply_id: 58449[/import]

I have a small app that I’m building to demo a particle system I’ve been building that passes a variable from one file to the next with changeScene I’ll send to you to look at when I get home [import]uid: 7911 topic_id: 15807 reply_id: 58456[/import]