···3636 <haxelib name="flixel" />
37373838 <!--In case you want to use the addons package-->
3939- <!--<haxelib name="flixel-addons" />-->
3939+ <haxelib name="flixel-addons" />
40404141 <!--In case you want to use the ui package-->
4242 <!--<haxelib name="flixel-ui"/>-->
···1212 */
1313class Bullet extends FlxSprite
1414{
1515-1616- private var speed:Float;
1717- private var dir:Int;
1818- private var damage:Float;
1515+ private var life:Float = 3;
1616+ public var speed:Float;
1717+ public var dir:Int;
1818+ public var damage:Float;
19192020 public function new(?X:Float=0, ?Y:Float=0, Speed:Float, Direction:Int, Damage:Float)
2121 {
···4141 if (dir == FlxObject.RIGHT)
4242 {
4343 velocity.x = speed;
4444+ }
4545+4646+ life -= FlxG.elapsed;
4747+ if (life < 0)
4848+ {
4949+ kill();
4450 }
45514652 }
+28-6
source/PlayState.hx
···2233import flixel.FlxCamera.FlxCameraFollowStyle;
44import flixel.FlxG;
55+import flixel.FlxObject;
56import flixel.FlxSprite;
67import flixel.FlxState;
88+import flixel.addons.editors.ogmo.FlxOgmoLoader;
79import flixel.group.FlxGroup.FlxTypedGroup;
810import flixel.text.FlxText;
1111+import flixel.tile.FlxTilemap;
912import flixel.ui.FlxButton;
1013import flixel.math.FlxMath;
1114import flixel.util.FlxColor;
···1316class PlayState extends FlxState
1417{
1518 private var _player:Player;
1919+ private var playerBullets:FlxTypedGroup<Bullet>;
2020+1621 private var _enemy:Enemy;
17221818- private var playerBullets:FlxTypedGroup<Bullet>;
2323+ private var _map:FlxOgmoLoader;
2424+ private var _mWalls:FlxTilemap;
2525+2626+ private var _grpPeople:FlxTypedGroup<FlxSprite>;
19272028 override public function create():Void
2129 {
2230 FlxG.camera.bgColor = FlxColor.GRAY;
23313232+ _map = new FlxOgmoLoader(AssetPaths.level1__oel);
3333+ _mWalls = _map.loadTilemap(AssetPaths.tiles__png, 32, 32, "Floors");
3434+ _mWalls.setTileProperties(1, FlxObject.ANY);
3535+ add(_mWalls);
3636+3737+ _grpPeople = new FlxTypedGroup<FlxSprite>();
3838+ add(_grpPeople);
3939+2440 playerBullets = new FlxTypedGroup<Bullet>();
2541 add(playerBullets);
26422743 _player = new Player(20, 300, playerBullets);
2828- add(_player);
4444+ _grpPeople.add(_player);
29453046 _enemy = new Enemy(400, 300);
3131- add(_enemy);
3232-4747+ _grpPeople.add(_enemy);
334834493550 var barHeight:Float = 50;
···44594560 FlxG.camera.follow(_player, FlxCameraFollowStyle.SCREEN_BY_SCREEN, 0.25);
46616262+ _grpPeople.forEach(initPeople);
6363+4764 super.create();
4865 }
6666+6767+ private function initPeople(p:FlxSprite):Void
6868+ {
6969+ p.acceleration.y = 600;
7070+ }
49715072 override public function update(elapsed:Float):Void
5173 {
···61836284 playerBullets.forEachAlive(collisionCheck);
63856464-8686+ FlxG.collide(_grpPeople, _mWalls);
6587 }
66886789 private function collisionCheck(b:Bullet):Void
6890 {
6969- if (FlxG.overlap(b, _enemy))
9191+ if (FlxG.overlap(b, _enemy) && _enemy.color != FlxColor.WHITE)
7092 {
7193 _enemy.hit();
7294 _enemy.x += b.velocity.x * FlxG.random.float(0.001, 0.01);
+24-3
source/Player.hx
···2020 public var xPos:Float = 0;
21212222 private var knockBack:Float = 3;
2323+2424+ private var accel:Float = 3000;
2525+23262427 public function new(?X:Float=0, ?Y:Float=0, playerBulletArray:FlxTypedGroup<Bullet>)
2528 {
···3033 drag.x = 1400;
31343235 bulletArray = playerBulletArray;
3333-3436 }
35373638 override public function update(elapsed:Float):Void
···4648 {
4749 var _left:Bool = FlxG.keys.anyPressed([A, LEFT]);
4850 var _right:Bool = FlxG.keys.anyPressed([D, RIGHT]);
5151+ var _upP:Bool = FlxG.keys.anyJustPressed([W, UP]);
5252+5353+ var _shift:Bool = FlxG.keys.anyPressed([SHIFT, X]);
5454+5555+ var canJump:Bool = isTouching(FlxObject.FLOOR);
5656+5757+ if (_shift)
5858+ {
5959+ maxVelocity.x = 450;
6060+ }
6161+ else
6262+ {
6363+ maxVelocity.x = 300;
6464+ }
49655066 if (_left && _right)
5167 {
5268 _left = _right = false;
5369 }
54707171+ if (_upP && canJump)
7272+ {
7373+ velocity.y -= 300;
7474+ }
7575+5576 acceleration.x = 0;
56775778 if (_left || _right)
5879 {
5959- var accel:Float = 3000;
8080+6081 if (_left)
6182 {
6283 acceleration.x = -accel;
···103124 throw("OOPSIE WOOPSIE!! Uwu We madea fucky wucky!! A wittle fucko boingo! The code monkeys at our headquarters are working VEWY HAWD to fix this!");
104125 }
105126106106- var newBullet = new Bullet(xPos, y + 32, 800, facing, 10);
127127+ var newBullet = new Bullet(xPos, y + 32, 1600, facing, 10);
107128 bulletArray.add(newBullet);
108129109130 }
+3-1
source/designDoc.txt
designDoc.txt
···1010its really about individuality and trying to make everyone the same as you
11111212if you do something, likle overlap with them, they start talking to you, and if you shoot them, they run away.
1313-It's almost like a circle jerk, so when you get to the part with all the different colors its a contrast of ideas and opinions.1313+It's almost like a circle jerk, so when you get to the part with all the different colors its a contrast of ideas and opinions.
1414+1515+a segment where the player goes through a boring section where they all say the same thing