Need some help spawning. Help me out and get a free vid review!

mandancemandance Member Posts: 87
edited November -1 in Working with GS (Mac)
Long story short I'm trying to figure out how to spawn an actor with a touch. I've got that part set up fine.

The trouble is i want to choose which actor to spawn depending on a finger swipe. So for example. Touch the center, then move up with the finger. Spawning actor A. But touch the center and move the finger right spawn actor B. Ect

If anyone can help me out with this, i'll be happy to do up a quick vid review. And if you don't want that, I'll just give you a big hug. BIG HUG!

Comments

  • quantumsheepquantumsheep Member Posts: 8,188
    I'm guessing there are several ways of doing this, and please bear in mind it's 3am here and I've not tried these suggestions out:

    Suggestion 1:
    Have invisible zones spawn around the mouse touch. So take the mouse X and Y, then:
    -spawn invisible actor trigger 'A' 100 above mouse position.
    -spawn invisible actor trigger 'B' 100 below mouse position.
    -spawn invisible actor trigger 'C' 100 to the right of mouse position.
    -spawn invisible actor trigger 'D' 100 to the left of mouse position.

    Destroy the triggers on Mouse Release

    Then use these triggers to spawn the actor you want to spawn
    if trigger A is touched - spawn actor A
    if trigger B is touched - spawn actor B
    And so on

    Suggestion 2:

    Have a look at CodeMonkey's joystick demo, or Wayne's Tank demo. This will show you how to use joysticks to do different things depending on where you point it. If you make the joystick invisible, it might have the same desired effect.

    Please note - I don't know if this will work as it's off the top of my head - but hopefully it'll point you in the right direction!

    Cheers,

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • mandancemandance Member Posts: 87
    Thanks, I'll give it a try when I get home.
  • Rob2Rob2 Member Posts: 2,402
    It's also quite easy using vector to angle, I'll post a project in a jiffin.

    here if any wants it http://gamesalad.com/game/play/57497
Sign In or Register to comment.