Turn a wheel with you finger

mmzbrmmzbr Member Posts: 311
edited January 2012 in Working with GS (Mac)
Does anyone know what method should I use to create a wheel than turn when press your finger on it? I want a effect like wheel of fortune games in the top view and finger speed/release sensitive.
Any idea how to do it?

PS: Sorry my english.

Comments

  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    When touch is pressed (Add behavior) "Rotate"
    ----
    Set up an integer attribute called roarer and set it to 0
    Or when touch is pressed change attribute "Rotater" to +1
    When game.rotater = +1 Rotate to angle...
    Hope this helps,

    _____________________________________________________________________________
    Free GameSalad Help Tutorials & Templates
    Free follow my finger tutorial

    Contact
    ∆ New Free Templates Coming Soon ∆ New Paid Templates Coming Soon ∆ New full game coming soon ∆ For publishing help contact me!
  • mmzbrmmzbr Member Posts: 311
    Thank you, but I didn't get the roarer part. And when I press the wheel its only rotate, I want the same effect of this video:
  • mmzbrmmzbr Member Posts: 311
    Thank you very much tshirtbooth! Thats all I need =)
  • mmzbrmmzbr Member Posts: 311
    My project use a Portrait Orientation. Thats needs to make adjusts using your create example? About physics I will follow your instructions. Will be perfect.
  • mmzbrmmzbr Member Posts: 311
    Works like charm! Sorry I did a wrong video crop, but you can check the result. You re the man tshirtbooth!
  • CloudsClouds Member Posts: 1,599
    @tshirtbooth
    im crunched for time today but this is a very ruff project file that wil get you started.

    http://gshelper.com/gs/spin.zip


    Genius !

    : )

    Cheers, really useful for me too !
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Here is a slightly different way to do rotation with a finger flick. The rotation velocity is based upon comparing the object's current rotation to a previous rotation. (The difference gives you a measure of the speed of the finger flick.) It also offsets the rotation angle so that you don't get an annoying jump at the beginning of the touch.

    http://www.mediafire.com/?q659666wsrliox3

    It was fun to figure out how to do this!
    RThurman
  • CloudsClouds Member Posts: 1,599
    @RThurman

    Brilliant !

    : )

    Cheers, I will be stealing your excellent code rather shortly !
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @Tynan
    Glad it will work for you! Isn't GameSalad great!?!

    RThurman
  • mmzbrmmzbr Member Posts: 311
    @tshirtbooth could you help me to implement one more thing in that wheel?

    What I need is: when the wheel stops (after get rolled), is change the scene based on the area on wheel stopped. Like the video:


    Its possible to use the wheel angle for this? Love= 1 to 90 (based on wheels angle), so like, after wheels stops, if actual angle is 90 (correspond to Love) change scene to love or its a better and easy method do that?
  • simo103simo103 Member, PRO Posts: 1,331
    edited January 2012
    @mmzbr .. my TOTB4 project has this as a feature (you can see the youtube videos as my project progresses here: http://forums.gamesalad.com/discussion/37484/totb4-simo103#Item_13 ). I used the rotation angle to assign values (use display text on your spinning wheel to work out what angles work best and also design your wheel with a border at the 0 position to make it easier)
  • mmzbrmmzbr Member Posts: 311
    @simo103 Could you help me implement this please?
  • simo103simo103 Member, PRO Posts: 1,331
    I can give you the parts but you will need to make it work with how your project is built.
    1. Create attribute Game.ActiveAngle and use ANGLE type (important)
    2. In your spinning actor you will need to determine when it stops spinning (I used rule when Self.Motion.Angular Velocity = 0 then
    3. Use change Attribute behaviour to set Game.ActiveAngle to self.Rotation
    4. Then use rule if Game.ActiveAngle>0 AND Game.ActiveAngle<90 ... then your rules ... ie: Attribute QuestionsType=1 or Health etc
    *Note the >0 and <90 will be determined based on how you designed you wheel image. If a separating line is pointing directly up it will be 0, 90, 180 and 270 but if it is not striaght up those numbers will change and you will need to play around a bit (I would suggest opening your image editor and making it straight up to make this easier)
  • mmzbrmmzbr Member Posts: 311
    edited January 2012
    @simo103 Thank you very much for the tips, please send me a message when you finish the game. I want to buy it , love board games.
  • mmzbrmmzbr Member Posts: 311
    @simo103 Works like a charm! Thanks!
  • simo103simo103 Member, PRO Posts: 1,331
    @mmzbr ... glad to help .. good luck with yours also .. looking good so far.
  • wolltywollty Member Posts: 102
    mr. RThurman please reup your spinwheel template, tanks
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    @wollty -- wow that thread goes back a ways. But cheers for doing due diligence and searching the forum archives before launching a new thread on an old topic. I think this is the demo you requested:
    http://www.mediafire.com/download.php?fdfyfcb3rdzq8cy
Sign In or Register to comment.