210 likes | 413 Views
90 minutes + Flixel 1 game. Will Emigh Studio Cypher www.studiocypher.com. Flixel. Actionscript library/engine Main page http://flixel.org General help http://flixel.org/forums/index.php?topic=6 Docs http://www.ivansafrin.com/nanodoc/flixel/. Flixel. created by Adam Atomic
E N D
90 minutes+ Flixel1 game Will Emigh Studio Cypher www.studiocypher.com
Flixel Actionscript library/engine Main page http://flixel.org General help http://flixel.org/forums/index.php?topic=6 Docs http://www.ivansafrin.com/nanodoc/flixel/
Flixel • created by Adam Atomic • demo game (“Mode”) included • platformer physics
Flixel Classes • FlxArray • FlxBlock • FlxButton • FlxCore • FlxEmitter • FlxG • FlxGame • FlxLayer • FlxSprite • FlxState • FlxText • FlxTilemap
Flixel Classes • FlxArray • FlxBlock • FlxButton • FlxCore • FlxEmitter • FlxG • FlxGame • FlxLayer • FlxSprite • FlxState • FlxText • FlxTilemap
Our Classes • DirtAttackers • MenuState • PlayState • Player • Enemy • Shot • DirtBlock
DirtAttackers package { import com.adamatomic.flixel.*; import com.sc.dirtattackers.*; public class DirtAttackers extends FlxGame{ public function DirtAttackers(){ super(420, 420, MenuState, 1, 0xff000000, false, 0xffffffff); } } }
MenuState • extends FlxState • public function MenuState • override public function update • private function onFade
MenuState() public function MenuState(): void { super(); vartitle:FlxText = new FlxText(0, 30, FlxG.width, 30, "Dirt Attackers", 0xffffffff, null, 16,"center"); this.add(title) as FlxText; }
MenuState – update() public function update(): void { if (FlxG.kA) { FlxG.flash(0xffffffff, 0.75); FlxG.quake(0.05); FlxG.fade(0xff000000, 0.75, onFade); } super.update(); }
MenuState – onFade() private function onFade(): void { FlxG.switchState(PlayState); }
Player • extends FlxSprite • public function Player • override public function update
Enemy • extends FlxSprite • public function Enemy • override public function update • public function reverse
Shot • extends FlxSprite • public function Shot • override public function update • override public function hitWall • override public function hitCeiling • override public function hitFloor
DirtBlock • extends FlxSprite • public function DirtBlock • override public function update • public function destroy
PlayState • extends FlxState • public function PlayState • override public function update • private function onFade • private function reverseEnemy • private function spawnEnemies • private function killEnemy • private function killDirt • private function stopDirt • private function shotHitPlayer • private function endGame
Tasks • get Player to move • add boundaries • add player shooting • add enemy • add enemy shooting • add enemy death/scoring • add dirt • add end game • add high score • add dirt emitter
The Future • Download my version: • www.studiocypher.com/dirt_attackers • slides too • Make Dirt Attackers your own • Contact me with questions/comments/links to your Dirt Attackers • Will Emigh • will@studiocypher.com