Thursday, July 31, 2014

#GTASYD Application!

tl;dr: Here is my #GTASYD Application Video!!!



Full version: So I finally submitted an application to #GTASYD. Last time around on the #GTASYD I got hung up on perfecting my video using scripting and wasn't happy with the result and never submitted it. Then I submitted for GTAMTV and GTAATL this year and was not accepted for what I believe was a bad video.
This time I was determined to plan ahead and spend enough time to produce a video I was happy with. I wanted to create a video using only Google Apps Script and I was satisfied with the animation result. It took me over 500 lines of "hacky" code (it definitely is not pretty in some sections) and my wife can attest it probably took that many hours as well. The animation wasn't as smooth as it was during my other dry runs, but it was sufficient. I would have liked to perfect it, but needed to submit :)

So, the nitty gritty parts that were difficult:

  • Digitizing the Google Logo: I uploaded the logo to the Wolfram Programming Cloud and wrote some code to pixelate it to the correct size and reduce the number of colors. My code then determined the color of each pixel and saved it to an array. 
  • This array was coded into the Google Apps Script and I used some loops and the .setBackgroud method to prepare the colors. 
  • The animation proved to be a little tricky. I ended up creating a new line before line 1 and then coloring line 1 with the appropriate colors to create the scrolling effect. 
  • The rocket moving through the scrolling was also another challenge. I needed to delete it and redraw it in the same position, which in effect moved it through the background that was scrolling down. 
  • I ran out of coding time (as I said it was well over 100 hours) for the ending and had to Insert an Image for the Moon and statements. I would have liked them to be backgrounds in the cell and have them "sparkle", but at least there is room for improvement
I am thinking about creating an Add-on for Sheets that will digitize the images since I have most of the work done programmatically using the WolframCloud, but that is low on my priority list. I have a lot of changes/improvements for g(Math) and a Cryptography Add-on for Docs that I am working on with higher priority.