Today I finished the second tutorial video by adding physics to the cannon ball and effects when firing the cannon.
This is the added code that makes the cannon ball bounce off of surfaces when it collides in a realistic way. After doing this I added a sound effect for when the cannon fires, I did this by adding a sample player then adding the supplied sound effect to it. I then added a line a couple simple lines of code to make it play when the shoot() function is called. I also added a camera shake effect by adding a camera node to the cannon and then adding a animation player child node to the camera. from there I added 5 different camera offset frames every 0.04 seconds so the camera then shakes for 0.2 seconds every shot.
This is the current modified cannon code which plays all the new effects that have been added today in the images below.
Tomorrow I will be starting the next and what looks like the last part of this cannon tutorial series.
No comments:
Post a Comment