[Help] Lecture 111 - Enemies shooting back

Hello All

I’m sorry I keep on posting a question at the start of every Lecture, but, I’m finding the challenges extremely challenging especiall seeing as we are not taught anything at the beginning before he hits us with one.

Now in this challenges he wants us to have the enemies shooting on every update frame well, Ok then. Now I need to ask some questions am I creating a new script, if so how do link up this script with enemies group and enemy projectiles (the prefabs of which I haven,t created yet), or am I using one of the scripts we already have, which one EnemySpawner (I wouldn’t think so) or EnemyBehavoiur (possibly) if so should we really be placing all the script for this on a prefab - I did something like this in one of my projects and @Rob said this was a no-no.

So, I need a little direction before attempting something as big or as important as this.

Please help … I need a little direction? Something anything!!!

Confused,
Vaughan.

1 Like

Hi @Vaughan,

You gut feeling with regards to the EnemyBehaviour.cs script I would suggest is spot on. This script is controlling what the actual individual enemy can do (putting aside it’s movement anyway). So triggering it’s firing from here would be the way to go.

Regarding your point about the “no-no” from the other project - when we were talking before about extending your BlockBreaker game, we were moving away from the design of the core game provided in the course/lectures. The advice provided at that point was in relation to that enhanced design. From memory, the spawner had been added to the individual entity which was the aspect that didn’t feel right. Separation of concerns, what is each object responsible for doing, what objects should it be able to interact with.

Hope this is of some help.

YES!!! It gives me a jumping off point, something practical to do which is a positive step, without which I’m just directionless which is a negative.

Now, I can create a projectile prefab for enemies ‘laser’ different to the hero one, so the user can see the difference between to two and then get working on making the enemies fire it.

1 Like

Great stuff, you are sounding re-enthused! :slight_smile:

Keep us updated on your progress :slight_smile:

Privacy & Terms