Colliding in order
jessica.michael
Member, PRO Posts: 27
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
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
GSLearn.com | Templates | Free Demos | Udemy Course
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
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
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
@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
Yep, very clean demo, @Two.E.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang " very true, nothing beats tables at the end. Sorry, I totally disregarded @Two.E post.
@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
GSLearn.com | Templates | Free Demos | Udemy Course
@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
@Simple Gamer Arts I found your method works best for me thank you both @Two.E for your time in helping me.
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
GSLearn.com | Templates | Free Demos | Udemy Course