Monday, January 01, 2007

Tafe : Geoff : Macromedia Flash...


This Blog is based on tasks assigned to us by Geoff for Flash.












EmilyAndyGeoffRohanChrisJody

Thursday, August 25, 2005

Tafe : Ian Newton...


I am asking for an extension of 2wks(252hrs) on all assesible tasks that are current assesible tasks to respond correctly to Ian Newton.

Wednesday, August 17, 2005

Tafe : Geoff : Week 5 : Pop the Balloon...


Introduction
In this exercise you will create a simple moving target game. The player will be presented with an introduction screen which will prompt them to play. When the player clicks the introduction screen, it will be hidden and game play will begin.

The player will have a predetermined number of mouse clicks to hit as many targets as possible. The target will have a random height and speed set each time it passes across the screen. Each time the mouse is clicked the number of clicks will be displayed. If the player hits the target, the score will be incremented and the target will be destroyed then reset. If a target makes it across the screen without being hit, the number of missed targets will be incremented and the target will be reset.

When the player has exhausted their supply of clicks, the game will be over and the player will be prompted to play again.

Moving Target game screen layout – example


Learning Outcomes:
Create a flowchart to show game logic and programming requirements
Use movie clips to create game elements.
Create layers to store and display game elements.
Use a movie clip as a cursor during game play.
Use dynamic text variables to store and display score, clicks and misses.
Use actionscript to write game functions and control game play.

Flowchart: 30 marks.
Use the description given in the introduction above to design a flowchart for the moving target game. You may use MS-Visio, MS-Word or paper, pencil and ruler to design the flowchart. Submit the flowchart to your teacher for assessment.
Once checked you will receive instructions for the game development.

Wednesday, August 10, 2005

Tafe : Geoff : week 4 : (Whack A Mole)-->"Catch a Smurf" Game Flowchart....


Introduction
This exercise is to demonstrate how pseudocode and a flowchart can be used to write a computer program. On completion of this exercise you will have a version of the Whack A Mole game for use on a web site.

The Game
Whack a Mole is based on an old carnival game and has been around on computers as a kids game for a long time.

Game Play
A number of things (moles) are hiding in holes / containers.
Each mole pops its head up at a random time.
The player has to hit as many visible moles as possible in the time allowed.
When time is up, the player's score is displayed and if they are lucky they win a prize.
The player is prompted to play again.

Program development life cycle
Analyse
First analyse the game rules and determine the computer logic required to play the game.

Design
Program design can be developed by writing pseudocode and drawing a flow chart to describe the logic and identify objects and variables required.

Test
Test the design by following the logic in the flow chart and pseudocode.
Watch out for dead ends, infinite loop conditions and logic errors.

Develop proto-type
Develop a rough proto-type to test the operation and functionality of the program

Review
Test the proto-type identify bugs, logic errors and other problems.

Repeat the process again and again and again
Analyse the problems, re-design, re-test, modify proto-type, review.

Develop final product
Once the proto-type meets all user requirements and performs as expected, finish developing the program.
Make it look and sound good.
Add some bells and whistles.
Pseudocode

BEGIN – PROMPT TO PLAY
Prompt the user to play
Accept user input play game
IF play game = true THEN
Start the game
END IF
END

BEGIN - START THE GAME
Hide user prompt
Set time to play
Set score to zero
WHILE game is not over
FOR each target object
Set random time to move
IF time to move THEN
Show the target object
Set random time to hide
END IF
IF target is hit THEN
Add one to score
Display hit message
Hide the target object
END IF
IF time to hide THEN
Hide the target object
END IF
END FOR
Check remaining time to play
IF time to play < = zero THEN
Game over = true
END IF
END WHILE
Stop game
Display Game Over
Prompt to play
END



Flow Chart.










ActionScript:
// hide introduction screen and start the game
// when the player clicks on the head in the Intro screen
intro.head.onRelease = function(){
fin._visible = false;
intro._visible = false;
startgame();
};
//
// initialise whack counter and ouch words
wcnt = 0;
words = new Array("WHACK", "WHAM", "POW", "ZOK", "THWAP","ZAM", "OUCH", "ZAP","BOP", "CLUNK", "SMASH", "OOPS", "ARGH!", "EEP!");
nwds = words.length;
//
// count whacks and display clip when a biffle is whacked
doWhackAt = function (x, y) {
// remove comment lines below to add a sound
// with a linkage name of ouch from the library
// var ouch = new Sound();
// ouch.attachSound("ouch");
// ouch.start();
var nm = "wc"+wcnt;
_root.attachMovie("whack", nm, wcnt+99);
_root[nm].word = words[Math.floor(Math.random()*nwds)];
_root[nm]._x = x;
_root[nm]._y = y;
_root[nm]._xscale = _root[nm]._yscale=70;
_root[nm].onEnterFrame = function() {
this._alpha -= 10;
if (this._alpha<=10) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
wcnt++;
wcnt %= 5;
};
//

// start and play the game
startgame = function () {
for (var i = 0; i<9; i++) {
var nm = "m"+i;
_root[nm].onPress = function() {
if (this._currentframe == 10) {
this.play();
whacks++;
scoreDisplay = whacks;
doWhackAt(_xmouse, _ymouse);
}
};
_root[nm].onEnterFrame = function() {
if (this._currentframe == 1 || this._currentframe == 10) {
if ((Math.random()*50)<1) {
this.play();
}
}
};
}
whacks = 0;
scoreDisplay = whacks;
endTime = getTimer()+30000;
_root.onEnterFrame = function() {
var eTime = endTime-getTimer();
if (eTime<=0) {
showTime = "Expired";
for (var i = 0; i<9; i++) {
var nm = "m"+i;
delete _root[nm].onPress;
delete _root[nm].onEnterFrame;
_root[nm].gotoAndStop(1);
delete _root.onEnterFrame;
}
gameover();
} else {
showTime = Math.ceil(eTime/1000)+" sec";
}
};
};
//
// show the game over screen and offer play again
gameover = function () {
fin._visible = true;
fin.head.onRelease = function() {
fin._visible = false;
delete fin.head.onRelease;
startgame();
};
};
Game Assets

Dynamic Text variables:
scoreDisplay
showTime


Movie Clips:
cylinder (object to hide in or behind – could be a rock)
head (mole head)
mole (moving head with a mask applied)
whack (clip to display when mole has been whacked)
intro (clip to display instructions and start game)
gameOver (clip to display Game Over and prompt to play again)



Student Task
Use the information provided above to create a prototype of the whack-a-mole game.
You may work with others to plan, design, develop and test the game.

Submit your prototype to your teacher for checking (finished or not) by end of class in week 5.

Have fun

...Catch A Smurf....

Wednesday, August 03, 2005

Tafe : 7872 : Flash...


Lego.swf
LegoSWF.jpg


FAILED

Tafe : Geoff : week 3 : Pseudocode Exercises... Amended


Pseudocode Exercises: Marks: 30%

Write pseudocode for each of the following program specifications.

1. The user is to enter a temperature in centigrade and you are you convert it to Fahrenheit and display the result. The formula is F=C*9/5+32.

2. The same as 1 above but only convert the temperature if the entered value is less than 101C

3. The same as 2 above but limit the input temperatures between -10C and 50C.

4. As for 3 above but keep asking for more temperatures to convert until the user enters the word EXIT.

5. The user must enter an exchange rate and an amount of Australian Dollars. The program shows how much of the original currency can be purchased. Thus if the exchange rate is .7 and there are $AU10 then the output is $7.00.

6. As for 5 above but make sure that the user does not enter a negative amount to convert.

7. A pilot knows that pressure drops by 1HP (Hecto Pascal) for every 30 feet increase in altitude. Write a program to ask for the pressure in HP at sea level and a cruising altitude (which must be > 0). Calculate and display the pressure at the cruising altitude.

8. Modify the program for 7 above to add a temperature estimate, given that the temperature will drop by 1.5 degrees C for every 1000 feet of altitude.


Instructions:
Complete the above exercises and submit to your teacher for marking by the end of week 4 of semester. These exercises are worth 30% of your overall mark for this unit.
You must obtain a pass mark for these exercises in order to pass the unit.

Late submissions will NOT be marked, unless accompanied by a medical certificate or a documented legitimate reason which must be submitted within one week of the due date.

Psudocode/Standard English.

"I am using Alphabetical increments for Processing not Recall purposes."
(1)
Begin A=0 B=0
Input A=TRUE
B=A*9/5+32
Output "Temperature", B
End

(2)
Begin A=0 B=0
Input A<101
B=A*9/5+32
Output "Temperature", B
End

(3)
Begin A=0 B=0
Input A Between -10 and 50
B=A*9/5+32
Output "Temperature", B
End

"15-20 Years of programming has led me to use the declarations in a horizontal plane. To allow for extra varianbles to be added."
(4)
Begin B=0
INPUT A
WHILE A != "EXIT" and Between -10 & 50
B=A*9/5+32
Output B
INPUT A
End WHILE
End

(5)
Begin A=0 B=0
Input A=True
Output A
B=A*(70/100)
Output B
End

"Limiters should be applied at the Declaration on the variable, "Like DTDs Or Schemas".
(6)
Begin A>=0 B>=0
Input A>0
Output A
B=A*(70/100)
Output B
End

"Combined output saves on multiple Lines"
(7)
Begin A=0 B=0 C=0
output ""sea level pressure?"
Input A
Output "cruising altitude?"
Input B > 0
C=A+(B/30)
Output "Pressure at crusing altitude equals", C
End

(8)
Begin A=0 B=0 C=0 D=0 E=0
Output "sea Level Pressure?"
Input A
Output "cruising altitude?"
Input B > 0
Output "Current Temperature?"
Input C
D=A+(B/30)
E=C-((3/2)*(B/1000))
Output " Cruising Pressure", D
Output "Cruising Temperature", E
End