Help me sort out an actor problem
MattButlerStudios
Member Posts: 486
Ok, so I have two actors that I am dealing with. One of the actors is red and the other is black. The red actor serves as the color you cannot touch or you the game will restart. This color is filling the entire screen and serves as the background. On top of this red actor I put the black actor. The black actor serves as a path that is fine to travel on without dying. My problem is that even though I have put the black actor on top of the red actor, my character still dies even though it is traveling on a safe (black) path. I am thinking that this is caused due to the red actor beneath it. Is there a rule or something that I can apply to make the black actor override the red one? Thanks for you help everyone!
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
www.mbstudios.co | Free Stuff
You may need to:
(1) Change the ball actor's collision shape from rectangle to circle
(2) Add collision "sensors," rectangular actors that sit outside of the black area by a certain offset amount (you'd need a bunch of these) and add the collision rules to these actors.
GameSalad does not support custom collision shapes, which is what you're attempting to do.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
www.mbstudios.co | Free Stuff
@MattButlerStudios Because you've got your ball actor on top of an overall background which includes your "safe" areas as well as collision and out of bounds areas, there's no way of detecting any sort of collision without adding invisible actors.
(If your track was horizontal and vertical, you could perhaps detect collisions via tables, or another way, which would take a long time to make work, would be to constrain your x and y locations of your ball player, and when out-of-bounds of certain parameters would be your collision detector... )
So neither of those are feasible... the only feasible way - with your setup as it is - is exactly what @tatiang recommends... i.e, first make your collision shape of the ball actor to round, and then add invisible collision boxes to all of your track. It does involve a fair bit of work, especially if you've got a lot of other track images, but that's the only solution in your situation, I'm almost certain.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Timer.every.1 sec. Add 1 point to score.
Else
Reset scene
The red actors are not needed for this method. Just put the consequences of failure under else.
Although it may be possible to use the red pieces. Like this
If colliding with black.
Add point to score every 1 second
else
If colliding with red
Reset scene
But still doesn't turn the red into walls. To turn red into walls you could have red actors that collide with black actors moved to a different layer, but to make this method perfect you have to use exact math. Hopefully positions divisible by 4. Or something to the like.
@matbuttlerstudios
www.mbstudios.co | Free Stuff
Hi Matt, even when you've put your invisible actors as collision detectors, is that what you're saying? If so, it could be that you haven't deleted the collision rules in the overall background image...
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
www.mbstudios.co | Free Stuff
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
www.mbstudios.co | Free Stuff