Drag multiple actors at once.

RodrigoPerezRodrigoPerez Member Posts: 212
edited November -1 in Working with GS (Mac)
I have a game I'm working on that requires getting a bouncing ball into a goal by rotating platforms to the correct angles. I currently have it set up to where these platforms can rotate by dragging them to the right angle with a touch, however when I'm rotating one platform and then simultaneously use another finger and try to rotate another platform it doesn't register. Thank you in advance.

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    why is this on here twice?
  • RodrigoPerezRodrigoPerez Member Posts: 212
    I posted in the wrong forum originally. Was that your only input in this post?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    LaughingPanda said:
    I posted in the wrong forum originally. Was that your only input in this post?

    Sorry, I accidentally wrote the other part in white font.
  • RodrigoPerezRodrigoPerez Member Posts: 212
    Dude, I don't understand what your problem is. I just need help with a game I'm making and instead of posting something helpful you decide to write something that has nothing to do with the question I asked. What was the point of that?
  • RodrigoPerezRodrigoPerez Member Posts: 212
    Bump
  • RodrigoPerezRodrigoPerez Member Posts: 212
    Last Bump Attempt
  • calvin9403calvin9403 Member Posts: 3,186
    LaughingPanda said:
    Dude, I don't understand what your problem is. I just need help with a game I'm making and instead of posting something helpful you decide to write something that has nothing to do with the question I asked. What was the point of that?

    because he is asking why do you double post
  • RodrigoPerezRodrigoPerez Member Posts: 212
    Really? Thanks for clearing that up. Is there anything else you would like to chip in? This is a website, I'm typing with a keyboard, you're on the internet.
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I knew that white font line would make me look like an ass, but I was hoping the humor would outweigh the assiness of it - I guess not. In general it is not appreciated when people start two threads that are identical. Most people on this forum look at the main unsorted forum page so the fact that it was in the wrong section doesn't really get noticed. Next time you post on the wrong forum I would just ask a sous-chef to move it to the correct one.

    As far as providing help on your issue is concerned. You were getting help on the other thread and the fact that you were unable to understand the help makes me wonder if you have bitten off more than you can chew right now. When I first started using GS two years ago understanding the joystick demo and multitouch in general would have been way over my head. So If the other help you got was over your head I'm not sure how to help you. But I'll try (so I can make-up for my earlier assiness).

    Here's the main idea. Create 5 actors that are 2x2 in size. Name them touch1, touch2, etc. They can all be unmovable.

    Look at the joystick demo and copy those rules into each one. It will basically be

    When mouse is down
    constrain self.position x to game.touch1.x*
    constrain self.position y to game.touch1.y*
    OTHERWISE
    change self.positionX to 0
    change self.positionY to 0

    (*For touch2 use game.touch2.x and game.touch2.y)

    Then in the actors that you want to control you need an integer attribute (self.touchnumber)

    Rule: When overlaps with actor touch1
    change self.touchnumber to 1
    OTHERWISE
    change self.touchnumber to 0

    Rule: When overlaps with actor touch2
    change self.touchnumber to 2
    OTHERWISE
    change self.touchnumber to 0

    (repeat this for all 5 touch actor overlaps)

    Then this set of rules:

    when self.touchnumeber = 1
    constrain self.position x to game.touch1.x
    constrain self.position y to game.touchy.x

    when self.touchnumeber = 2
    constrain self.position x to game.touch2.x
    constrain self.position y to game.touch2.y

    etc.

    Again this is basically how the joystick demo works. the difference is that the joystick demo also uses some math to constrain the joystick to a circular area where you allow the player to drag the actors around anywhere on the screen.

    Hope this helps.
Sign In or Register to comment.