bug or bad code?

UtopianGamesUtopianGames Member Posts: 5,692
edited November -1 in Working with GS (Mac)
Hi Guys,

I have what looks like a strange bug.

I have a ball in my scene 64x64 and when you tap/press it increases in size (touch is pressed: change size: growth rate =2) until it reaches a certain size then it pops (i destroy it) after every 5 seconds a new ball appears but if i have just popped one previous to this the newly spawned ball/s auto increase in size and auto pops without me touching them.

I have tried a lot of things from changing the image before it gets destroyed to constraining width and height before i destroy it.

Any idea how to spawn my new actor and keep it at 64x64 until its touched?

EDIT: just realised if i touch it as the new ball is auto increasing in size it stops the grow and the next spawned ball/s are fine....until i pop it and it goes back to the same old annoying bug.

Thanks,

Darren.

Comments

  • JCFordJCFord Member Posts: 785
    Sounds like it may be to do with your Touch Behaviour and the newly spawned Actors still think the touch is active.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Yes it does, tried everything i can think of...made a variable activate_fish = false and when touched it = true and on destroy change back to false but even that's not working.

    Strange one tbh.

    EDIT: just tried it with mouse over and it works fine :(

    Darren.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    just to make sure, on the ball, do you have a touch inside condition as well?

    So:

    Rule
    ALL
    When touch is PRESSED
    When Touch is INSIDE
    Increase Size...

    You might also want to make a global boolean attribute just to lock it down like this:

    Create a global attribute called something like OKToResizeBall

    Rule
    ALL
    When touch is PRESSED
    When Touch is INSIDE
    When OKToResizeBall is FALSE
    Change Attribute OKToResizeBall To: TRUE
    Increase Size...

    Rule
    When Touch is RELEASED
    When OKToResizeBall is TRUE
    Change Attribute OKToResizeBall To: FALSE
  • rebumprebump Member Posts: 1,058
    Yeah, from what I recall of just playing around with touches briefly, I think the whole scene registers on just a "pressed" test and you need to confine who interprets the press with an additional "inside" test. I think that is what FMG was stating above.
  • UtopianGamesUtopianGames Member Posts: 5,692
    Yes i have touch is pressed and touch inside and have set up the global but still not working :(

    I will keep trying.

    Thanks guys,

    Darren.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    If you want to be only able to touch one at once, you could use Mouse DOWN and Mouse INSIDE. They translate over to the iPhone just fine, you don't have to recode them. If you need multitouch though, you'll need to stick with touches...
  • UtopianGamesUtopianGames Member Posts: 5,692
    yes that works perfect, also mouse over works...now if only multi touch would work aswell :)

    Darren.
Sign In or Register to comment.