I am really confused about how to get them to move in the right pattern so the enemies don’t get stuck on the wall?
If that doesnt work make the collision delay to 4
okay, that’s not what I asked for at all I want to make enemies move in a sacernized pattern.
For having a ton of enemies, I suggest using a several Globals that all the enemies would use to move at the same time.
There is one issue it only dose the flip one time and dose not do it multiple times?
I was thinking about something like Galaga enemy movements. You’ll need to send a link to your game if you need better suggestions to what your trying to make.
Any suggestions? I am very confused because it only flips it once.
Lol, this is not gonna work
The timer only sets once. Besides, there’s a better way to do this. I’ll show you.
First, delete the timer thing. Attach a global variable to the number 1 and name it Speed. Attach the variable to the velocity. Drag out two collision blocks, and get rid of “Wall 2”, because you don’t need it. Your code should look like this:
Next up, set both of the collisions to collide with “Wall”. Set the top one to collide on the left of the wall, and the bottom one to collide with the right. Drag out two numbers and set one of them to 1, and another one to -1. The -1 should be linked to the bottom collision, and the 1 should go on the top. Link the numbers up to the “Set” of the global variable. Also, delete the Always next to your number one. This makes it so that your velocity is always one, and we don’t need that. The code should look like this:
How does it work? All the enemies are reading off of a “Global Variable”, which can either be a number or text element shared throughout all of the same object. You can also put this variable in other objects’ code, which allows it to access the number. Once one object changes the number, it also changes all the objects’ numbers. This basically makes it so that when the enemy collides on the right side, it sets the speed variable to -1, and vice versa. The global variable is automatically read in all the other objects attached to it, and their velocity changes.
How can you take this a step further? In the original game, whenever the enemy hit a wall they would go down a little bit. Can you do this? I’ll give you a hint: Use the position block instead of the velocity for this one.
thanks but there is one problem it only does it once
The first collision needs to just be set to left, and the second just needs to be set to right.
it will not work still I think might have a bug
Its working for me, did you fix it?
yes I did I just restarted my pc and It works I had it right it was just bugging out on me
Glad you found the solution. Unfortunately, it sounds like you use windows -1, so that’s an oof. Keep making the game, keep asking for help, and eventually you’ll be a pro. I was a noob not all that long ago, you know.
Hihilogic versus JR_01, who will win in the battle of the helper?
Find out next time on… THE HELPERS
Well, JR_01 did help me with my janky-ass manual save function