Hello beautiful people,
I have been working on a small idea, a top down game where you have a shield and a sword.
This is the game: colorpalettetopdown | Play on gd.games
In the first level, everything works fine, try to kill the enemy throwing your sword and picking it up again or
deflect the enemy’s bullets untill you end the enemy. Get the key and approach the door to go to level2, Door won’t open unless both objectives are done.
But very strange things started happening in my second level:
- The game somehow thinks the wall is enemy1 and enemy1vision and enemy1Health follow the wall (lol)
- enemy1Health is now the thing that receives the damage and it also activates the shake behaviour
-enemy1vision and enemy1Health should follow enemy1 at all times but they don’t
-enemy1 doesn’t even receive damage from sword
I’m confused to the max haha please halp!! Nothing makes sense anymore and I just don’t see what is wrong.
Is it enough that I uploaded the game or do you need captures showing the code itself?
Very interesting game. I like it. We’re going to have to see your events. When I tried the 2nd level the text stopped following the enemy and then at some point the enemy started to go through the wall. It kept going further to the right and less to the left.
Thank you for your encouragement here are the events
I’m even more confused, how can the enemy act a certain way in your computer and a different way in mine?
The enemy went back and forth fine for a while. It probably either collided with the player or wall just enough to throw off the math. Once something goes out of sync. It’s just going to stay that way.
There’s a lot of code. I’ll browse through it and see if anything jumps out.
IDK what just happened but when I switched between reading the events and the tab with your game, The enemy heath was offscreen but then somehow I took control of the health and the rectangle.
Does the rectangle have a top-down movement behavior? There’s something wrong. Maybe something is corrupted? There’s something.
edit: I can control the player with the wasd keys but the square with the arrow keys. Are there 2 enemy objects? One hidden, one visible?
Edit: I can control both the square and the enemy at the same time using the arrow keys. I enemy’s default controls must be on for the top down behavior. That’s why it’s being thrown off its path.
Edit: is that 2nd square another enemy? if so, they’re interfering with each other. You might need to use a for each object event here and there.
Last one. I think both enemy and enemy vision have default controls on. IDKW the vision isn’t following the enemy.
Is that a 2nd tiny enemy between the sword and 44? Is there already an enemy object in the scene? I don’t see anything creating a 2nd.
Hello thank you so so much for going over my code and reviewing it. I do think it is cursed!! Something strange is definitely happening. I read eveything you said and I’ll try to answer in detail:
-enemyVision is used to detect the player and shoot projectiles at the player. It doesn’t have the top down behaviour at all in its behaviour tab.
-enemy1 did have the default control activated which I deactivated, the player shouldn’t be in control of the enemy at all, so thank you for reminding me, that wasn’t intended.
-the second square the one that is “pinkish” is the player spawnPoint, intented to create the character at the beginning of the scene and also to replace it if he goes out of bounds
-enemyVision and enemyHealth they are acting really really weird, it’s like they think the wall is enemy1
My brain is hurting… I don’t know what to do really other than starting a completely different game. So sad to have to throw this one away.
Turns out there was an instance of enemy1 on scene2 and it was a tiny one, you couldn’t see it but you could select it. I took it out and I’m testing again to see.
Thank you so much for your patience
You’re welcome. I enjoy a good challenge. Did you also disable the default controls for the enemyVision object? It was also moving.
edit: Yeah, with 2 enemies, the enemyVision didn’t know which enemy to follow and it ended up using the tiny one.
enemyVision never had any behaviours attached, thank you.
ok. I forgot, it was moving because it was following the tiny enemy.