GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Colliding in order

Hi I am making a game where you have to collide with letters in order to collect it and spell a word for example "cat". the collision works however I want the player to collide with C first and not A or T unless C is collected if that makes sense. Is there any way I can do this ?

Comments

  • Two.ETwo.E Posts: 472Member, BASIC

    Hi - Welcome to GameSalad!!

    First, you need to add in a table...

    ... Draw the rest of the Owl!.


    I made you a demo template. I included some notes and two levels.
    Drag or touch where you want the Black Dot (Player) to move.

    Let me know if you have any follow up questions.
    Best of Luck.

    Two.E

  • Simple Gamer ArtsSimple Gamer Arts Posts: 273Member, PRO
    edited November 2

    I would make a game attribute called game.collide_order

    ------------------------FOLLOW THIS------------------------

    inside ACTOR C:

    create self.BOOLEAN called self.lock1

    create 1st RULE:
    • When Hero collides with C
    • When game.collide_order = 0
    • When self.lock1 is false
    -------------- change game.collide_order to 1
    -------------- change anything extra to the actor here

    create 2nd RULE:
    • When game.collide_order = 1

    • change self.lock1 to true

    OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    inside ACTOR A:

    create self.BOOLEAN called self.lock1

    create 1st RULE:
    • When Hero collides with A
    • When game.collide_order = 1
    • When self.lock1 is false
    -------------- change game.collide_order to 2
    -------------- change anything extra to the actor here

    create 2nd RULE:
    • When game.collide_order = 2

    • change self.lock1 to true

    OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

    inside ACTOR T:

    create self.BOOLEAN called self.lock1

    create 1st RULE:
    • When Hero collides with T
    • When game.collide_order = 2
    • When self.lock1 is false
    -------------- change game.collide_order to 3
    -------------- change anything extra to the actor here

    create 2nd RULE:
    • When game.collide_order = 3

    • change self.lock1 to true
  • tatiangtatiang Posts: 11,493Member, Sous Chef, PRO, Senior Sous-Chef

    @Simple Gamer Arts Good suggestion but it's probably easier to just use a single actor for the whole thing regardless of the specific letters involved. That requires tables which brings us back to @Two.E's demo which I'm guessing uses tables. ;)

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

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

    Yep, very clean demo, @Two.E.

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

  • Simple Gamer ArtsSimple Gamer Arts Posts: 273Member, PRO

    @tatiang " very true, nothing beats tables at the end. Sorry, I totally disregarded @Two.E post.

  • Two.ETwo.E Posts: 472Member, BASIC
    edited November 2

    @Simple Gamer Arts Great solution. Tables are not always the answer and some times its hard to understand what is actually happening - so its good to have a written example of the logic.

    @tatiang Thanks - I am always excited to try something I don't normally work with ... such as tables :smiley:

  • jessica.michaeljessica.michael Posts: 14Member, PRO

    @Two.E thank you so much for your help, my only problem is displaying the letters on the screen, it only shows the collision box not the letter

  • jessica.michaeljessica.michael Posts: 14Member, PRO

    @Simple Gamer Arts I found your method works best for me thank you both @Two.E for your time in helping me.

  • Two.ETwo.E Posts: 472Member, BASIC

    @jessica.michael said:
    @Two.E thank you so much for your help, my only problem is displaying the letters on the screen, it only shows the collision box not the letter

    Can you share more detail. Each letter should have a display text behaviour so you know what letter is being selected.
    It also shows what letters need to be selected and what letters have been selected.

    Either way, glad to hear you have something working :)

Sign In or Register to comment.