Thursday 31 March 2016

2D game assignment Dev Blog - Week 3

Aww yiss here we go


Ladies and gentlemen, we finally had guns implemented in our game. After three weeks in development, hopefully it was worth the wait. Now instead of jumping around and flying off into space, thanks to no ground check, we finally had a game mechanic that allowed the player to go postal on the game's non existent enemies.

Snippit of the gun code.


Thanks to endless web page searches and YouTube videos, I found out how to use raycasts to make bullets appear and stuff. I was pretty pleased with managing to get a working script that spawned instantiated bullet prefabs, that appeared from a firepoint. 

[VIDEO OF ME SHOWING OFF THE GUN SCRIPT]

Also Paris made a start on the pickup script, we now had an object with pop up text that would disappear if the player pressed "E" while in the trigger. 

Before I forget, I also added in a re-spawn system, that reset the player back to the start if he was an idiot and fell off the level somehow. Nioce.

We did have one problem though. How do we make an gun appear out the pickup?





No comments:

Post a Comment