HELP! Fallow Pt2

I’m trying to follow @JR01 example here: Flowlab Game Creator - Follow Example and for the most part it works. However, when I try to find the logic for the “Fallow pt2” I don’t see it anywhere. Has anyone found it? If not, I’m trying to spawn an enemy in my level and then have it chase the player via a trail method like in JR01’s game and would love any helpful hints at what to do next. Thanks!

3 Likes

If only everything was this easy, I found the logic bundle thankfully I guess I forgot to check the behavior for the trail method. I will report back if I have any questions regarding the system. Thanks!

2 Likes

Hello! The Follow pt2 is located in the “Player Trail” object. :slight_smile: Edit: Oh I never payed attention to the message, my apologies. I am glad you found it. :slight_smile:

2 Likes

Thank you for your help, I was wondering if there would be any way to “flip” the enemy object that spawns when the player changes direction to avoid the enemy? Thanks!

2 Likes

May I see the link to the game?

1 Like

Thank you @ShadowGaming for your help on this. Basically, I believe it is in the “Fallow pt3” logic where I need to initialize a flip block whenever the x pos has changed to below 500. Issue there is it will always flip when the enemy spawns into the level as their pos then would be 0 (0<500) so the enemy moon walks around the player when I turn left (backward) instead of right (forward)

2 Likes

To have the enemy properly flip I am checking if the X value is > the player X.

If Player X > Enemy X the player is on the right side, and if Player X < Enemy X then the player is on the left side.

(I also cleaned up the code a little in the screenshot, there was no need to have a Number block be “Set” and use its “Get” input, that is the same as having the Message lead directly into the Position block)

2 Likes

Fantastic! Thank you, and yes I was only using the number block so I could see the output from the mailbox a little easier.

2 Likes

My apologies, I didn’t see the message in time, glad @CodeAlpaca could help you though! And anytime!

1 Like

I’m glad to see teachers using the example.
The flip CodeAlpaca sent will always look toward the player instead towards the path. I can make something more precise if you would prefer it.

I really need to make a newer version of this example using lists. It would simplify some of the steps and I could add more features like flip and animation outputs.

3 Likes

Ah, I was thinking of it as the other follow-example and not a trail follow. A way to always look in the direction of the trail is to basically do the same thing as I did before but use the current X as the “Value” input on the Filter and have the new X position be the “In” for it.


So doing this works

2 Likes

Would love a more updated system in the future, but the current system does fine for me at this particular game project. The only issue I still have is that my enemy spawns where the trail starts and I would love it if I could modify the start position to the edge of the level or another object so the player has a little time before the enemy chases them. Thank you again for all the support!

You could have a delay… I’ve never used this example so I wouldn’t know.

Well this is more of a tracing the players path than it is moving towards the player.
If you need something that just moves when the player is close, here are some other examples I just updated that may be more to what your looking for.

Flowlab Game Creator - Chase Example
Flowlab Game Creator - Chase Example Platfromer

2 Likes