Senior Production Week 8 - Pax build + 2 rooms - 1 sprint
In the past 2 weeks, I took the new Restaurant room with another programmer. took the left half, and I took the right. Alex was in charge of creating the fish tank, with buttons to blow food out of the water like that classic ring game you'd play in the dentist office. After the player successfully blows the food out, it lerps up to the pipe above. Then the food drops out into the window to get "cooked". Then the waiter picks it up. Interpolating the food around was pretty trivial, just a simple animation. The waiter then holds it, until the player completes a sliding puzzle to get the correct table to be in the top left corner. That's when the food lerps to the plate.
Honestly, this room was pretty simple, and my tasks were finished in under an hour. Since those were the only tasks I had scheduled for that sprint, I decided to help out our third programmer, with the Salon. He had taken on the whole room, and then ended up getting sick, so 3 days before the sprint ended, there hadn't been much done in the room its self. (Although he did implement a pretty cool dynamic mesh cutting algorithm), so in the last few days of the sprint, I quickly built out and coded the rest of the Salon. The interactions weren't too difficult.
I guess the most complicated thing, was the sliding interactions, which was still pretty simple. I just wrote a script that you could apply to anything, and it would allow the player to slide it from -1 to 1 in local space in wither the x or y (or both) axis. Then since the hair dryer slid on a curve, I added the ability for the user to add a curve to either sliding axis (using Unity's animation curve). Then since some objects needed to have their limits before or after the -1 to 1 limit, I added 4 margin fields to the script, so that the extents could be changed on a per object basis.
The last thing I did was implement a way to "aim" the mesh cutting (seen at the end of the video). I just added the sliding interaction to the scissors, then when the player hits the snip button, it caches, where the position of the scissors, leaves a line renderer at that position. Then when the scissors is moved again, it keeps a second red line renderer in the middle of the current scissors position and the cached position. It then sets the thickness of the line to the difference in the y direction. Pretty simple, but provides a nice effect.
The rest of the sprint was mostly spent fixing various bugs in the older levels, so that we could get a build ready to demo at Pax East. The build ended up becoming very polished. Most of the bugs I fixed were just interactions breaking when the player switched rooms. I just implemented a custom Update function called RoomUpdate, and replaced the update function in anything that was breaking, with that. The reason for this is my RoomUpdate would only be called when the room, the items are in, is the currently active room. Also helped performance, since any items in non-active rooms would be effectively disabled.