View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

BwL M4

This milestone follows M3 - the design milestone. Therefore, this one was very code-intensive to get our design up and running. It also spanned during our Fall Break, so that was also a problem. Here is a link to the Requirements Page.

CVS

For Milestone 2, we did a little work with DVS/CVS. We did not use it very intensively. Here's the system we would use:
This was how we were instructed to use DVS along with CVS. We learned during this milestone that this created serious conflicts. When two group members were working on the project at the same time, they would create "conflicts." CVS is designed to fix these but for some reason it was not. We could not determine the exact problem, but after the milestone was over we determined to use individual class files and just file them in (completely trashing DVS). Another reason for this was when we created a new image to test if our code worked, we would have to download DVS from their server, and it was not very reliable.

Helpful Classes / Code

Some classes and methods we found helpful for this milestone:

GUI


Pardon Barney's appearance, the screenshot taker in Squeak didn't catch him in the best lighting...



            w := Wonderland new.

            "get handles on the wonderland objects"
            scene            := (w getNamespace at: 'scene').
            scheduler        := (w getNamespace at: 'scheduler').
            camera           := (w getNamespace at: 'camera').
            cameraWindow     := (w getNamespace at: 'cameraWindow').
            ground           := (w getNamespace at: 'ground').
            light            := (w getNamespace at: 'light').

            "hide the window while it loads, slowly..."
            cameraWindow hide.

            "resize the window"
            cameraWindow extent: 400@400.

            "hide the wonderland junk"

            w getEditor hide.
            ground hide.
            light hide.
            camera turnBackgroundOff.

            "create our avatar"
            w makeActorFrom: 'PurpleDinosaur.mdl'.
            actor := (w getNamespace at: 'purpleDinosaur').

            "position avatar and camera"
            camera moveTo: { 0. 2. 6 } duration: #rightNow.
            camera pointAt: { 0. 3/2. 0 } duration: #rightNow.

            "center avatar"
            cameraWindow position: Display center - (cameraWindow extent //2).

            "we're loaded, display window now"
            cameraWindow show.

            "make actor watch the cursor"
            actor head doEachFrame: [
                | cursorLocation |
                cursorLocation := (camera transformScreenPointToScenePoint: 
                       (Sensor mousePoint) using: actor).
                actor head righteye pointAt: cursorLocation duration: #rightNow.
                actor head lefteye pointAt: cursorLocation duration: #rightNow.
            ].

            "Constructing"
            bubble := RectangleMorph new useRoundedCorners.
            "Adding attributes"
            bubble color: Color white; height: 220; width: 130; borderWidth: 1.

            "Constructing"
            controlText := TextMorph new contentsWrapped: 'Control the avatar:'.
            "Adding attributes"
            controlText fillingOnOff.
            bubble addMorphBack: controlText.

            "Constructing"
            moveButton := SimpleButtonMorph newWithLabel: 'Move To:'.
            "Adding attributes"
            bubble addMorphBack: moveButton.
            moveButton position: 5@30.
            moveButton target: avatar; actionSelector: #moveTo:at:; arguments: (Array with: (moveToXTextField asText) with: (moveToYTextField asText)).

            moveButton target: self; actionSelector: #doMove.

            avatar moveTo: (moveToXTextField asText) at: (moveToYTextField asText).


Non-GUI

            "Check to see if an alarm is already running"
            (idleAlarm) ifNotNil: [idleAlarm stop].

            "Create a new alarm"
            idleAlarm := Alarm
            	do: avatarAction doIdleBehavior
            	in: idleTimeout
            	inScheduler: scheduler.


Link to this Page