View Single Post
ITSE1429 Lab4-RE
Junior Member
Status: Offline
Posts: 11
Join Date: Sep 2014
Default ITSE1429 Lab4-RE - 11-24-2014, 01:43 AM

re: ITSE1429 Lab4-RE

LAB 4 Observations

My Lab4 solution was heavily dependent on design decisions of Lab 3 with the addition of logic supporting arrays for the objects. I also used the setting of torus' visibility property and speed values.

It is key to use arrays for torus, home, and ground objects. An array also holds speed values. Like Lab3, my main loop depends on the catch counter. The need to vary the torus display necessitated use of a separate 'iteration' counter. Also, the arrays use a separate index.

Some major logic additions were necessary. Within the main loop I use a large if/else, and based on iteration value, it controls how many torus are 'un-cloaked' and in play. Within this are nested sub-loops utilizing an index for array 'nth' items.

The code is actually more straight-forward than done for Lab3.

A journey begins by making torus(s) visible, setting speed(s), and proceeding to move the item(s) down to ground(s). For example 'move torus(1) to ground(1), duration speed(1). Next is 'catch' determination. Importantly, functions do the cone distance checking, one for each torus. They are boolean and when evaluating true, a 'catch' is registered. The block within the if/else concludes by sending back the torus(s) to the home array item(s).

The if/else is critical. In the first block (early iteration values), there is one torus in play, going to one ground, with one speed value, one function call, and one return home.

In the middle block of the if/else (mid-range iterations), two torus' are included but the preceeding construct is the same.

Eventually the last block of the if/else brings in all torus' and related objects at once.

Similar to Lab3, cone operation is independent of the torus'.
I found it best to use functions to check cone distance. As mentioned, I invoke one, some or all of them after torus(s) arrival on ground, (before returning them home).

The play seems satisfactory. When the cone is correctly in position, it does result in a catch but there is also no gain from arriving too late. The cone can be stationary and if parked in the right position, catches can be racked up.

Reply With Quote