Wednesday, 17 February 2016

CGA Gameplay and Interactivity - (Group Project) Improved Enemies, background and mushrooms

So 2 of my group members have done the finished versions for the second level of our game as well as improving the looks of the spikes.





So for now, what I have done is used the script which we learnt in a previous lesson where the enemy will walk towards the player.

(Also improved the flooring from last time)





I have made a few new scripts for the Slime and Bats, both having a script for their health and damage the player when we touch them. I have also made it so the enemy will flash red when they are damaged, using the same method I did with the player.





I have also done it so we can kill the slime whether it is using the melee attack or by shooting the magic all at them so I have made a GameMaster script which is attached to a empty object within the scene called GM. This will be in every scene, what the Gamemaster script does it store information you could say, so if we do enough damage to the slime or bat when their health hits 0, it will then rely that information to the GameMaster script telling it when the health of the bat or slime is 0, it will destroy the game object.


Now some talk about the second level, I have made it so when you touch the spikes it would be a insta death and you will respawn on that same level. I have done this so it doesn't waste the players time if they did happen to fall into the spikes and taking 1 point health of damage and waiting to die. Also it seems logical that if you fell on them spikes you would die anyway. I haven't done this to all spikes but just ones that are at the bottom or what make up the floor of the level.


I just added this little piece of code to the Player script.


Now for the mushrooms. I wanted it so when you jumped or walked into it you would be propelled into a certain direction, I tried to do this by using the same line of code 


After applying the code to a empty object with a trigger and testing it out. I found out it wasn't the best way to do things as it let to a few problems such as not being propelled far enough to the right side where you would be safe or propel upwards and move a bit to get to the top left side which leads to the next level.












No comments:

Post a Comment