creating a trail, unable to go back.

joelloydjoelloyd Member, PRO Posts: 119

Hi. Im after a way to make an actor that leaves a trail, permanent trail that it. Once the trail has been made, you cant go back that way. Would tiles be the solution instead of a trail? thankyou

Comments

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

    @joelloyd said:
    Hi. Im after a way to make an actor that leaves a trail, permanent trail that it.

    This part can be done by spawning an actor with a dot or other image using a timer (e.g. every 0 seconds, spawn actor [dot].

    @joelloyd said:
    Once the trail has been made, you cant go back that way. Would tiles be the solution instead of a trail?

    So that's trickier. And it depends how your actor is moving. Can you freely drag the actor around, does it move on a grid, is it moving without user input, etc.? You could spawn invisible square actors as well as dots and use collide behaviors to prevent the actor from going past the invisible actors, for example, but again... it depends on other factors you haven't mentioned.

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

  • joelloydjoelloyd Member, PRO Posts: 119

    We will say the game is basically a maze, the main actor will be centered on the screen and the camera will follow always keeping centered. As for the actor, it is just going to be something like a ball bearing smaller then the width of the maze. I haven't decided how to make the actor move yet though, i don't know what would be best. arrows, or user interaction of the maze by dragging down to go up etc, if that is even possible?

    What would you suggest. Any response appreciated greatly.

    Thanks

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

    Here's a very rough demo. Arrow keys to move.

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Thankyou very much!

  • joelloydjoelloyd Member, PRO Posts: 119

    this is good, is there a way to not go back the way you have come?

    thanks

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

    @joelloyd said:
    this is good, is there a way to not go back the way you have come?

    I'm sure you could create rules for that. One thought is to have the dot actor spawn a "wall" actor across the width/height of the maze and have the player actor set to collide with the wall actor.

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Would it be possible to make squares that when an actor leaves the the square it is on, an actor is spawned in its place. I tried this but the spawned actor collision would not work once left. Or something like this?
    \thankyou

  • joelloydjoelloyd Member, PRO Posts: 119

    sorry that was bad english. when the main actor overlaps a square in the maze and leaves. The square becomes a solid actor, making it unable to return.

    :)

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

    You could try:

    When actor collides with [square], change attribute self.touched (boolean) to true.

    When attribute self.touched is true
    .....When actor collides with [square]
    .....[no rules]
    .....Otherwise
    ..........Spawn actor [solid square]
    ..........Destroy actor

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Will have a try when I finish work, thankyou very much for the replies. Much appreciated

  • joelloydjoelloyd Member, PRO Posts: 119
    edited February 2015

    Struggling with what I'm doing here. Can you expand a little. Remember I'm a noob ha!

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

    What might work is for you to create the rules as I've outlined them and post a screenshot (upload it to a file-sharing service first). I can let you know if there's something incorrect at that point.

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

  • joelloydjoelloyd Member, PRO Posts: 119

    I'm only testing the method with a couple of coloured actors. Im just wondering about the self.touched part

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2015

    A boolean attribute holds a true or false value and is false by default. So each actor would start with self.touched false meaning that it hadn't been touched by the moving ("player") actor. When the actor touches a square, you can change self.touched to true. Then in the rule condition I gave above, if self.touched is true and the actor is no longer colliding with the player actor, you would spawn a new "solid square" actor.

    Two corrections:

    When actor collides with [player actor], change attribute self.touched (boolean) to true.

    When attribute self.touched is true
    .....When actor collides with [player actor]
    .....[no rules]
    .....Otherwise
    ..........Spawn actor [solid square]
    ..........Destroy actor

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Im baffled ha, tried to place it in with no luck. Please could you give an example to see, with just 2 blocks. Going over the block, leaving and not able to go back over. Would be very much appreciated, this is the only thing holding me back.

    thank you very much

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited February 2015

    Here's a modification to the demo I posted earlier. When the player is moving, a dot is spawned that then spawns a "blocker" actor. It's not perfect, obviously, but it's similar to what I suggested.

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

  • joelloydjoelloyd Member, PRO Posts: 119

    this is good, if i can't figure out the other way ill have to do this. thanks

  • joelloydjoelloyd Member, PRO Posts: 119

    Does anyone else have any suggestions. Making an actor able to go over another and then once past, can't go back. Thank

  • joelloydjoelloyd Member, PRO Posts: 119

    Anyone ever know of a way to go over an actor, once past and over, the actor becomes solid? Unable to go back over that actor.

    been struggling for a while, any help grateful

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Hold on. Let me make you a demo.

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Try this. There are notes in the platform that destroys.

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

    Please don't create multiple threads for the same question.

    /merged

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Sorry about that tatiang. People generally don't look at a thread once seen previously. Won't happen again.

    Thanks Braydon_SFX I'll take a look later on. Thanks for help both!

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

    Bumping a thread (by adding new content or additional questions) raises it to the top of the forums page, so therefore people do see it. ;)

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

  • joelloydjoelloyd Member, PRO Posts: 119

    Thankyou so much both! Using both you examples i changed a little i got what i wanted. Ill post for any future people wanting this.

    How to upload file? Iv only had my bloody mac less than a week and don't know it!

    Great Forums!

    thankyou

  • joelloydjoelloyd Member, PRO Posts: 119
    edited February 2015

    s000.tinyupload.com/?file_id=08402690184302819485

    For anyone wanting an example !

    Thankyou for the responses once again!

Sign In or Register to comment.