Skip to content

Damage Tree

jianping edited this page Oct 22, 2017 · 5 revisions

Overview

The DamageTree class extends AbstractTree implements Tickale and add functinality for projectile Tree objects.

Properties

A damage Tree Type for diff trees

private Damage damageTreeType;

A ice tree animation texture list that contain animation per frame

private static final List<TreeStatistics> ICE_TREE_STATS

A acorn tree animation texture list that contain animation per frame

private static final List<TreeStatistics> ACORN_TREE_STATS

A lightning tree animation texture list that contain animation per frame

private static final List<TreeStatistics> LIGHTNING_TREE_STATS

A fire tree animation texture list that contain animation per frame

private static final List<TreeStatistics> FIRE_TREE_STATS

Methods

The details of the method are described below

construction of damage tree

There are three constructors for initializing a damage tree: 1.Initialize a damage tree without texture at a specified coordinate.By default texture,the ```lightningTree`` will be constructed

DamageTree damagetree=new DamageTree(float posX, float posY, float posZ)

2.Initialize a damage tree with specified texture at a specified coordinate.The other properties will be set to default value

DamageTree damagetree=new DamageTree(float posX, float posY, float posZ, Damage texture)

3.Initialize a damage tree with specified texture at a specified coordinate.MaxHealth and demage properties will be set to a damage tree

DamageTree damagetree=new DamageTree(float posX, float posY, float posZ, Damage texture, float maxHealth,float demage)

The damage tree type

There is getter method for getting the damage tree type.The function can be activated by:

Damage getDemageTreeType()

How to use it

build an attack tree

You can new a damage tree in specific position with null texture and it will create default damage tree

new DamageTree(16, 11, 0)

or new a damage tree with specific position and texture.The texture is object that indicate which type of damage tree

new DamageTree(16, 11, 0,new IceTree())

The attribute of damage tree allow be added as well.

new DamageTree(16, 11, 0,new IceTree(),1000,10)
//10000 is max health
//10 is the demage

Animation

There is a status Hashmap that contain the tree status

static {

        status.put("ice_tree","ice_tree-normal");
        status.put("acorn_tree1","acorn_tree1-normal");
        status.put("lightning_tree1","lightning_tree1-normal");
        status.put("fire_tree","fire_tree-normal");
        status.put("cactusTree", "cactusTree-normal");
        status.put("coralTree", "coralTree-normal");
}

if you want to test tree diff tree state animation ,just please change the string after "-". For example

static {
       //set acorn tree animation to death
        status.put("ice_tree","ice_tree-normal");
        status.put("acorn_tree1","acorn_tree1-death");
        status.put("lightning_tree1","lightning_tree1-normal");
        status.put("fire_tree","fire_tree-normal");
        status.put("cactusTree", "cactusTree-normal");
        status.put("coralTree", "coralTree-normal");
}

Gameplay

Design

Asset Creation

User Testing

Code Guidelines


http://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gifhttp://cultofthepartyparrot.com/parrots/partyparrot.gif

Clone this wiki locally