Thursday, 25 March 2010

Displaying that the user has correctly answered a question

Once the user had answered the question, it would tell them if they were either right or wrong. If they were wrong the game would just take them back to the island screen and they could click on a question again, but if they had answered the question correctly there needed to be a way of displaying that a certain question had been answered correctly and this could be done using a tick to cover the question box.

This is the actionscript that is on the question 1 movieclip on frame one and it takes the user to the question screen. To show that they have answered the question correctly, I inserted a keyframe on frame 2 and added a a red tick over the question 1 box. Also, so the user couldn't click on question one again, I deleted the actionscript that was there on frame 1.



So when the user has correctly answered a question, they will be able to tell as it will look like this:

Wednesday, 24 March 2010

Setting the Correct Answer

The next thing I did was set a correct answer for the question so when the user selects their answer and then clicks next, it tells them whether they have got the question wrong or right.

Next I put the following actionscript onto the tick box movieclips that were next to the incorrect answers.


The tick box movie clip next to the correct answer had the same as the above plus a bit extra at the end.
The next bit of actionscript is on the 'ok' movieclip.

The next bit of actionscript tells the movieclip what text to display if the user is correct and if the user is incorrect.

Tuesday, 23 March 2010

Making the Answers clickable

The next thing I needed to do was to make the possible answers to the question clickable and making it so the user can see that a certain answer has been selected. I created a circle and converted that to a movie clip and named it tick box and put this movie clip at the side of each answer. Inside each movie clip I put the the following actionscript on frame one so the movie would stop on that frame.

I put this actionscript on the second frame also on layer 2. On layer one in the first frame, the tick box is white and on layer one in the second frame the tick box turns to red (below).

Frame 1 - white tick box (above)
Frame 2 - red tick box (below)

Wednesday, 17 March 2010

Beach Questions

I have now made the question numbers into movie clips and when the user clicks on the first question, it takes them to the screen below (this is just an example question and will be changed later on) :

The actionscript I put on the first question number is shown below:


The on(press){ section is telling it to do the following if the user clicks onto the movie clip.

_root.attachMovie("question", "question", _root.getNextHighestDepth() ) section is telling it to attach the movie clip on press and then the user will see the screen that is displayed above.

_root.question._x = 50 _root.question._y = 20 this section is telling it where to place the questions movieclip on the screen.

_root.questionButtons._y= 600 } this section is telling it to move the questionButtons movieclip off the stage when the user clicks on the 1st question. This is so the user can't accidentally click on another question when they are already viewing a question.

Wednesday, 10 March 2010

Drag and Drop

The next thing I wanted to do was to make it so the user could pick up the objects and move them around, The first thing I did was give all the objects an instance name and put each object on its own layer. The I put the following actionscript on to each layer changing the instance name to match each object.

beachball.onPress = function(){
startDrag(this)
}

beachball.onRelease = function(){
this.stopDrag();
}

The part I changed was the 'beachball.' part so for example, to be able to let the user drag and drop the starfish, the actionscript was be added to the starfish layer and would look like this:

starfish.onPress = function(){
startDrag(this)
}

starfish.onRelease = function(){
this.stopDrag();
}

Followers