I'm Coding a Game - part 8
Scripts if you recall, can be thought of as personalized commands. Now when I call ScreenShake anywhere else in the code, it will run this. The final step was to place this script in the gun code so when a player fires, the screen will shake. I opened up the gun object and placed this line of code.
All I had to do was place the script ScreenShake and set the magnitude and length in the gun fire sequence and BOOM, I got camera shake when I fire the gun! Pretty cool, huh? I thought it was pretty cool.
Then I created a new background, which I titled, “Foreground.” Then I loaded and placed the foreground picture on the layer.
Then, I clicked the horizontal tile button and…
Next I did the same process with the other background.