Movement problems

And I am here again, after no more than a day, I am back with another problem to conquer, another experience to learn (and suffer) from. Today I am met with a movement error. After taking ‘inspiration’ from grazer’s example, it turned out that my enemy could not move at all.
Now I ask you all for help.

Game: Flowlab Game Creator - New Game

Code:

1 Like

What movement concept are you trying to use in this game?

1: The enemy stays a certain number of blocks away from the player.

2: The enemy moves randomly around the level.

3: Other.

The enemy moves randomly, but when the player is in a certain proximity it follows the player.

1 Like

I don’t understand why the command stops midway.

Why does it feel like it is a bug???

1 Like

Try re-connecting the wires and re-loading the page.

The extractors are set to the player, right? Also, don’t use extractors for “other”, use a universal global for the player, it will be a lot better.

1 Like

This code just seems like you’re trying to make the enemy follow the player, I don’t see what makes this enemy activate when the player is in proximity

1 Like

I did all that, but it still doesn’t go into the filter. That’s the problem.

IT MUST BE A BUGGG! Prove me wrong

It didn’t work for me in the beginning, because there were no wires connecting to the “eval” in the expression. Connecting the wires up, it seems to be working fine, although there is no code around going toward the player while in a certain proximity.

The code does not do what you said at all…

For now, all I want it to do is follow the player. After that works out, I’ll just add a proximity check at the start of the code. I want to go one step at a time so that I don’t make too many mistakes.

just look at the hounds code in foxer, if you still don’t know tmrw Ill help you

I used your foxer rotating code, so thank you. If I ever finish my rouge like I will credit you.

its a topdown? also, whats a cod

Yes. The hound code makes it move… but in a seemingly random way. It just moves in a zigzag and I cant figure out why.

I feel like an idiot, thank you for telling me to connect the eval.

1 Like

Before I end the topic, is there a way to prevent the enemy from going in a zigzag?

Yes, it’s because the enemy can only go in lines. The velocity is not adjusted.

You can change this with some trig i think…. There is a bundle called “angle to velocity” that just takes an angle and a speed and turns it into x and y velocity. Very useful.

Here it is: {“data”:{“behavior”:{“v”:“2”,“nodes”:[{“inputCount”:2,“outputCount”:2,“name”:“AngleToSpeed”,“behaviorType”:“logic.NodeGroup”,“x”:720,“y”:160,“group”:“c0608e71c85bca40”,“id”:“c02457e431e4e048”,“notes”:null,“isMenuItem”:true},{“expression”:“BMath.cos(A(Math.PI/180))”,“default0”:0,“default1”:0,“default2”:0,“default3”:0,“default4”:0,“default5”:0,“params”:2,“version”:1,“tag”:“Cos”,“inputCount”:3,“outputCount”:1,“name”:“Expression”,“behaviorType”:“logic.logic.Expression”,“x”:720,“y”:640,“group”:“c02457e431e4e048”,“id”:“c02457e6f0535f4e”},{“expression”:“BMath.sin(A(Math.PI/180))”,“default0”:0,“default1”:0,“default2”:0,“default3”:0,“default4”:0,“default5”:0,“params”:2,“version”:1,“tag”:“Sin”,“inputCount”:3,“outputCount”:1,“name”:“Expression”,“behaviorType”:“logic.logic.Expression”,“x”:720,“y”:768,“group”:“c02457e431e4e048”,“id”:“c02457e69aa6ac4e”},{“inputCount”:0,“outputCount”:1,“name”:“Bundle Input”,“behaviorType”:“logic.NodeGroupInput”,“x”:360,“y”:640,“group”:“c02457e431e4e048”,“id”:“c02457e77ca6334b”,“portId”:“c02457e431e4e048i0”,“tag”:“Angle”,“dataType”:2},{“inputCount”:0,“outputCount”:1,“name”:“Bundle Input”,“behaviorType”:“logic.NodeGroupInput”,“x”:540,“y”:768,“group”:“c02457e431e4e048”,“id”:“c02457e700ebd541”,“portId”:“c02457e431e4e048i1”,“tag”:“Speed”,“dataType”:2},{“expression”:“((A%360)+360)%360”,“default0”:0,“default1”:0,“default2”:0,“default3”:0,“default4”:0,“default5”:0,“params”:1,“version”:1,“tag”:“Angle”,“inputCount”:2,“outputCount”:1,“name”:“Expression”,“behaviorType”:“logic.logic.Expression”,“x”:540,“y”:640,“group”:“c02457e431e4e048”,“id”:“c02457e78f82e54f”},{“inputCount”:1,“outputCount”:0,“name”:“Bundle Output”,“behaviorType”:“logic.NodeGroupOutput”,“x”:900,“y”:640,“group”:“c02457e431e4e048”,“id”:“c02457e7adf41a43”,“portId”:“c02457e431e4e048o0”,“tag”:“X”,“dataType”:2},{“inputCount”:1,“outputCount”:0,“name”:“Bundle Output”,“behaviorType”:“logic.NodeGroupOutput”,“x”:900,“y”:768,“group”:“c02457e431e4e048”,“id”:“c02457e74254c849”,“portId”:“c02457e431e4e048o1”,“tag”:“Y”,“dataType”:2}],“links”:[{“input_id”:“c02457e7adf41a43i0”,“output_id”:“c02457e6f0535f4eo0”},{“input_id”:“c02457e74254c849i0”,“output_id”:“c02457e69aa6ac4eo0”},{“input_id”:“c02457e78f82e54fi0”,“output_id”:“c02457e77ca6334bo0”},{“input_id”:“c02457e78f82e54fi1”,“output_id”:“c02457e77ca6334bo0”},{“input_id”:“c02457e6f0535f4ei1”,“output_id”:“c02457e700ebd541o0”},{“input_id”:“c02457e6f0535f4ei2”,“output_id”:“c02457e700ebd541o0”},{“input_id”:“c02457e69aa6ac4ei1”,“output_id”:“c02457e700ebd541o0”},{“input_id”:“c02457e69aa6ac4ei2”,“output_id”:“c02457e700ebd541o0”},{“input_id”:“c02457e6f0535f4ei0”,“output_id”:“c02457e78f82e54fo0”},{“input_id”:“c02457e69aa6ac4ei0”,“output_id”:“c02457e78f82e54fo0”}]}}}

2 Likes