Sunday, November 8, 2015

Day 77: Productivity Comes in Sine Waves

Today was quite the challenge! The main to-do of the day was setting the shoot style of the mortar; I figured that one could aim and fire with rigidbody velocity based on trajectory, but that unfortunately didn't work for a mortar arc. Nor did trying some double equation magic when trying to find a parabola through two points. What my producer did suggest worked well; one could fire the trajectory upward at a high angle off screen, and then shift the mortar right  above the target point to land properly. Combining that with spawning a random group of explosions within the unit circle (thank you, Random.InsideUnitCircle!), and the mortar is complete to go:



As for the angler, the fish was supposed to follow a sine wave movement. Similarly to the bullet movement in the salmon bullets, I could directly control the curve of the fish and rotate it toward the next point in the curve for smooth pointing toward a drunken sine wave. Combine that with variable offset, amplitude, phase, and angular frequency, and...


Next up: Angler bullet spikes!

No comments:

Post a Comment