Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
432 additions
and
119 deletions.
There are no files selected for viewing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package common | ||
{ | ||
import common.config.SoldierConfig; | ||
import logic.soldier.BaseSoldier; | ||
import logic.soldier.KnightRobo; | ||
/** | ||
* ... | ||
* @author ... | ||
*/ | ||
public class Config | ||
{ | ||
private static var _instance:Config; | ||
|
||
private var soldierConfig:Array; | ||
|
||
public function Config() | ||
{ | ||
soldierConfig = new Array(); | ||
|
||
var knightRoboConfig:SoldierConfig = new SoldierConfig(); | ||
knightRoboConfig.id = BaseSoldier.SOLDIER_KNIGHT_ROBO_ID; | ||
knightRoboConfig.sizeWidth = 1; | ||
knightRoboConfig.sizeHeight = 1; | ||
knightRoboConfig.baseHealth = 100; | ||
knightRoboConfig.damage = 25; | ||
knightRoboConfig.moveSpeed = 1; // px per frame | ||
knightRoboConfig.attackSpeed = 25; // frame per hit | ||
knightRoboConfig.attackRange = 0; // attack range in pixels | ||
knightRoboConfig.rowAttack = 1; | ||
soldierConfig[knightRoboConfig.id] = knightRoboConfig; | ||
|
||
var knightLanceConfig:SoldierConfig = new SoldierConfig(); | ||
knightLanceConfig.id = BaseSoldier.SOLDIER_KNIGHT_LANCE_ID; | ||
knightLanceConfig.sizeWidth = 2; | ||
knightLanceConfig.sizeHeight = 1; | ||
knightLanceConfig.baseHealth = 200; | ||
knightLanceConfig.damage = 40; | ||
knightLanceConfig.moveSpeed = 1; // px per frame | ||
knightLanceConfig.attackSpeed = 25; // frame per hit | ||
knightLanceConfig.attackRange = 0; // attack range in pixels | ||
knightLanceConfig.rowAttack = 2; // number of unit can attack in a row | ||
soldierConfig[knightLanceConfig.id] = knightLanceConfig; | ||
|
||
var bossStrengthConfig:SoldierConfig = new SoldierConfig(); | ||
bossStrengthConfig.id = BaseSoldier.SOLDIER_BOSS_STRENGTH_ID; | ||
bossStrengthConfig.sizeWidth = 2; | ||
bossStrengthConfig.sizeHeight = 2; | ||
bossStrengthConfig.baseHealth = 1000; | ||
bossStrengthConfig.damage = 20; | ||
bossStrengthConfig.moveSpeed = 1; // px per frame | ||
bossStrengthConfig.attackSpeed = 25; // frame per hit | ||
bossStrengthConfig.attackRange = 0; // attack range in pixels | ||
bossStrengthConfig.rowAttack = 1; // number of unit can attack in a row | ||
soldierConfig[bossStrengthConfig.id] = bossStrengthConfig; | ||
} | ||
|
||
public static function instance():Config | ||
{ | ||
if (_instance == null) _instance = new Config(); | ||
return _instance; | ||
} | ||
|
||
public function getConfig(soldierId:int):SoldierConfig | ||
{ | ||
return soldierConfig[soldierId] as SoldierConfig; | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package common.config | ||
{ | ||
/** | ||
* ... | ||
* @author ... | ||
*/ | ||
public class SoldierConfig | ||
{ | ||
public var id:int; | ||
public var sizeWidth:int; | ||
public var sizeHeight:int; | ||
public var baseHealth:int; | ||
public var damage:int; | ||
public var moveSpeed:int; | ||
public var attackSpeed:int; | ||
public var attackRange:int; | ||
public var rowAttack:int; | ||
|
||
public function SoldierConfig() | ||
{ | ||
|
||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.