Epic Boss Fighter Step 3: Vrunzol´s attack

To start this blog we will be adding a new sprite to our game or actually 3 of them. These sprites will be orbs that Vrunzol shoots and they will go in random directions so lets start by getting the right sprite.

This sprite was very easy to make as I just drew a purple oval and then I put a smaller black oval inside of it. Once we have coded the orb to damage the Mech and mpove properly we will just duplicate it twice.

But now lets get to the code.

This piece of code is our first and its function is to set the orbs to the correct size and to move them to the correct spot and each orb will have a different position but it really does not matter as the actual sprite will not move at all.

Now with this piece of code the orbs will create clone of themselves every 1.5 seconds and they will not move or show themselves so we have to add code to make them do so.

With this piece of code the cloned sprite will move to a random position on the map and then after 1/4 of a second it will delete itself. Now for the final pieces of code for the orbs.

These 2 pieces of code will determine what happens if an orb was to come into contact with either of these sprites. And of course we have to add one final piece of code that will allow the orbs to actually damage the Mech.

And with this final piece of code the attack function for Vrunzol and his orbs is complete. And since their are 3 orbs we had to duplicate the code 3 times once for each orb.

Thats it for this blog thank you for reading and check out my YT channel if you want @Drago Gaming link:https://www.youtube.com/channel/UCrlNUqQVBxLIbdltHQBdcYg?