Rotating when clicking/touching

SAMmanSAMman Member Posts: 228
edited November -1 in Working with GS (Mac)
Hey everyone, I am having trouble with sequencing I think. I have a game where a ball is dropped on a lever and it launches another ball. The "ball" that is launched is actually a rectangle and I am trying to make it so that when I click anywhere on the screen it rotates 360 degrees one time for each time you click. So far I can only get it to rotate once. I also have it set up to produce a ball to land on the lever each time I click. I wanted to make it so that when then rectangle is launched, I can click and it rotates without causing another ball to appear. So I have not made any progress on doing that. I hope this all makes sense, I am new to posting on forums and it's hard to exaplin myself sometimes. Thanks for the help!

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    not sure i understand what you saying but try this:

    Make a attribute called screenTouch

    make an actor, change the alpha to 0 so its invisible, and drag it over your whole scene

    in that actor thats over the whole scene, have a rule when touched is pressed change attribute screenTouch to 1. Then in the otherwise section of that rule put a change attribute behavior changing screenTouch to 0

    Then in whatever you want to rotate when you touch the screen, make a rule in that actor when attribute screenTouch=1 interpolate self rotation to 360
  • SAMmanSAMman Member Posts: 228
    I will try that, thanks. Is ScreenTouch attribute an integer or real?
  • SAMmanSAMman Member Posts: 228
    Thanks, that worked great! Now the only problem I have is that it rotates counter clockwise instead of clockwise. Any thoughts on that? I also don't know how to make it independent of other actions. For example when I touch I have it set up to create an actor, but I want that turned off while this first actor is rotating. If that makes sense. Thanks again.
  • SAMmanSAMman Member Posts: 228
    That worked. I love this Forum. you guys are great!
  • SAMmanSAMman Member Posts: 228
    Is there a way to get it to work and not spawn my other actor? Basically I touch, an actor appears falls on a lever and sends another actor flying, when I touch again the actor that is flying flips, but I continue to spawn the first actor. I am trying to get it so that doesn't happen until the actor flying through the air collides with the ground. I hope that makes sense. I am trying to do it with attributes but no success yet. Although I do understand them a little better thanks to everyones help from here!
Sign In or Register to comment.