Ana səhifə

Cis587 Assignment 4 Game Design Doc of


Yüklə 398 Kb.
tarix26.06.2016
ölçüsü398 Kb.

CIS587 Assignment 4

Game Design Doc of



Professor: Bruce Maxim

Done by: Man K. Woo

Due: 12/17/02
Table Of Contents

1.Overview…………………………………………………………………….P.3


2.Game Mechanics

2.1.Overview……………………………………………………………P.3

2.2.Camera Position……………………………………..……………P.4

2.3.User Interface Design…………………………………..………..P.4

2.4.Replaying and Saving…………………………………………….P.5

2.5.Control Summary…………………………………………….……P.5

2.6.Game Play Details……………………………………………..….P.6

2.7.Cut-Scenes…………………………………………………………P.7

2.8.Storytelling…………………………………………………………P.7

2.9.Level Summary………………………………………………….…P.7
3.Artificial Intelligence

3.1.Opponent AI………………………………………………………...P.8

3.2.Player Detection……………………………………………………P.8

3.3.Motion……………………………………………………………..…P.8

3.4.Path Finding…………………………………………………………P.9

3.5.Special Actions…………………………………………………..…P.9

3.6.Combat……………………………………………………………….P.9

3.7.Non-player Characters………………………………………….…P.9

3.8.Puzzles and Traps……………………………………………….…P.9
4.Game Elements

4.1.Items……………………………………………………………….…P.9

4.2.Character Bibles………………………………………………..…P.10
5.Story Overview

5.1.Storyboard………………………………………………………….P.11

5.2.Plot Summary………………………………………………………P.12
6.Game Progression

6.1.Setting…………………………………………………………….…P.12

6.2.Introduction………………………………………………………...P.13

6.3.Flowchart……………………………………………………………P.13

6.4.Level and Scene Details………………………………………….P.14
7.Bibliography…………………………………………………………………P.14
8.Source Codes……………………………………………………………….P.14

1. Overview

Dragonball Z – The Sky Battle is based on the series in the famous Japanese comics Dragonball. In the story, Son Goku is a super fighter who has the ability similar to Superman’s. He fights against many evil invaders and saves the Earth again and again. He has many friends, and in particular, Vegeta is his friend as well as rival who always wishes to beat him. In , the ultimate evil fighter called Majin Buu is resurrected and brings a great threat to the Earth! Even in full power, Goku cannot beat him because Buu is fissionable. In order to gain more power, Goku now fuse with Vegeta to transform to the super fighter – Vegetto! Vegetto must kill as many Buus as he can to rescue our world, or else it would be disasterous.


For game play, Dragonball Z – The Sky Battle is just like the classic arcade top-down shooter 1942 with a different setting. In Sky Battle, the user plays as Vegetto and controls Vegetto’s position on the screen via the left, right, up and down arrow keys. Vegetto’s energy ball attack is released by the hitting of space bar. The goal of this game is to shoot down as many Majin Buu as possible in order to get more than 49999 points. During the game, more than one Majin Buu will appear on the screen (because he is fissionable), they will descend from the top to the bottom of the screen with a random track of motion. User will have 3 lives for Vegetto as default. When Majin Buu hits Vegetto with his body, Vegetto will lose 1 live by that. If all 3 lives are gone, then the game is over. On the other hand, user must manage to control Vegetto well and tries to avoid colliding with Majin Buus. User can kill Majin Buu by shooting energy ball to them. Majin Buu is killed if it gets shot, and user’s score is raised for each Majin Buu shot. When user’s score reaches a certain value, the amount of Majin Buu generated at a time will be increased and different forms of Buu will show up in order to level up the difficulty. If game is over, user can choose to re-play the game.


2. Game Mechanics


2.1. Overview

Dragonball Z – The Sky Battle is a 2D top-down shooter in the tradition of 1942. It has a background with a sky with clouds continuously scrolling so that the user can feels the speed. However, The Sky Battle only has one stage, one background with different levels of enemies. The game mechanics are designed in such a way as to allow the user extensive control of his super hero while the user can enjoy blasting off the enemies using different forms of attacks that are seen on the famous comics.


2.2. Camera Position

The camera position in this game is fixed to a “top-down” view without any swinging or zooming. The player can always see his/her character of the same size, moving freely at his/her own wish within the screen. Enemies are showing up from the top, descending to the bottom of the screen, all are with the same fixed default sizes.




    1. User Interface Design

Before entering the game, there is a menu with two options appeared as two buttons, namely START and INSTRUCTIONS.


  • START: brings the player to a new game.

  • INSTRUCTIONS: brings out the instructions menu for this game.

In the game, the player’s screen shows a background of sky with scrolling clouds. Player’s character, Vegetto, is positioned at center by default. Of course, the player can move Vegetto around using arrow keys. In addition, player can find out two elements on the screen, telling the information about Vegetto’s status as follow:




  • Lives remained: they are at the right upper corner of the screen, each live is represented by the head of Vegetto. Player can only have at most 3 lives. Every time when Vegetto gets hit by Majin Buu, one live is taken away and one associated icon (the head) will disappear, denoting the loss of one live.

  • Score: it locates at the left lower corner of the screen, showing the current score that the player has. In order to beat the game, player must challenge to get higher than 49999.

The following is a sample screenshot:





    1. Replaying and Saving

As this is a short and strict forward game, so once player has lost all the 3 lives, then game is over and player will be asked to click on “Continue”. If he does, the game just simply resets everything to the beginning: resets score to zero; resets lives to 3; reset level to the first one. There are not any checkpoints in this game. Therefore, in other words, player must pay attention or else he/she must start all over again.


    1. Control Summary

The player will use the keyboard to maneuver Vegetto’s movement and attacks throughout the whole game. The controls are summarized below:


  • Up, Down, Left, Right arrow keys: The player will use this control to move Vegetto freely around the space within the screen. For instance, when player presses the right arrow key, Vegetto will fly to his right. The movement is crucial in this game because player must try to get more green Senzu beans while trying to evade any Majin Buu if he/she cannot kill it before it approaches.

  • Space bar: The player can press the space bar to shoot a small energy ball for attack. One small energy ball is good enough to kill a Majin Buu. In this attack, there can only be at most 5 energy balls appeared in the screen at one time.

  • a” key: The player can press the character “a” key to trigger the shield attack. It will completely protects Vegetto from being hit by Majin Buu while killing the enemies. However, this weapon is too powerful and so there is penalty in using it: for each shield shot, 250 points will be deducted from the current score. Also, in order to trigger it, the player must at least have 2000 points in his/her current score.

  • The secret “z” key”: This weapon is supposed to be the bonus of this game. It is not as powerful as the “a” key, but it is much more powerful than the tiny space bar attacks. The good point is, it does not have any penalties! It is a thick laser which allows you to blast enemies with ease. However, the player is only acknowledged about the existence of this secret big bang attack after he/she beats the game once.




    1. Game Play Details

The main idea is to freely move Vegetto over the space provided using the arrow keys on keyboard and to attack Majin Buu with energy ball by pressing the space bar, “z” key or “a” key. The details of the major game elements are discussed below:


  • Goal of the game: The goal is to shoot and kill as many Majin Buu appeared in the game as possible before Vegetto runs out of lives. The target score in order to beat the game is 50000. Different forms of Majin Buu have different score points, varying from 100 points to 300 points.

  • Character “Vegetto”: This is the character controlled by the player. Player must try to master the skills for Vegetto’s movement. There are 3 attack modes for Vegetto. The basic one is the small energy ball triggered by space bar. The second one is the big bang attack (a thick laser) triggered by “z” key. The ultimate third weapon is the huge energy shield triggered by “a” key, but this attack has its own penalty of –250 points in the score for every shot. Also, the big bang attack is only informed to players after they beat the game.

  • Character “Majin Buu”: These are the characters that are controlled by the computer. Player should try to kill all of them. There are 5 different forms of Majin Buu, that are with different sizes, different speeds of movement and different score points reward.

  • Senzu beans: These are the green beans that appear during the game occasionally. Each bean is worth 200 points and can restore 1 live of Vegetto.

  • Tips to win: player should, of course, kill all the Majin Buu that show up during the game. However, player can sometimes trigger the huge shield attack if there are too many Majin Buu to handle, yet, it cannot be used all the time, otherwise the score would always be too low due to the penalty of the shield. Another tip is to try to pick up all the beans, there are no reasons to reject them!


2.7. Cut-Scenes

There are no major cut-scenes in the game that would be beneficial to the game.




    1. Storytelling

Solely based on the gameplay, there is actually not much for the story of this game. The story is just like the classics: hero beats the bad guy to save the world. However, using the animation features of FLASH, the opening of this game briefly talks about the story of this Dragonball shooting game, introducing the main characters: Vegetto and Majin Buu.


    1. Level Summary

The level discussed here is talking about the different forms of Majin Buu that appears in the game according to the current score. The details are listed here:


  • 1st form: it will appear throughout the game. Its movement speed will increase as long as the score increases. Although its size is the smallest among the 5 forms, it has the fastest speed, ranging from +10 to +40, depending on the score. It is worth 100 points for reward.

  • 2nd form: it will also appear throughout the game. Its movement speed is fixed to +15. Its size is similar to the 1st form, but it is worth 150 points for reward.

  • 3rd form: it will only appear if the score is between 5000 and 10000. Its movement speed is fixed to +15. Its size is bigger than the 1st and the 2nd forms. It is worth 200 points for reward.

  • 4th form: it will only appear if the score is between 10000 and 15000. Its movement speed is fixed to +15. Its size is bigger than the previous forms. It is worth 250 points for reward.

  • 5th form: it will only appear if the score is greater than 15000. Its movement speed is fixed to +15. Its size is the biggest. It is worth 300 points for reward.




3. Artificial Intelligence




    1. Opponent AI

The enemies that Vegetto faces are the 5 different forms of Majin Buu. They have different sizes, different speed of movement and different score points for reward. However, their movement does not involve any AI due to the limited time of development of this game.


    1. Player Detection

All forms of Majin Buu do not have the ability to detect and track the player.


    1. Motion

Different forms of Majin Buu will have different descending speed (y-axis) of motion. However, they do not move strictly along the vertical y-axis. They also have x-axis motion. At random, Buu will either move straight, move to the right by 10 pixels or to the left by 10 pixels while they are descending to the bottom. Their probabilities are 3/5, 1/5 and 1/5 respectively.



    1. Path Finding

There is no path finding ability for Majin Buu at all forms.


    1. Special Actions

No special actions are designed in this game.


    1. Combat

Although there are five different forms of Majin Buu, there is only one attack mode for them. They can only attack Vegetto by hitting themselves with him. Once the game detects the hitting, Vegetto will lose one live by that.


    1. Non-player Characters

Besides the different forms of Majin Buu, there are no other NPCs appeared in the game.


    1. Puzzles and Traps

Since this is only a plain shooting game, so unlike other adventure games, there are no puzzles and traps for this game. The main focus is to let player enjoy the shooting and destroying enemies, not solving puzzles or traps.


4. Game Elements


4.1. Items

The only item in this game is the green Senzu bean. It is worth 200 points for reward and it can restore 1 live for Vegetto. Here is the picture of it:






    1. Character Bibles

  • Vegetto: this is the character controlled by the player. In the comics Dragonball Z, he is the super hero who can fly like Superman. User uses the left, right, up and down arrow keys to control Vegetto’s movement. When the correct key is pressed, Vegetto will have 3 attack modes to release energy ball from his hand to attack Majin Buu. Here is the picture of him:



Small energy ball: triggered by space bar



Big bang attack: triggered by “z” key



Huge shield attack: triggered by “a” key; with a penalty of –250 points in score for each shot






  • Majin Buu: this is the character controlled by the computer. In the comics Dragonball Z, he is the ultimate evil creature that is fissionable. In the game, there are more than one Majin Buu flying around the screen at one time. They attack Vegetto by colliding themselves with him. In total, there are five different forms appearing in the game. They are shown below:

1st form: smallest size, fastest, worth 100 points



2nd form: similar size with 1st form, fixed speed, worth 150 points



3rd form: bigger size, fixed speed, worth 200 points



4th form: second largest size, fixed speed, worth 250 points



5th form: biggest size, fixed speed, worth 300 points






5. Story Overview




    1. Storyboard

In Dragonball Z, Son Goku is a super fighter who has the ability similar to Superman’s. He fights against many evil invaders and saves the Earth again and again. He has many buddies, and in particular, Vegeta is his friend as well as rival who always wishes to beat him. Goku and Vegeta are becoming stronger and stronger after each fierce battle with those evil fighters from other planets. In , the ultimate evil fighter called Majin Buu is resurrected and brings a great threat to the Earth! All fighters on Earth are defeated and died except the two greatest warriors: Goku & Vegeta. However, even in their full power, Goku and Vegeta cannot beat him because Buu is fissionable. Majin Buu keeps re-generating himself even his body is destroyed. In order to gain more power, Supreme Kai (the God) gives a pair of earrings to Goku. With each of them wearing one earring, Goku now fuses with Vegeta to transform to the ultimate super hero – Vegetto! The only way to stop the disaster is to kill ALL Majin Buus at a time!
5.2. Plot Summary

Simulated the story in in Dragonball Z, Vegetto will battle with Majin Buu in the sky while Majin Buu is fissionable. Vegetto needs to use his greatest power to destroy all the Majin Buu in the sky, all at the same time.


In the upper right corner of the screen, user can see the number of lives of Vegetto remained. In the left bottom corner, user can see the scoreboard that shows user’s current score. For the characters, user is controlling Vegetto with golden hair, who is positioned in the middle of the bottom screen at start while Majin Buu is the fat and pink monster floating in the sky. If Majin Buu is shot, it will disappear and fade away. On the other hand, Vegetto is acting the same when he collides with one of the Majin Buus. When user loses all the 3 lives of Vegetto, a button will appear on the screen to ask user to try again.


6. Game Progression




    1. Setting

The Sky Battle takes place on the Earth in the imaginary world created by Akira Toriyama in Dragonball Z. It is a world very similar to the real one. However, there are more super fighters that have the ability like Superman’s. The story starts by saying that the ultimate evil creature Majin Buu is revived from death. He is assumed to be purely evil and most powerful in the universe. Even uniting the power of all the fighters on Earth, Majin Buu is still invincible. Now the hope falls onto the two super fighters called Goku and Vegeta. Through fusion, they combined into one body and the greatest warrior Vegetto is born. He must stop Majin Buu from destroying the lives on Earth as soon as possible because the demolition is giant already and disaster is everywhere.


    1. Introduction

The player controls the super fighter Vegetto. By using different attacks, the battle between Vegetto and the large number of evil creatures is going to be huge!


    1. Flowchart for Majin Buu


1st and 2nd forms of Majin Buu show up at start by default




Score is between

5000 to 10000


1st, 2nd and 3rd forms of Majin Buu show up in the game






Score is between

10000 to 15000
1st, 2nd and 4th forms of Majin Buu show up in the game





Score is more than

15000

15000
1st, 2nd and 5th forms of Majin Buu show up in the game



    1. Level and Scene Details

Levels are referring to the different forms of Majin Buu appeared in the game. The criteria for each form of Majin Buu are shown in the flow chart in 6.3 above.
For Scene, there is only one scene, the sky with scrolling clouds, throughout the game due to the short period of development time. The scrolling clouds give player a feeling of fast flying speed of Vegetto.


7. Bibliography

In this game, I learnt some techniques of FLASH game programming from the following sources:



  • www.flashkit.com

  • FLASH discussion group in www.macromedia.com




8. Source codes

The followings are the source codes for different components (e.g. Vegetto, 5 forms of Majin Buu) appeared in the game.

/*At the ending after user beats the game*/

/*If user clicks "Continue" to try the game again*/

on (release) {

//reset player's live to 3

_root.live = 3;

//reset player's lock, so that Vegetto can be hit

_root.lock = 0;

//reset player's score to zero

_root.hit = 0;

//display the three live symbols at the upper right corner on the screen

setProperty ("_root.live1", _visible, "1");

setProperty ("_root.live2", _visible, "1");

setProperty ("_root.live3", _visible, "1");

//hide the ending screen again

setProperty ("_root.ending", _alpha, "0");

//hide the game over screen

setProperty ("_root.over", _alpha, "0");

//display the various forms of Majin Buu again

setProperty ("_root.t1", _alpha, "100");

setProperty ("_root.b1", _alpha, "100");

setProperty ("_root.m1", _alpha, "100");

//reset Vegetto and display him as the original form

tellTarget ("/p1") {

gotoAndStop (1);

}

//reset keyboard acception



tellTarget ("_root.key") {

gotoAndPlay (1);

}

}

/*The following is to generate different forms of Majin Buu on the screen*/


_root.r = _root.r+1;

//duplicate the first form of Majin Buu which appears all the time

_root.t1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position appeared on the screen when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50)); //x-coord

setProperty ("/t"+_root.r, _y, -200); //y-coord

//if the number of this Majin Buu exeeds 50 at one screen

if (_root.r>50) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-10));

}
_root.r = _root.r+1;

//duplicate the second form of Majin Buu which appears all the time

_root.s1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position appeared on the screen when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50)); //x-coord

setProperty ("/t"+_root.r, _y, -200); //y-coord

//if the number of this Majin Buu exeeds 50 at one screen

if (_root.r>50) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-10));

}
//if score is between 5000 and 10000

if ((_root.hit > 5000) and (_root.hit <= 10000)) {

_root.r = _root.r+1;

//duplicate the 3rd kind of Majin Buu with bigger size

_root.me1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position appeared on the screen when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50)); //x-coord

setProperty ("/t"+_root.r, _y, -200); //y-coord

//if the number of this Majin Buu exeeds 50 at one screen

if (_root.r>50) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-10));

}

}

//if score is between 10000 and 15000



else if ((_root.hit > 10000) and (_root.hit <= 15000)){

_root.r = _root.r+1;

//duplicate the 4th kind of Majin Buu with bigger size

_root.m1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position appeared on the screen when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50)); //x-coord

setProperty ("/t"+_root.r, _y, -200); //y-coord

//if the number of this Majin Buu exeeds 50 at one screen

if (_root.r>50) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-10));

}

}



//if score is greater than 15000

else if (_root.hit > 15000) {

_root.r = _root.r+1;

//duplicate the 5th kind of Majin Buu with biggest size

_root.l1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position appeared on the screen when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50)); //x-coord

setProperty ("/t"+_root.r, _y, -200); //y-coord

//if the number of this Majin Buu exeeds 50 at one screen

if (_root.r>50) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-10));

}

}

/*The following is about the key detection from the keyboard*/


//if the key pressed is the right arrow and Vegetto is within the boundary

if (Key.isDown(Key.RIGHT ) and _root.p1._x<520) {

//move Vegetto to the right by 25 pixels

setProperty (_root.p1, _x, _root.p1._x+25);

}

//if the key pressed is the left arrow and Vegetto is within the boundary



if (Key.isDown(Key.LEFT) and _root.p1._x>30) {

//move Vegetto to the left by 25 pixels

setProperty (_root.p1, _x, _root.p1._x-25);

}

//if the key pressed is the up arrow and Vegetto is within the boundary



if (Key.isDown(Key.UP) and _root.p1._y>50) {

//move Vegetto upward by 25 pixels

setProperty (_root.p1, _y, _root.p1._y-25);

}

//if the key pressed is the down arrow and Vegetto is within the boundary



if (Key.isDown(Key.DOWN) and _root.p1._y<365) {

//move Vegetto downward by 25 pixels

setProperty (_root.p1, _y, _root.p1._y+25);

}

//if the key pressed is space bar, i.e. user shoots with 1st weapon



if (Key.isDown(Key.SPACE)) {

//play its shooting sound labeled by "s"

_root.s.start();

_root.n = _root.n+1;

//duplicate the ammo each time for 1 hit of key

_root.ball.duplicateMovieClip("x"+_root.n, _root.n );

//set the ammo x-coord position to the one of Vegetto's

setProperty ("/x"+_root.n, _x, _root.p1._x);

//set the ammo y-coord position to the one of his hand's tip

setProperty ("/x"+_root.n, _y, _root.p1._y-140);

//restrict the ammo can at most have 5 shots in one screen

if (_root.n>5) {

//remove the redundants

removeMovieClip ("/x"+(_root.n-5));

}

}

//if the key pressed is "z", i.e. user shoots with 2nd weapon



if (Key.isDown(90)) {

//play its shooting sound labeled by "u"

_root.u.start();

_root.n = _root.n+1;

//duplicate the ammo each time for 1 hit of key

_root.longball.duplicateMovieClip("x"+_root.n, _root.n );

//set the ammo x-coord position to the one of Vegetto's

setProperty ("/x"+_root.n, _x, _root.p1._x);

//set the ammo y-coord position to the one of his hand's tip

setProperty ("/x"+_root.n, _y, _root.p1._y-385);

//restrict the ammo can at most have 1 shot in one screen

if (_root.n>1) {

//remove the redundants

removeMovieClip ("/x"+(_root.n-1));

}

}

//if the key pressed is "a", i.e. user shoots with 3rd weapon



if ((Key.isDown(65)) and (_root.hit >= 2000)) {

//play its shooting sound labeled by "v"

_root.v.start();

_root.n = _root.n+1;

//penality: minus 250 points from score if user shoots with this one

_root.hit = _root.hit - 250;

//duplicate the ammo each time for 1 hit of key

_root.bigattack.duplicateMovieClip("x"+_root.n, _root.n );

//set the ammo x-coord position to the one of Vegetto's

setProperty ("/x"+_root.n, _x, _root.p1._x);

//set the ammo y-coord position to the one of his hand's tip

setProperty ("/x"+_root.n, _y, _root.p1._y-125);

//restrict the ammo can at most have 1 shot in one screen

if (_root.n>0) {

//remove the redundants

removeMovieClip ("/x"+(_root.n-1));

}

}

/*The following is adjusting the speed of 1st kind of Majin Buu



according to the score, the higher the score the higher the speed*/
//if score is < 3000

if (_root.hit < 3000) {

//displacement is +10

setProperty ("", _y, _y+10);

}

//if score is between 3000 and 6000



else if ((_root.hit < 6000) and (_root.hit >= 3000)) {

//displacement is +10

setProperty ("", _y, _y+10);

}

//if score is between 6000 and 9000



else if ((_root.hit < 9000) and (_root.hit >= 6000)) {

//displacement is +15

setProperty ("", _y, _y+15);

}

//if score is between 9000 and 12000



else if ((_root.hit < 12000) and (_root.hit >= 9000)) {

//displacement is +20

setProperty ("", _y, _y+20);

}

//if score is between 12000 and 15000



else if ((_root.hit < 15000) and (_root.hit >= 12000)) {

//displacement is +25

setProperty ("", _y, _y+25);

}

//if score is between 15000 and 18000



else if ((_root.hit < 18000) and (_root.hit >= 15000)) {

//displacement is +30

setProperty ("", _y, _y+30);

}

//if score is between 18000 and 21000



else if ((_root.hit < 21000) and (_root.hit >= 18000)) {

//displacement is +35

setProperty ("", _y, _y+35);

}

//if score is between 21000 and 24000



else if ((_root.hit < 24000) and (_root.hit >= 21000)) {

//displacement is +35

setProperty ("", _y, _y+35);

}

//if score is greater than 24000



else if (_root.hit >= 24000) {

//displacement is +40

setProperty ("", _y, _y+40);

}
/*Buu will move either to the right or left by 20 pixels at random

or stay at the current x-coord*/

randomx = random(10);

if (randomx>8) {

//move to the right

setProperty ("", _x, _x+20);

}

if (randomx<2) {



//move to the left

setProperty ("", _x, _x-20);

}
//load the sound assigned for Vegetto collides with Buu

losesound = new Sound();

//label the sound clip

losesound.attachSound("scream");

/*Test if Vegetto hits with Buu and check if Vegetto has just

been hit shortly before, if he doesn't, do the following*/

if (hitTest(_root.p1) and _root.lock <>1) {

//make one live symbol disappear

if (getProperty("_root.live3", _visible) == "1"){

setProperty ("_root.live3", _visible, "0");

}

else if (getProperty("_root.live2", _visible) == "1"){



setProperty ("_root.live2", _visible, "0");

}

else if (getProperty("_root.live1", _visible) == "1"){



setProperty ("_root.live1", _visible, "0");

}

//minus 1 live from player



_root.live = _root.live-1;

//play the music for losing one live

losesound.start(scream, 1);

//display Vegetto getting hit

tellTarget ("/p1") {

gotoAndPlay (2);

}

gotoAndPlay(8);



}

/*Check if ammo hits Buu and do the following*/

for (kkk=0; kkk<20; kkk++) {

if (hitTest("_root.x"+(_root.n-kkk))) {

gotoAndPlay (3);

//increase the score by 100 points for this form of Buu

_root.hit = _root.hit+100;

removeMovieClip ("_root.x"+(_root.n-kkk));

//if user scores more than 49999, i.e. beat the game

if (_root.hit > 49999) {

//display the ending scene

setProperty (_root.ending, _alpha, 100);

//make all the Buus invisible

setProperty (_root.t1, _alpha, 0);

setProperty (_root.b1, _alpha, 0);

setProperty (_root.m1, _alpha, 0);

setProperty (_root.l1, _alpha, 0);

setProperty (_root.me1, _alpha, 0);

setProperty (_root.s1, _alpha, 0);

//lock the keyboard so that user can't enter anything

tellTarget(_root.key) {

gotoAndStop (3);

}

}

}



}

/*The following is about the 2nd form of Majin Buu*/


//the y-coord displacement is fixed to +25

setProperty ("", _y, _y+25);


/*Buu will move either to the right or left by 15 pixels at random

or stay at the current x-coord*/

randomx = random(10);

if (randomx>8) {

setProperty ("", _x, _x+15);

}

if (randomx<2) {



setProperty ("", _x, _x-15);

}

//load the sound assigned for Vegetto collides with Buu



losesound = new Sound();

//label the sound clip

losesound.attachSound("scream");

/*Test if Vegetto hits with Buu and check if Vegetto has just

been hit shortly before, if he doesn't, do the following*/

if (hitTest(_root.p1) and _root.lock<>1) {

//make one live symbol disappear

if (getProperty("_root.live3", _visible) == "1") {

setProperty ("_root.live3", _visible, "0");

} else if (getProperty("_root.live2", _visible) == "1") {

setProperty ("_root.live2", _visible, "0");

} else if (getProperty("_root.live1", _visible) == "1") {

setProperty ("_root.live1", _visible, "0");

}

//minus 1 live from player



_root.live = _root.live-1;

//play the music for losing one live

losesound.start(scream, 1);

tellTarget ("/p1") {

gotoAndPlay (2);

}

gotoAndPlay (8);



}

/*Check if ammo hits Buu and do the following*/

for (kkk=0; kkk<20; kkk++) {

if (hitTest("_root.x"+(_root.n-kkk))) {

gotoAndPlay (3);

//increase the score by 150 points for this form of Buu

_root.hit = _root.hit+150;

removeMovieClip ("_root.x"+(_root.n-kkk));

//if user scores more than 49999, i.e. beat the game

if (_root.hit>49999) {

//display the ending scene

setProperty (_root.ending, _alpha, 100);

//make all the Buus invisible

setProperty (_root.t1, _alpha, 0);

setProperty (_root.b1, _alpha, 0);

setProperty (_root.m1, _alpha, 0);

setProperty (_root.l1, _alpha, 0);

setProperty (_root.me1, _alpha, 0);

setProperty (_root.s1, _alpha, 0);

//lock the keyboard so that user can't enter anything

tellTarget (_root.key) {

gotoAndStop (3);

}

}

}



}

/*The following is about the 3rd form of Majin Buu*/


//the y-coord displacement is fixed to +15

setProperty ("", _y, _y+15);


/*Buu will move either to the right or left by 20 pixels at random

or stay at the current x-coord*/

randomx = random(10);

if (randomx>8) {

setProperty ("", _x, _x+10);

}

if (randomx<2) {



setProperty ("", _x, _x-10);

}

//load the sound assigned for Vegetto collides with Buu



losesound = new Sound();

//label the sound clip

losesound.attachSound("scream");

/*Test if Vegetto hits with Buu and check if Vegetto has just

been hit shortly before, if he doesn't, do the following*/

if (hitTest(_root.p1) and _root.lock<>1) {

//make one live symbol disappear

if (getProperty("_root.live3", _visible) == "1") {

setProperty ("_root.live3", _visible, "0");

} else if (getProperty("_root.live2", _visible) == "1") {

setProperty ("_root.live2", _visible, "0");

} else if (getProperty("_root.live1", _visible) == "1") {

setProperty ("_root.live1", _visible, "0");

}

//minus 1 live from player



_root.live = _root.live-1;

//play the music for losing one live

losesound.start(scream, 1);

tellTarget ("/p1") {

gotoAndPlay (2);

}

gotoAndPlay (8);



}

/*Check if ammo hits Buu and do the following*/

for (kkk=0; kkk<20; kkk++) {

if (hitTest("_root.x"+(_root.n-kkk))) {

gotoAndPlay (3);

//increase the score by 200 points for this form of Buu

_root.hit = _root.hit+200;

removeMovieClip ("_root.x"+(_root.n-kkk));

//if user scores more than 49999, i.e. beat the game

if (_root.hit>49999) {

//display the ending scene

setProperty (_root.ending, _alpha, 100);

//make all the Buus invisible

setProperty (_root.t1, _alpha, 0);

setProperty (_root.b1, _alpha, 0);

setProperty (_root.m1, _alpha, 0);

setProperty (_root.l1, _alpha, 0);

setProperty (_root.me1, _alpha, 0);

setProperty (_root.s1, _alpha, 0);

//lock the keyboard so that user can't enter anything

tellTarget (_root.key) {

gotoAndStop (3);

}

}

}



}

/*The following is about the 4th form of Majin Buu*/


//the y-coord displacement is fixed to +15

setProperty ("", _y, _y+15);


/*Buu will move either to the right or left by 20 pixels at random

or stay at the current x-coord*/

randomx = random(10);

if (randomx>8) {

setProperty ("", _x, _x+10);

}

if (randomx<2) {



setProperty ("", _x, _x-10);

}

//load the sound assigned for Vegetto collides with Buu



losesound = new Sound();

//label the sound clip

losesound.attachSound("scream");

/*Test if Vegetto hits with Buu and check if Vegetto has just

been hit shortly before, if he doesn't, do the following*/

if (hitTest(_root.p1) and _root.lock<>1) {

//make one live symbol disappear

if (getProperty("_root.live3", _visible) == "1") {

setProperty ("_root.live3", _visible, "0");

} else if (getProperty("_root.live2", _visible) == "1") {

setProperty ("_root.live2", _visible, "0");

} else if (getProperty("_root.live1", _visible) == "1") {

setProperty ("_root.live1", _visible, "0");

}

//minus 1 live from player



_root.live = _root.live-1;

//play the music for losing one live

losesound.start(scream, 1);

tellTarget ("/p1") {

gotoAndPlay (2);

}

gotoAndPlay (8);



}

/*Check if ammo hits Buu and do the following*/

for (kkk=0; kkk<20; kkk++) {

if (hitTest("_root.x"+(_root.n-kkk))) {

gotoAndPlay (3);

//increase the score by 250 points for this form of Buu

_root.hit = _root.hit+250;

removeMovieClip ("_root.x"+(_root.n-kkk));

//if user scores more than 49999, i.e. beat the game

if (_root.hit>49999) {

//display the ending scene

setProperty (_root.ending, _alpha, 100);

//make all the Buus invisible

setProperty (_root.t1, _alpha, 0);

setProperty (_root.b1, _alpha, 0);

setProperty (_root.m1, _alpha, 0);

setProperty (_root.l1, _alpha, 0);

setProperty (_root.me1, _alpha, 0);

setProperty (_root.s1, _alpha, 0);

//lock the keyboard so that user can't enter anything

tellTarget (_root.key) {

gotoAndStop (3);

}

}

}



}

/*The following is about the 5th form of Majin Buu*/


//the y-coord displacement is fixed to +15

setProperty ("", _y, _y+15);


/*Buu will move either to the right or left by 20 pixels at random

or stay at the current x-coord*/

randomx = random(10);

if (randomx>8) {

setProperty ("", _x, _x+10);

}

if (randomx<2) {



setProperty ("", _x, _x-10);

}

//load the sound assigned for Vegetto collides with Buu



losesound = new Sound();

//label the sound clip

losesound.attachSound("scream");

/*Test if Vegetto hits with Buu and check if Vegetto has just

been hit shortly before, if he doesn't, do the following*/

if (hitTest(_root.p1) and _root.lock<>1) {

//make one live symbol disappear

if (getProperty("_root.live3", _visible) == "1") {

setProperty ("_root.live3", _visible, "0");

} else if (getProperty("_root.live2", _visible) == "1") {

setProperty ("_root.live2", _visible, "0");

} else if (getProperty("_root.live1", _visible) == "1") {

setProperty ("_root.live1", _visible, "0");

}

//minus 1 live from player



_root.live = _root.live-1;

//play the music for losing one live

losesound.start(scream, 1);

tellTarget ("/p1") {

gotoAndPlay (2);

}

gotoAndPlay (8);



}

/*Check if ammo hits Buu and do the following*/

for (kkk=0; kkk<20; kkk++) {

if (hitTest("_root.x"+(_root.n-kkk))) {

gotoAndPlay (3);

//increase the score by 300 points for this form of Buu

_root.hit = _root.hit+300;

removeMovieClip ("_root.x"+(_root.n-kkk));

//if user scores more than 49999, i.e. beat the game

if (_root.hit>49999) {

//display the ending scene

setProperty (_root.ending, _alpha, 100);

//make all the Buus invisible

setProperty (_root.t1, _alpha, 0);

setProperty (_root.b1, _alpha, 0);

setProperty (_root.m1, _alpha, 0);

setProperty (_root.l1, _alpha, 0);

setProperty (_root.me1, _alpha, 0);

setProperty (_root.s1, _alpha, 0);

//lock the keyboard so that user can't enter anything

tellTarget (_root.key) {

gotoAndStop (3);

}

}

}



}

/*The following handles the Sanzu beans duplication*/

_root.r = _root.r+1;

//duplicate one Sanzu bean

_root.b1.duplicateMovieClip("t"+_root.r, _root.r);

//set its position at random when show up

setProperty ("/t"+_root.r, _x, random(450)+Number(50));

setProperty ("/t"+_root.r, _y, -150);

//restrict the number of beans appeared in one screen to two

if (_root.r>3) {

//remove the redundants

removeMovieClip ("/t"+(_root.r-1));

}

/*The following is about one Sanzu bean*/


//the y-coord displacement is fixed to +10

setProperty ("", _y, _y+10);

//load the sound assigned for Vegetto collides with bean

eatsound = new Sound();

//label the sound clip

eatsound.attachSound("eat");

//if Vegetto collides with one bean, do the following

if (hitTest(_root.p1)) {

//if user now only has less than or equal to 2 lives

if (_root.live <= 2) {

//make one live symbol re-appear again on the screen

if (getProperty("_root.live2", _visible) == "0"){

setProperty ("_root.live2", _visible, "1");

}

else if (getProperty("_root.live3", _visible) == "0"){



setProperty ("_root.live3", _visible, "1");

}

//increase the 1 live of player



_root.live = _root.live+1;

}

gotoAndPlay (3);



//increase the score points by 200

_root.hit = _root.hit+200;

//play the music of picking up bean

eatsound.start(eat, 1);

gotoAndPlay(8);

}

/*The following handles the "Continue" on the Game Over screen*/


//If user clicks on "Continue"

on (release) {

//restore user's lives to 3

_root.live = 3;

//Vegetto has not been hit shortly before

_root.lock = 0;

//reset the score to zero

_root.hit = 0;

//display 3 live symbols at the upper right hand corner

setProperty ("_root.live1", _visible, "1");

setProperty ("_root.live2", _visible, "1");

setProperty ("_root.live3", _visible, "1");

//hide the Game Over screen

setProperty ("_root.over", _alpha, "0");

//reset Vegetto to his original form

tellTarget ("/p1") {

gotoAndStop (1);

}

//enable keyboard detection again



tellTarget ("_root.key") {

gotoAndPlay (1);

}

}



CIS587 Assignment 4 (Fall 2002) Man K. Woo 6/25/2016





Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©atelim.com 2016
rəhbərliyinə müraciət