Touch rotate how?

iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89
edited May 2017 in Working with GS (PC)

hello every body i see new game in google play like spinner fidget
he click on spinner if the finger right the spinner go right if the finger left the spinner go left . if touched not much he move easy if touched very speed he go speed .the spinner stoped with touch power if you know what i mean
how i make like this ?

Comments

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    no answer or just some helps steps ?

  • elementappdevelementappdev Member, PRO Posts: 55

    To answer the spin direction:
    You want two real attributes (Touch_Start) and (Touch_Stop). Then make an actor on the background (size of whole screen) and when touch--> is down :: change attribute Touch_Start) to mouse.postion.X.

    Then touch--> is released :: change attribute Touch_Stop) to mouse.postion.X.

    Then (on release) if start is greater than stop, rotate at (whatever speed you want) counterclockwise. If start is less than stop, rotate (again whatever speed you want) clockwise.

    In terms of a harder press--> faster spin and vice a versa, I don't believe GS can detect the pressure of a touch.

  • ArmellineArmelline Member, PRO Posts: 5,327

    Perhaps link to a video. I'm afraid I really didn't follow your description very well.

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89
    edited May 2017

    @elementappdev CAN YOU MAKE A DEMO PLEASE BECUZE SOME RULE I DONT KNOW HOW YOU MAKE IT!

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    You realize that ALL CAPS indicates YELLING online?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    THIS NEW LAPTOP LOL

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2017

    //

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89
    edited May 2017

    @socks not copy paste thing ! i just need how i know make like that in gs just to be a pro like you :) or another developer in gs

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2017

    //

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    if i make spinner how i make it ? becuze i dont have a pro account ! and how i upload to gs ? i dont have a pro account you know i cant make any thing like this just i need to be a pro of gs games not make copy paste games

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    @elementappdev mean i make 3 rule ?.or just one rule and greater than in else ?

  • IceboxIcebox Member Posts: 1,485

    @iraqiraq Is this what you want ? i attached a demo

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    @Icebox thnx my brother but i need know how i make it with mouse x ! becuze i need learn it .or how i make it without button just roll the spinner

  • SocksSocks London, UK.Member Posts: 12,822

    @Icebox said:
    @iraqiraq Is this what you want ? i attached a demo

    The centre of a triangle is 2/3rds of the way along each of the three medians, so if you have an equilateral triangle like a fidget spinner, and it is sat like an arrow pointered upwards (▴) the centrepoint will be 1/3 of the way up the image/actor, whereas leaving the centrepoint 1/2 of the way up (GameSalad's default) will give you that weird disjointed rotation !

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    @Socks thnx for this advice you helped me 70%

  • IceboxIcebox Member Posts: 1,485

    Thanks for the info socks !

    @iraqiraq This is simple , you only need the fidget actor and this rule

    {if mouse button is down

    (create another rule inside)

    [if game.mouseposition.x > game.screen.size.width/2 ( if mouse is at the right side)
    rotate clockwise
    otherwise
    rotate counter-clockwise]

    otherwise
    }

    thats it

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    thnx @Icebox but this if clicked /if your finger out side the spinner he stop moving .im not need stop . i need him stop slow to 0 :)

  • SocksSocks London, UK.Member Posts: 12,822

    "i need him stop slow to 0"

    Increase angular drag to slow down a rotating actor.

  • iraqiraqiraqiraq iraq baghdad , muslimMember Posts: 89

    @Socks VERY THNX TO HELP ME :)

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    This spinner demo might be useful:

  • tmagamestmagames Member, PRO Posts: 4

    RThurman Your spinner example is just what I have been looking for to create a steering wheel for a driving game. If you could help further I would be grateful: How do you constrain the movement so it rotates only left or right say 45 degrees each way from centre? Many thanks

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @tmagames It's unlikely @RThurman will see this unless you notify him which is what I've done by including the '@' symbol before his forum username.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,879

    @tmagames You might want to look at this example of knob rotation:
    https://forums.gamesalad.com/discussion/comment/413634/#Comment_413634

    You just change the min and max values to get the limits you want. For your example you would use:
    max(45,min(135, self.Rotation + self.changeInAngles ))

Sign In or Register to comment.