+ All Categories
Home > Documents > Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly...

Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly...

Date post: 10-Mar-2020
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
21
Fly, DragonFly Technical Design Document Version 011101000111011101101111 (13 March 2012) Team: Benjamin Hugo (HGXBEN001) Brandon Talbot (TLBBRA002) Nathan Floor (FLRNAT001) Marcel Terblanche (TRBMAR009) 1
Transcript
Page 1: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Fly, DragonFlyTechnical Design Document

Version ­ 011101000111011101101111(13 March 2012)

Team: Benjamin Hugo (HGXBEN001) Brandon Talbot (TLBBRA002) Nathan Floor (FLRNAT001) Marcel Terblanche (TRBMAR009)

1

Page 2: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Table of Contents1. Introduction2. Scrolling Background3. Level Design/Generation4. Mobile Game Engine & Tools5. Weapons & Animation6. Game AI

6.1 Spawning6.2 Static object6.3 Frogs6.4 Tongue6.5 Birds6.6 Spiders6.7 Web6.8 Venus Flytrap6.9 Boids flocking model

6.9.1 Basic model6.9.1.1 Cohesion6.9.1.2 Alignment6.9.1.3 Repulsion

6.9.2 Fleeing6.9.3 Spawning6.9.4 Removal

7. Interface7.1 Menu Interface7.2 Game Interface7.3 Scaffolding

8. Achievements9. Assets

9.1 Art Assets9.2 Audio Assets

10. Appendix

2

Page 3: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

1. Introduction

Fly­DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive in thejungle while trying to find a new water source(i.e. Pond). This is detailed more thoroughly in theGames Design Document. The team working on this project will consist of 4 Computer ScienceHonours students. The projects scope will be restricted to creating a 2D scroller game for anAndroid platform, ideally that of a galaxy tablet. We will currently only be committing to setting upone level, with animations for the weapons and enemies. The AI system will focus on controllingthe adversaries which the player will need to overcome. There will also be a flocking modelimplemented to control swarms of insects.

2. Scrolling BackgroundFly­DragonFly is an arcade scroller, based on a survival mentality. Throughout the game, thebackground will be scrolling downwards to simulate the dragonfly flying through the jungle. Wewill be using a tileable background which will be repeated throughout that particular level. Therewill be more on level design described in the next section. The scrolling speed will remainconstant throughout the duration of that particular level. Different levels may have differingscrolling speeds but that speed will then be constant throughout that level. The background willchange for each level, to differentiate between the different levels.

The Scrolling background will be driven by a class, that will draw the tileable textures as manytimes as necessary, 1 above the other. Once the one texture leaves the screen, it will be movedto the top of the currently “Highest” one. It will be moving at a constant speed, that will be savedso that the “Stationary objects” can be moved in the same direction at the same speed.

Code:The code required us to place all the textures (since android has a max texture sze) in ordercorrectly.

Constructor code

3

Page 4: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

public Scroller(Textures [] texs, float speed, float width, float height)

sprites = new Sprite[texs.length];

for (int i = 0; i < text.length)

sprites[i] = new Sprite(texs[i]);

sprites[i].setX = 0;

sprites[i].setWidth = width;

sprites[i].setHeight = height;

_imageHeight = texts[i].height / texts[i].width * width;

sprites[i].setY = i * height; // set the height.

The update method must move them all down and check when one leaves the bottom of thescreen to move it back up

public void update(float delta)

for (Sprite s in sprites)

s.setY(s.getY - delta * speed);

if (s.getY < 0)

s.setY(sprites.length * _spriteHeight);

3. Level Design/Generation

4

Page 5: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

We will be designing our game to incorporate multiple levels. These levels will differ from eachother, both in difficulty as well as appearance. The environment will change a bit too, where theplayer will have to deal with new and different adversaries, in some cases more challenging. Theidea is to get the player hooked in on trying to get a high score while at the same time completingthe current level. So each level will be designed with this in mind.

Each level will be made beforehand and loaded each time. We chose level creation over randomlevel design (where the map is randomly created, or the game is infinitely continuous with only aHigh Score board for players to compete for) since we decided creating a random generator thatwill give the player a challenge as well as giving the player a sense of ending will take too long forthe scope of this game.

Each level will gradually grow more challenging as the player progresses through it. This will beachieved by increasing the number and resilience of the adversaries. It must be noted that therewill be two types of enemies, namely stationary and mobile enemies. Each level will have aseries of stationary enemies throughout the level increasing in number the closer the player getsto the end of the level.

We have decided to use XML to store level designs. The XML document will outline the position,size and any other details regarding each map element. We have implemented a basic mapeditor, with a drag and drop interface where we can easily and quickly design levels andgenerate the xml file. We have used functionality provided by the libGdx library to accomplishthis. Below is a sample xml file for a very basic level design:<?xml version="1.0" encoding="UTF­8"?><map> <obj type="flytrap">

<x>100</x><y>1550</y><width>100</width><height>100</height><rotation>0</rotation>

</obj> <obj type="frog">

<x>150</x><y>2000</y><width>100</width><height>100</height><rotation>0</rotation>

</obj> <moziSpawner type="mosquitoes">

<x>700</x><y>1500</y><numberOfBoids>25</numberOfBoids><deviation>100</deviation>

</moziSpawner>

5

Page 6: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

<tutorialScreen><id>0</id><y>350</y>

</tutorialScreen></map>

4. Mobile Game Engine & ToolsThe LibGDX game engine will be used for the development of this game. It will enable us todevelop and test as we would any other desktop Java program, but it also provides support forAndroid, iOS and HTML, automatically porting the relevant code. This will allow us to quicklydevelop and test our game and then move on to the painstaking process of testing on a mobiledevice. This engine provides support for basic bounding box intersection/collision tests and hasits own basic particle engine, which will prove very useful in cutting down on development timeand effort needed. Which is ideal considering the project's time constraints. LibGDX is an opensource project on Google code.

The libGDX class has allot of features: Can use the TweenEngine (an engine that makes animations easy) Can use BOX 2D physics engine (open source physics engine) Does most of the drawing methods or you. Does the calculation of elapsed time for you. Has a texture loader that automatically does the GL bindings for you.

We will be developing using the Eclipse environment, and all source code will be managed usingversion control system such as svn. For image and audio file manipulation, we will use opensource/free software such as Gimp and NCH Software respectively. We will also use 9 patchesfor certain objects using the Android dev 9 patch editor that comes with the Android SDK. Wewill also be using a Texture packer, which takes many images and places them into a singleimage, with documentation that LibGDX reads to automatically get where in the single image, ourneeded image is.

The game will be designed through a “Modular” fashion. Each object class will control what itdoes within the game, and talk to the game controller. This will allow us to work separately andbring it all together. The game interface is managed from the ‘GameScreen.java’ class. This iswhere the main game screen gets initialised and rendered on a continuous basis. Player input ismanaged by a separate class called, ‘GameInput.java’. The input and rendering processes getmanaged by the libGdx game engine. I have included a class hierarchy of the objects that areused in the game. All objects inherit from the LibGdx ‘Sprite’ class, including the particles.

6

Page 7: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

5. Weapons & AnimationInitially, the player will have one weapon which he/she will be able to change as they play thegame.During the game, the player will come across different entities such as ‘fireflies’ and‘mosquitoes’ which will change the nature of the player’s weapon. If the dragonfly eats morefireflies, the player’s weapon will gain more spread but have less range. While if the dragonflyeats more mosquitoes, the player’s weapons will become narrower but also have a longerrange. This will be accomplished by modifying the velocity of the fire particles to increase ordecrease the range of the dragonfly’s fire breathing. By changing the starting, middle and finalangle of the fire particles we can then vary the spread of the fire.

We are also looking to introducing a second weapon. However this is dependent on timeconstraints. So we have included this in our wish­list. If we find that we have time to include thisinto the scope of our project.

The animations for most of the stationary or mobile adversaries on the level, will be done byusing a sprite atlas to simulate movement. This form of animation is well suited for a 2Denvironment. This will also keep the graphical demands being made on the processor to aminimum. The animations for the weapons will be done by using a particle engine.

7

Page 8: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

In order to do collision detection on the particle engines particles. I had to extends the libGDXparticle editor (not by using the Java extends, but by getting the source code and editing parts).This is since i need to be able to retrieve references of each particle in order to place it into thegrid and retrieve each particles bounding box. We will be unable to do Pixel Perfect collisiondetection on the particles since they are dynamically changing size as they move. This means itwill be very hard to efficiently have the pixel values for each size, especially on a mobile device.

Code:Placing the code for the particle engine is hard.Basically you have to grab the source code for the LibGDX particle engine and edit a few things.In the Activate particle you have to tell the particle that it is alive again (since we use a deadboolean to tell when to delete the object from the array in collision class).In the update method we have to add the Kill() call for the particle when its time is up.We must also place Addobject call to gamescreen when the particle is first created and when itis resurrected. The kill call automatically makes the game remove the object so theres no needto call remove Object.The collision is then handled from the collision class.

6. Game AI

6.1 SpawningA primary spawner class is used for the spawning. The basic logic behind the class is to keeptrack of the distance that the map has scrolled. In the update step each type of abstract datatype object loaded by the map is checked to see if it should be spawned (the global scrollingdistance >= the y position of the object. If this is the case an object is instantiated.The abstract data types are: map object info, boids info and tutorial screen info.

The following extract shows how we did it in greater detail://scroll_y += _scrollSpeed * delta;//spawn objects:for (int i = 0; i < _map.getGameObjects().size(); ++i)

ObjectSpawner os = _map.getGameObjects().get(i);if (os.getY() < _y + GameScreen.height)

if (os.getType() == ObjectSpawner.Type.OS_SPIDER)GameScreen.addObject(new Spider(new Vector2(os.getX(),os.getY()),

os.getWidth(), os.getHeight(),_scrollSpeed, GameScreen.width, GameScreen.height, _player));

else if (os.getType() == ObjectSpawner.Type.OS_BIRD)GameScreen.addObject(new Bird(new Vector2(os.getX(),os.getY()),

os.getWidth(), os.getHeight(), _scrollSpeed, GameScreen.width, GameScreen.height, _player));

else if (os.getType() == ObjectSpawner.Type.OS_VENUSFT)GameScreen.addObject(new VenusFlytrap(

8

Page 9: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

new Vector2(os.getX(),os.getY()), os.getWidth(),os.getHeight(), _scrollSpeed, GameScreen.width,GameScreen.height, _player));

else if (os.getType() == ObjectSpawner.Type.OS_FROG)GameScreen.addObject(new Frog(

new Vector2(os.getX(),os.getY()), os.getWidth(), os.getHeight(),_scrollSpeed, GameScreen.width, GameScreen.height, _player));

_map.getGameObjects().remove(i­­);

//spawn boids spawnpoint for (int i = 0; i < _map.getSpawners().size(); ++i)

MoziSpawner ms = _map.getSpawners().get(i); if (ms.getPos().y < _y + GameScreen.height)

_bm.spawnBoids(50, 50, GameScreen.width, GameScreen.height,ms.numberOfBoids, ms.getPos().x,ms.getDeviation(),ms.getType() == MoziSpawner.SpawnerType.mosquitoes ?

BoidsModel.BoidsType.Mosquitoes : BoidsModel.BoidsType.FireFlies);

_map.getSpawners().remove(i­­);

//spawn tutorial screens for (int i = 0; i < _map.getTutorialScreens().size(); ++i)

TutorialScreenSpawner ts = _map.getTutorialScreens().get(i); if (ts.getY() < _y + GameScreen.height)

_gs.showTutorialScreen(ts.getId()); _map.getTutorialScreens().remove(i­­);

6.2 Static objectThe static objects class which Frog, spider, venus­flytrap, tongue and web extend contains codethat makes the objects move in the same direction as the scrolling background and at the samespeed.The following code is run every update step, from within the static object class.

public void move(float delta)this.translateY(­delta * scrollSpeed);

In the above code, the Parameter delta is the elapsed game time since the last update call.translateY method adds the value to the Position’s y value.

6.3 FrogsThe frog firstly faces the dragonfly (the player) until it fires its tongue.It checks its distance to the frog every update step, and determines when it should fire its

9

Page 10: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

tongue. In order to fire its tongue, it creates a new object “Tongue”, sending it the frogs centerposition, the scroll speed, and the player reference.

public void update(float delta)vector toPlayer = player.pos ­ this.pos; // get the vector to the playerangle = toPlayer.angle; // get the angle of the toPlayer vector

if (notFired) // check if we havent shot our tongue yet.this.setRotation(angle); // set the angle to draw the frog with.

float lengthToPlayer = toPlayer.len(); // get the length of the toPlayer vectorif (lengthToPlayer < fireRange) // check if in range

notFired = false;GameScreen.addObject(new Tongue(this.pos, this.getwidth/4, this.getwidth/4, scrollspeed, player)); //Create and add the tongue //object to the game screen.

6.4 TongueThe tongue object draws the tongue for the frog, and has special collision detection methods forthe tongue. When created many variables are made that are required for later changes:

LengthToTarget = (this.pos - player.pos).len();

angle = (this.pos - player.pos).angle();

Target = this.position + this.direction * this.getheight;; // this is used for the collision

That tells us how long the tongue must extend for.The update method needs to change the objects height dynamically in order to make it look as ifit stretches to the target.

public void update(float delta)

this.setHeight(this.getHeight + reachedMaxLength ? -strechSpeed : stretchSpeed); // stretch out

or in according to speed.

if (this.getHeight() >= lengthToTarget) // if reached max length

reachedMaxLength = true; // start the shrinking (retraction)

if (this.getHeight() <= 0) // if the tongue has come back

this.kill(); // delete the object

// needed for collision

if (grow)

target += this.direction * delta * growRate; // moves the end of the tongu

else

target -= this.direction * delta * growrate;

super.update(delta);

10

Page 11: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Since the tongue can be at any angle, and it is really thin, using a bounding box collisiondetection does not correctly determine the collision.eg.

As you can see, there is allot of white space in the second image, where acollision would have been determined using bounding box collision.

We thus had to do a line intersection test to make it work perfectly:Code:public boolean doCollision(Rect targetBoundingBox)

double a_rectangleMinX = targetBoundingBox.x;

double a_rectangleMinY = targetBoundingBox.y;

double a_rectangleMaxX = targetBoundingBox.x + targetBoundingBox.width;

double a_rectangleMaxY = targetBoundingBox.y + targetBoundingBox.height;

double a_p1x = this.getPosition().x;

double a_p1y = this.getPosition().y;

double a_p2x = target.x;

double a_p2y = target.y;

double minX = a_p1x;

double maxX = a_p2x;

if (a_p1x > a_p2x)

minX = a_p2x; maxX = a_p1x;

// Find the intersection of the segment's and rectangle's x-projections

if (maxX > a_rectangleMaxX)

maxX = a_rectangleMaxX;

if (minX < a_rectangleMinX)

minX = a_rectangleMinX;

if (minX > maxX) // If their projections do not intersect return false

return false;

// Find corresponding min and max Y for min and max X we found before

double minY = a_p1y; double maxY = a_p2y; double dx = a_p2x - a_p1x;

if (Math.abs(dx) > 0.0000001)

double a = (a_p2y - a_p1y) / dx;

double b = a_p1y - a * a_p1x;

minY = a * minX + b;

11

Page 12: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

maxY = a * maxX + b;

if (minY > maxY)

double tmp = maxY;

maxY = minY;

minY = tmp;

// Find the intersection of the segment's and rectangle's y-projections

if (maxY > a_rectangleMaxY)

maxY = a_rectangleMaxY;

if (minY < a_rectangleMinY)

minY = a_rectangleMinY;

if (minY > maxY) // If Y-projections do not intersect return false

return false;

return true;

6.5 BirdsThe birds object is very simple.It does not extend the Static object class and so has nothing in its move method.All the bird object does is:Start a countdown when spawned on when to attack (This allows it to pop out the side of thescreen at random locations and not just the top where the spawner spawns it)

Countdown = Random.nextInt(5);

In the update method we have many things. If it shouldn’t attack yet, just move down, and countdown to attack.When it should attack, calculate direction to player and start moving.And kill itself when it leaves the screen.

public void update(float delta)

if (countdown <=0)

if (direc == null) // if no direction

direc = (player.pos - this.pos).nor(); // calculate direction

this.position += direc * speed * delta; // move towards chosen target

else

countdown -= delta; // countdown

this.translateY(-speed * delta); // moves down the side of the screen

12

Page 13: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

if (this.getY() < 0)

this.kill();

6.6 SpidersThe spider is pretty simple.It extends static Object and thus moves down at scrolling speed already.All it needs to do is keep track of distance to player and spawn a web when the player gets near.

public void update (float delta)

float distance = (player.pos - this.pos).len(); // calc distance to player

if (distance < rangeToFire) // if in range

if (! alreadyFired) // if not fired

alreadyFired = true; // set fired already

GameScreen.addObject(new Web(this.pos, 0,0, screenWidth,

screenHeight,scrollspeed,player)); // spawn web

6.7 WebThe web need only increase in size until it has reached the side of the screen.It extends the static object class, and thus already moved down at the scroll speed.The rest is done from the collision detection.

public void update (float delta)

if (this.getWidth < screenWidth - this.getX) // if not across the screen

this.getwidth += growRate * delta; // grow width

this.getHeight += delta * growRate; // grow height to keep ratios correct

6.8 Venus FlytrapThe venus flytrap extends the static class and thus already moves down at the scroll speed.It must draw its particles, and it must “Suck” the player towards it when the player is closeenough.

public void update(float delta)

float length = (player.pos - this.pos).len();

if (lenght < attackRadius)

Vector2 direction = (player.pos - this.pos).nor();

player.pos += direction * delta * suckSpeed;

13

Page 14: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

public void Draw(spritebatch batch)

particles.draw(batch);

super.Draw(batch);

6.9 Boids flocking modelAs discussed in the GDD, the mosquitoes and fireflies will exhibit flocking be­haviour. This is achieved through our own implementation of the boids model,which also exhibits basic fleeing behaviour.

6.9.1 Basic modelThe 3 basic operations are performed for every agent in the model is cohesion,alignment and repulsion. Lets assume for the sake of explanation vE is an arrayof boids with length L.Each boid has a position vertex, p and velocity vector v where p, v ∈ R2 .It is also important to note that each one of the operations uses the propertiesof neighbouring agents to compute the required information. This fact impliesthat the algorithm is in O(n2 ). We of course improve the average runtime byusing a spatial grid.

6.9.1.1 CohesionThe cohesive property controls how agents flock together. Each agent will flocktowards the average position of the agents in its neighbourhood (lets call thisradius Rc ). The pseudo code for the basic algorithm (without the grid) is asfollows:BEGINFOR i = 0..L­2 DO FOR j = i + 1..L­1 DO if distSq(vE[i].p ­ vE[j].p) < Rc THEN meanPos += vE[j].p

14

Page 15: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

count++ vE[i].v += (meanPos / count) ­ vE[i].pEND

6.9.1.2 AlignmentThe alignment property controls how the agents steer and align themselvesin the flock. In the most basic terms each agent steers towards the averagedirection of its neighbouring agents (lets call the neighbourhood radius Ra thistime). Excluding the grid the basic algorithm is as follows:

BEGINFOR i = 0..L­2 DO FOR j = i + 1..L­1 DO if distSq(vE[i].p ­ vE[j].p) < Ra THEN meanVel += vE[j].v count++ vE[i].v += normalize(meanVel / count)END

6.9.1.3 RepulsionThe repulsion algorithm is slightly more complicated. When boids come in closeproximity they repel one another (call the neighbourhood radius Rr ). We remindthe reader that the operation vi − vj gives the directional vector from vj tovi where vi , vj ∈ R2 are two points. Assume the intensity of the repulsion isdenoted by I. Then I ∝ ||V Em .p − V En .p||−1 . Taking this into considerationthe algorithm goes as follows (excluding the grid):BEGINFOR i = 0..L­2 DO FOR j = i + 1..L­1 DO if distSq(vE[i].p ­ vE[j].p) < Rr THEN meanVel += normalize(vE[j].p ­ vE[j].p) / dist(vE[i].p ­ vE[j].p) count++ vE[i].v += meanVel / countEND

6.9.2 FleeingThe fleeing algorithm is very simple, and is given a point p ∈ R2 and an acti­vation radius rf as input. An intensity scalar, sF is added to the equation toadjust the speed at which the boids flee from them specified area.BEGIN

15

Page 16: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

FOREACH b in vE DOif distSq(b.p ­ p) < Rf*Rf THENb.v ­= normalize(p ­ b.p)*sF;END

6.9.3 SpawningThe boids are spawned off screen at the top and will be initialized with a down­wards velocity. They will cluster together automatically due to cohesion.

6.9.4 RemovalWhen the boids leave the screen area (plus a buffer) they are removed from themodel. This ensures that the limited processing power of the target device isnot exhausted after prolonged spawning.

7. Interface

7.1 Menu InterfaceThe Menus will be made using the LibGDX Stage class. This allows stages to be createdand drawn when necessary. This allows for easy placement of pause menus and thechanging of screens from main menu to options etc. No android programming will beplaced into the game code structure, to facilitate porting to IOS, PC and HTML. The menuwill only have 4 options, to start a new game, high scores, options and and an exit option.Currently, due to time constraints we will only be giving players the option to turn in­gamesound on or off. The high scores view will display a list of the top 10 scores achieved onthe device being played on.

16

Page 17: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

7.2 Game InterfaceThe gaming interface is kept basic as to keep the learning curve low, while keeping thefun factor high. The game will be played within a Portrait view of the mobile device. Thisis to keep the height of the screen larger than its width, since that is how the gamesresolution is set in its camera. The player moves his “character” around by pressinganywhere on the screen that is not indicated as a button. A shoot button will be placed inthe Bottom left corner of the screen, and will be made obvious to the user through thescaffolding of the game. Along the top of the screen the user will find his “Mana” count forhis weapon. His life counter, and his current points score.

7.3 ScaffoldingWhen the player first meets a “new” element when playing the game. The game willdisplay an image while pausing the game. This image will explain to the user what theelement does, and what the user should try to do with/to it. Once the player closes theimage, the game will un­pause and continue from there. More in the GDD.

17

Page 18: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

The pop up dialogs are simply images drawn onto the screen. The ‘ok’ button is simplyan image, where there is a check for when the player taps on that area on the screenwhile the dialog is open. The images and tutorial text, are all drawn using libGdx methods.

8. AchievementsFly­DragonFly will have a few different ways in which the player can experience the feeling ofsuccess and satisfaction through various different achievements. The primary objective of thisgame is to get the highest score in terms of points. But there will also be a secondary objective,which is to successfully complete the level. The incentive for this is that there will be a very bigpoint bonus awarded for achieving this.

There will be a rating system for players according their score, outlined as follows:

Level Achievement Name Description

1Nymph Player has to survive at least 2 traps/enemies.

Wanna­bee Player has to survive 5 traps/enemies.

Wild­Fly Player has to survive 7 traps/enemies and killat least 2 enemies.

1 http://www.elizabethbackman.com/how­did­you­fair­in­my­quiz/goldstar/

18

Page 19: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Scavenger Player has to survive 15 traps/enemies andkill 7 enemies.

Predator There can only be one at the top of the foodchain. Top score and fastest finishing time.

Stars will be awarded based on the player’s score and progress throughout the level. Playersand earn stars even if they fail to complete the level. Each time the player starts a new game, theresulting score will be saved and added to the Hall­of­Fame high score list. only the top tenscores will saved on a continuous basis.

Players will be able to earn new lives by earning points for eating flies and mosquitoes and killingenemies. Due to time constraints, we have decided to automate this process, automaticallyawarding the player with a new life for every 1000 points they manage to accumulate through thelevel. There will be a maximum of 4 lives that the user can have. A new life is meant to be hard toget, taking around 1000 points to earn a new one.

9. Assets

9.1 Art AssetsFly­Dragonfly is currently being optimised for the Samsung Galaxy Tab series at a resolution of800 pixels wide by 1280 pixels long (game will be played in portrait mode). Below is a list of artassets and their dimensions in pixels. All assets are in PNG format. Assets in red are still to beconfirmed. All animations will run at 8 frames per second.

Resource type Dimensions (width x height) Number of versions

Background jungle 800 x 3840 (seamless top and bottom for scrolling) 2

Spider 90x90 1

Frog 130x130 1

Bird 100x120 2

Venus flytrap 100x100 2

Dragonfly 80x80 5

Shoot button 64x64 1

Menu background 450x450 1

Menu button 400x64 1

Life icons 35x35 1

19

Page 20: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Score icon 35x35 1

Mosquito 8x8 1

Firefly 8x8 1

Crystal 90x90 3

Crystal dust 8x8 1

Flower 90x90 1

Flower Pollen 8x8 1

Spider web 120x120 1

Frog tongue 20x400 1

9.2 Audio AssetsBackground music and jungle atmosphere will be produced and provided by Pierre Terblanche(Eartheart). The genre of music is African Percussion, with animal and insect sounds, fitting ourjungle theme. The file format will be .wav. Visit http://eartheart.bandcamp.com/album/intuit tohear Pierre Terblanche’s latest CD (intuit), from which we will use some sound segments for thegame. Pierre Terblanche will also provide bird sounds, insect sounds and animal sounds.Resource in red still to be confirmed.

Resource Type Duration (in seconds)

Background music/ambient jungle sounds 60 ­ loop

Bird sound 0.5 ­ 1

Spider shuffle 1

Frog croak 1 ­ 1.5

Frog tongue 1.5

Dragonfly flames as long as user presses fire button

Venus flytrap 0.5 ­ 1

Dragonfly eating 0.5 ­ 1.5

Dragonfly dying 1 ­ 2.5

Life pickup 0.5 ­ 1

Speed boost 0.5

Mosquitoes and fireflys 0.5 ­ 2.5

Tiger growl (for atmosphere purposes) 1 ­ 2.5

20

Page 21: Fly, DragonFly - University of Cape Townbhugo/FlyDragonFly/TDD_MDev.pdf1. Introduction Fly DragonFly is an arcade vertical scroller. The player will be a dragonfly trying to survive

Dragonfly wings (might be a bit anoying) continuous loop

10. AppendixlibGDX ­ libgdx.badlogicgames.com/Audio designer website ­ http://eartheart.bandcamp.com/album/intuit

21


Recommended