Help with "overlaps or collides" condition

I just finished tshirtbooth's boggle tutorial. It's awesome. But I don't want to make a boggle game, I want to make a different word game.

And one thing I want to to happen is instead of clicking on letters to select them, I want an actor to move around the scene and touch the letters. They'll be selected that way.

So I replaced the "when touch is pressed" action with "actor receives event overlaps or collides with actor of type (name of actor)"

My boggle game works fine with the "when touch is pressed" action. The ONLY thing I changed was replacing that with the overlap action. But when I move my actor over a letter, it only selects one letter. When I move to any other letter, nothing happens. Why can't I select more than one letter? Any ideas? Is there something about the overlap/collide action I need to know?

Thanks for your help!

Answers

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    edited February 2013
    Hey man - Try the demo attached. This is nice because you won't have to have an actor constrained to the mouse position.
  • whompywhompy Member Posts: 27
    Thanks Braydon- but I don't understand how this helps me! I checked out the demo, but I don't see how that solves my problem. What am I missing? Thanks again!
  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273
    You want to drag your finger and select rut? Not just tap and then release, then tap again, right?
  • whompywhompy Member Posts: 27
    No, what I want to do is have the letters get selected when an actor touches them. So, the actor might be controlled by the arrow keys, and to select the letter, the player has to guide the actor to touch the letter by pressing up, down, left, and right.

    And so far, my actor will select the first letter of a word when it collides with it, but it won't select anymore letters.
  • CORE GameCORE Game Member, PRO Posts: 280
    edited February 2013
    was wondering are all the letters (images) very close to each others (almost attached) ?
    try to space them out let the actor goes out of the previous (image /letter) before it collides with the next one, does that make any difference?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Yes you're doing to need a trigger of more than just overlap. Also be sure the actor moving over the letters it's selecting is much smaller than the letter actors so it can't overlap more than one at a time. If you using the keyboard as you seem to suggest here is what I would do. When the actor overlaps with the letter the player wants to select add enter key to the rule so they select it with the arrows and hit enter.

    Inside letter actor.

    Rule
    ALL
    When actor overlaps/collides with selector AND When enter key is down

    Put you action for letter.
  • whompywhompy Member Posts: 27
    @fsoufi and @fryingbaconstudios

    Ah, yes of course, I bet that's what it is. My letter actors are very close together, and so the actor moving over them does indeed overlap at least two at a time, thanks, that was driving me nuts.

    I think this will solve it though- won't it work if I have the actor move the length or width of the letters at a time? So in other words, instead of the actor moving gradually to the right or left, I have it "jump" 50 pixels or so (the width) of the letters) so that it always only touches one letter at a time. I think that will work.

    Thanks for your help!
  • CORE GameCORE Game Member, PRO Posts: 280
    edited February 2013
    what about you create another actor for each letter but with a smaller size and make it invisible. so for example Actor (A) is 64x64 and the Collide for it is 18x18.
    don't forget to use constraint attributes to let the (collide actor) matches the X,Y of the main actor (which is letter A in this example)

  • ashtmjashtmj Member, PRO Posts: 405
    @whompy you should be able to just put the collide rule in the letter actors rather then your main actor, that way it will register every time
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited February 2013
    But let's say you want to scan across a bunch of letters and don't want to select them all? When does the actor decide to active the letter and how would you skip over one? Maybe I don't fully understand the layout. If this is the case wouldn't you still need a trigger to determine when you want to activate the letter? If having to skip over a letter isn't necessary then making it work like a keyboard TAB function like you suggest would work great. I would just wrap the execution of the code inside the collide rule in a (after 0.01 timer ) to avoid the millisecond it will overlap with two or have the distance between the letters be greater than the main actor.
Sign In or Register to comment.