The bulk of my course after the obvious introduction to Torque Game Builder and GIMP the first week was spent learning Torque Script. I decided rather than spend time doing tutorials which had aspects I may not use or understand, I took the approach that I would simply try to do what I wanted with the game until I couldn't and then look for reference in the documentation or the tutorials for similar situations. During the course Kevin and I were the main gameplay programmers for our group. We worked very closely on a number of the gamescript files, some more similar that others.
Alphabetically I will start from the beginning...
Fish.cs is the main code for the bonus fish that grows the icebergs for a certain amount of time. The collision code here is similar to the iceberg collision code, it looks at the object colliding with it and determines if it is the penguin, if so, the object is mounted and the game continues. The dilemma we came across with the bonus fish was how to grow just the icebergs that the penguin could reach. Then we realized that to limit the amount of icebergs grown would also limit the rate of the penguins progression and instead we should grow our entire set of icebergs via a simple iteration and an amplification of the size by 20%. Then scheduling another function which does the opposite.
Game.cs is a very involved script, it does a lot of things in our game. It handles most of the gui changes and updates. Likewise it sets many important global variables such as $playing, and $gameStarted. Finally it handles all input and draws all of our animated and static sprites. My two serious contributions to this script were involved in the setting fish world limit motions, and adjusting the timer code.
The next file I had a hand is, is arguably the most crucial to our project, the penguin. After all he's the source of all the fun The most important role I had in penguin.cs is the follow mouse behavior, it took quite some time with the behavior tutorial before I realized how to implement one in script, and edit the script for the behavior itself. In retrospect it was relatively easy. The behavior takes in two fields, updates them constantly, calculates the position of the mouse, the difference between the object and the mouse position and then adjusts based on trackingspeed inputted. This allowed us to use the penguin as the primary game controller.
The majority of my time beyond these fields was invested in debugging, and in compiling all the gui script, artwork, music, and game script into one cohesive program, believe it or not making them all play nicely with each other took the better part of 2 days. It was a great course and I look forward to next semester.