Saturday, 26 April 2014

Working Processes: Finishing The Game - Adding the Narration & Sound Effects, Cut Scene, Window contents, MOUSE_LEAVE and backToMainFromVending

Since I manged to get the sound for the narration of "It's locked" I decided to add the other narration clips as well as the sound effects.

To do this, I went back into Audacity and selected the narration clips I wanted and exported them individually.


I then imported them into Flash.

The main difference between the scripts for the narration and sound effects was that the sound effect scripts wasn't as advanced, this was because I did not need to make sure they would overlap. In fact, if they overlapped that would be even better.

The script, as mentioned in previous posts, for the narration looked like this:

if(narrateChannel!=narrateItsLocked){
narrateChannel=whatsThat.play(0,0,narrateTrans);
}

whilst the sound effect script would be much simpler and only look like this

soundFXChannel=soundFXFuseDoorOpen.play(120,0,soundFXTrans);

As I didn't create the sound effects, it meant that some sounds didn't start at the part I wished them to start. Instead of editing each sound in Audacity and re-exporting them. I instead used script to make sure they started in the right place.

The first number in the brackets affected where the sound would start whilst the second number affected how many times it would repeat. As I didn't need the sound to repeat, like I did for the music, I kept the number at 0.

I put the priority on the sound effects as I felt they were more important than the narration at this stage. After I had finished with the sound effects, I moved onto importing the rest of the narration.

When testing the game, I noticed that the narration could get a little annoying if they were repeated when doing the same actions. I put in booleans to registered if the sound had been used before, and made it so that when the booleans were true, the sound would no longer play. Some narrations, mainly the important ones, weren't limited with booleans as I felt it was important for the user to hear them again.

In the end, I didn't end up using all the narrations I had scripted. Too much narration would turn out to be bad and take the user away from the experience. I used narration where I felt it was necessary. Such as trying to read a note without enough light. Or trying to read the notebook without your glasses. This way the narration would let the user know that something wasn't right and had to be changed.

The majority of sound effects were obtained from http://www.freesfx.co.uk/
This was a really good website and contained sounds for nearly everything I wanted apart from the vending machine noise and a few others. A more detailed version of the sources can be found in my bibliography.

I then went onto the cutscene. This was very enjoyable to create. I took the viewMain frame and converter it all into a single movieclip. I then animated it with a tweet going left and right and back to the centre. I set the tweet to ease 100 so that it would look much smoother.

Since the protagonist had just woken up, I wanted to animate the eyes opening. I created a rectangle which filled the whole stage and used the select tool to curve the line upwards like an eyelid. I then tweened the eyelid upwards to imply that the protagonist had just opened their eyes. I selected the movieclip which contained the room and tween blurred it so that it only once the eyes were opened that it would be unblurred.

I then added the narration of "Where am I - I need to get out of here" onto frame 17 and then cutscene was finished. I made the Enter Name frame direct to the cutscene instead of the game, and I instead made the cutscene direct to the game after it had finished.

I then worked on the window. This was something which was referred to as many things in the user testing. Such as a widescreen TV or a blackboard. So I wanted to make sure it actually looked like a window.

I first took a picture with my camera mobile phone and cropped the image. I then imported this into Flash.


Instead of tracing around the image, I broke the image with ctrl+b. By doing so it meant that the image could now be trimmed in Flash.

I selected the Magic Wand tool, located in the Lasso Tool options and selected the sky. It selected the whole sky and I hit del on the keyboard.

I then turned the image into a silhouette by filling the rest of it in black, which was possible as I had already broken the image.


Afterwards I then went to the in game window and deleted the contents. In a new layer I placed this silhouette and used the Disort tool, located in the Free Transform Tool, to give it the right aspect.

After this had been done, I gave the background a gradient between Dark Grey and Orange.

I was very happy with the results:


I noticed, just like my supervisor had said, that the mouse didn't disappear once the mouse had left the stage. Instead the mouse, as a movieclip, would stay where it was just before the mouse had left.
As this was the case, I wanted to create a script which would make it so that the mouse would leave when not on the stage and come back when the mouse moved on the stage. This was a rather simple thing to accomplish.

 My script looked like the following:

stage.addEventListener(Event.MOUSE_LEAVE, cursorHide);
stage.addEventListener(MouseEvent.MOUSE_MOVE, cursorFollow);

function cursorHide(evt:Event):void {
    if(cursor_mc.visible==true){
        cursor_mc.visible=false;
    }
}
function cursorFollow(evt:Event):void {
    cursor_mc.visible=true;
}

This worked great; but as expected, when the user would pick up an item a glitch would occur. This was because when an item is picked up the cursor would go invisible and instead of dragging the cursor, they would drag the item.

To solve this issue, I removed the eventListener on the start drag of an item and added it back on the stop drag of an item. This fixed the issue and it worked flawlessly.

There was now one more thing to change and that was one of the back buttons. As the vending machine is accessible from both the desk and the main view, when on the vending machine, I wanted it so that it would go back to the last view you were on instead of straight back to the main view. In order to do this, I created a boolean called backToMainFromVending.

backToMainFromVending was placed on the main view and set to true, the boolean was also placed on the desk and set to false. This way, I could add an if statement which would know where it was last time and take take the user back there. The script I coded was the following:

back_btn.addEventListener(MouseEvent.CLICK,backtoMainXRightListener);
backSide_btns.addEventListener(MouseEvent.CLICK,backtoMainXRightListener);
function backtoMainXRightListener(ev:MouseEvent):void {
    if (!backToMainFromVending) {
        trace("viewTable from Vending"+backToMainFromVending);
        gotoAndStop("viewTable");
        back_btn.removeEventListener(MouseEvent.CLICK,backtoMainXRightListener);
        backSide_btns.removeEventListener(MouseEvent.CLICK,backtoMainXRightListener);
        stage.removeEventListener(Event.ENTER_FRAME, receiptHitVNumbersListener);
    }
 else if (backToMainFromVending){
        trace("viewMain from Vending"+backToMainFromVending);
        gotoAndStop("viewMain");
        roomView.x=-605.25;
        back_btn.removeEventListener(MouseEvent.CLICK,backtoMainXRightListener);
        backSide_btns.removeEventListener(MouseEvent.CLICK,backtoMainXRightListener);
        stage.removeEventListener(Event.ENTER_FRAME, receiptHitVNumbersListener);
    }
}

I added this script to the viewVending layer.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.