this repo has no description

fixing for whites only in progress

+172 -234
assets/data/tiles.png

This is a binary file and will not be displayed.

+13 -14
source/Bullet.hx
··· 11 11 * ... 12 12 * @author ninjaMuffin 13 13 */ 14 - class Bullet extends FlxSprite 14 + class Bullet extends FlxSprite 15 15 { 16 16 private var life:Float = 3; 17 + 17 18 public var speed:Float; 18 19 public var dir:Int; 19 20 public var damage:Float; 20 - 21 - public function new(?X:Float=0, ?Y:Float=0, Speed:Float, Direction:Int, Damage:Float) 21 + 22 + public function new(?X:Float = 0, ?Y:Float = 0, Speed:Float, Direction:Int, Damage:Float) 22 23 { 23 24 super(X, Y); 24 - 25 - makeGraphic(32, 20, FlxColor.BLACK); 26 - 25 + 26 + makeGraphic(32, 20); 27 + 27 28 speed = Speed; 28 29 dir = Direction; 29 30 damage = Damage; 30 - 31 + 31 32 velocity.y = FlxG.random.float(-25, 25); 32 33 } 33 - 34 - override public function update(elapsed:Float):Void 34 + 35 + override public function update(elapsed:Float):Void 35 36 { 36 37 super.update(elapsed); 37 - 38 + 38 39 if (dir == FlxObject.LEFT) 39 40 { 40 41 velocity.x = -speed; ··· 43 44 { 44 45 velocity.x = speed; 45 46 } 46 - 47 + 47 48 life -= FlxG.elapsed; 48 49 if (life < 0) 49 50 { 50 51 kill(); 51 52 } 52 - 53 53 } 54 - 55 - } 54 + }
+46 -59
source/Enemy.hx
··· 14 14 class Enemy extends FlxSprite 15 15 { 16 16 private var bulletArray:FlxTypedGroup<Bullet>; 17 + 17 18 public var justShot:Bool = false; 19 + 18 20 private var rateOfFire:Int = 6; 19 21 private var fireCoutner:Int = 0; 22 + 20 23 public var xPos:Float = 0; 21 - 24 + 22 25 private var knockBack:Float = 3; 23 - 24 - 26 + 25 27 private var whiteNess:Float = 0; 28 + 26 29 public var justThought:Bool = false; 30 + 27 31 private var thoughtTimer:Float = 4; 28 - 32 + 29 33 public var rndDistance:Int = FlxG.random.int(16, 90); 30 34 public var rndAccel:Float = FlxG.random.float(400, 850); 31 35 public var rndDrag:Float = FlxG.random.float(900, 1800); 32 - 36 + 33 37 public var canJump:Bool = false; 34 - 38 + 35 39 public var finalSection:Bool = false; 36 - 37 - public static var colorArray:Array<Int> = 38 - [ 39 - 0xFFFF67B0, 40 - 0xFFFF7D67, 41 - 0xFFFFF067, 42 - 0xFFC6FF67, 43 - 0xFF67EAFF, 44 - 0xFF679AFF 45 - ]; 46 - 47 - public function new(?X:Float=0, ?Y:Float=0, enemyBulletArray:FlxTypedGroup<Bullet>) 40 + 41 + public static var colorArray:Array<Int> = [0xFFFF67B0, 0xFFFF7D67, 0xFFFFF067, 0xFFC6FF67, 0xFF67EAFF, 0xFF679AFF]; 42 + 43 + public function new(?X:Float = 0, ?Y:Float = 0, enemyBulletArray:FlxTypedGroup<Bullet>) 48 44 { 49 45 super(X, Y); 50 46 makeGraphic(64, 64); 51 - color = FlxColor.WHITE; 47 + color = FlxColor.BLACK; 52 48 drag.x = rndDrag; 53 49 maxVelocity.x = FlxG.random.float(240, 300); 54 - 50 + 55 51 bulletArray = enemyBulletArray; 56 52 } 57 - 58 - override public function update(elapsed:Float):Void 53 + 54 + override public function update(elapsed:Float):Void 59 55 { 60 56 super.update(elapsed); 61 - 57 + 62 58 if (y >= 1800 && !finalSection) 63 59 { 64 60 finalSection = true; 65 - 61 + 66 62 makeGraphic(FlxG.random.int(30, 130), FlxG.random.int(30, 130)); 67 63 updateHitbox(); 68 - 64 + 69 65 color = FlxG.random.getObject(colorArray); 70 - 66 + 71 67 drag.x *= 0.1; 72 68 } 73 - 74 - 69 + 75 70 canJump = isTouching(FlxObject.FLOOR); 76 - 71 + 77 72 if (velocity.x > 0) 78 73 { 79 74 facing = FlxObject.RIGHT; ··· 82 77 { 83 78 facing = FlxObject.LEFT; 84 79 } 85 - 80 + 86 81 if (!finalSection) 87 82 { 88 83 whiteCheck(); 89 84 } 90 - 91 - 85 + 92 86 if (finalSection) 93 87 { 94 88 movement(); 95 89 } 96 - 90 + 97 91 if (justThought) 98 92 { 99 93 thoughtTimer -= FlxG.elapsed; ··· 103 97 thoughtTimer = 4; 104 98 } 105 99 } 106 - 107 - if (color == FlxColor.BLACK && !finalSection) 100 + 101 + if (color == FlxColor.WHITE && !finalSection) 108 102 { 109 103 shooting(); 110 104 } 111 - 112 105 } 113 - 106 + 114 107 private var idleTmr:Float = 3; 115 - 108 + 116 109 private function movement():Void 117 110 { 118 111 if (idleTmr <= 0) ··· 123 116 } 124 117 else 125 118 { 126 - velocity.x = FlxG.random.float( -rndAccel, rndAccel); 127 - 119 + velocity.x = FlxG.random.float(-rndAccel, rndAccel); 128 120 } 129 - 121 + 130 122 idleTmr = FlxG.random.float(1, 4); 131 - 132 123 } 133 124 else 134 125 { 135 126 idleTmr -= FlxG.elapsed; 136 127 } 137 128 } 138 - 129 + 139 130 private function shooting():Void 140 131 { 141 - 142 132 justShot = false; 143 133 if (FlxG.keys.pressed.SPACE) 144 134 { ··· 149 139 { 150 140 FlxG.sound.play("assets/sounds/bullet" + FlxG.random.int(1, 3) + ".ogg", 0.5); 151 141 } 152 - 142 + 153 143 fireCoutner = 0; 154 144 attack(); 155 145 justShot = true; 156 146 } 157 147 } 158 148 } 159 - 149 + 160 150 private function attack():Void 161 151 { 162 - switch (facing) 152 + switch (facing) 163 153 { 164 154 case FlxObject.RIGHT: 165 155 xPos = x + 54; ··· 170 160 default: 171 161 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!"); 172 162 } 173 - 163 + 174 164 var newBullet = new Bullet(xPos, y + 32, 1600, facing, 10); 175 165 bulletArray.add(newBullet); 176 - 177 166 } 178 - 179 - 167 + 180 168 public function hit():Void 181 169 { 182 170 whiteNess += FlxG.random.float(0, 0.2); ··· 186 174 { 187 175 if (whiteNess > 1) 188 176 { 189 - color = FlxColor.BLACK; 177 + color = FlxColor.WHITE; 190 178 } 191 179 else if (whiteNess > 0.9) 192 180 { 193 - color = 0xFF101010; 181 + color = 0xFFBBBBBB; 194 182 } 195 183 else if (whiteNess > 0.8) 196 184 { 197 - color = 0xFF333333; 185 + color = 0xFF999999; 198 186 } 199 187 else if (whiteNess > 0.6) 200 188 { ··· 202 190 } 203 191 else if (whiteNess > 0.4) 204 192 { 205 - color = 0xFF999999; 193 + color = 0xFF333333; 206 194 } 207 195 else if (whiteNess > 0.2) 208 196 { 209 - color = 0xFFBBBBBB; 210 - } 197 + color = 0xFF101010; 198 + } 211 199 } 212 - 213 - } 200 + }
+76 -121
source/PlayState.hx
··· 7 7 import flixel.FlxState; 8 8 import flixel.addons.editors.ogmo.FlxOgmoLoader; 9 9 import flixel.group.FlxGroup.FlxTypedGroup; 10 + import flixel.math.FlxMath; 10 11 import flixel.math.FlxRect; 11 12 import flixel.text.FlxText; 12 13 import flixel.tile.FlxTilemap; 13 14 import flixel.tweens.FlxEase; 14 15 import flixel.tweens.FlxTween; 15 16 import flixel.ui.FlxButton; 16 - import flixel.math.FlxMath; 17 17 import flixel.util.FlxColor; 18 18 19 19 class PlayState extends FlxState 20 20 { 21 21 private var _player:Player; 22 22 private var playerBullets:FlxTypedGroup<Bullet>; 23 - 23 + 24 24 private var _enemy:Enemy; 25 25 private var _enemyThoughts:FlxTypedGroup<Thoughts>; 26 - 26 + 27 27 private var _map:FlxOgmoLoader; 28 28 private var _mWalls:FlxTilemap; 29 - 29 + 30 30 private var _grpPeople:FlxTypedGroup<FlxSprite>; 31 31 private var _grpEnemies:FlxTypedGroup<Enemy>; 32 32 private var _grpText:FlxTypedGroup<FlxText>; 33 - 33 + 34 34 private var wasdTxt:FlxText; 35 35 private var _txtShoot:FlxText; 36 - 36 + 37 37 override public function create():Void 38 38 { 39 39 FlxG.mouse.visible = false; 40 40 FlxG.camera.bgColor = FlxColor.GRAY; 41 41 FlxG.camera.fade(FlxColor.BLACK, 5, true); 42 42 FlxG.sound.playMusic("assets/music/ambience.ogg", 0.5); 43 - 43 + 44 44 _map = new FlxOgmoLoader(AssetPaths.level1__oel); 45 45 _mWalls = _map.loadTilemap(AssetPaths.tiles__png, 32, 32, "Floors"); 46 46 _mWalls.setTileProperties(1, FlxObject.ANY); 47 47 add(_mWalls); 48 - 48 + 49 49 _grpPeople = new FlxTypedGroup<FlxSprite>(); 50 50 add(_grpPeople); 51 - 51 + 52 52 _grpEnemies = new FlxTypedGroup<Enemy>(); 53 53 add(_grpEnemies); 54 - 54 + 55 55 _grpText = new FlxTypedGroup<FlxText>(); 56 56 add(_grpText); 57 - 57 + 58 58 playerBullets = new FlxTypedGroup<Bullet>(); 59 59 add(playerBullets); 60 - 60 + 61 61 _enemyThoughts = new FlxTypedGroup<Thoughts>(); 62 62 add(_enemyThoughts); 63 - 63 + 64 64 _player = new Player(20, 300, playerBullets); 65 65 _grpPeople.add(_player); 66 - 66 + 67 67 _map.loadEntities(placeEntities, "entities"); 68 - 68 + 69 69 FlxG.worldBounds.setSize(10000, 10000); 70 - 70 + 71 71 wasdTxt = new FlxText(_player.x - 64, _player.y - 100, 0, "A & D == Move", 16); 72 - wasdTxt.color = FlxColor.BLACK; 73 72 add(wasdTxt); 74 - 73 + 75 74 _txtShoot = new FlxText(170, 720, 0, "Spacebar to shoot", 16); 76 75 add(_txtShoot); 77 76 _txtShoot.visible = false; 78 - 79 - 77 + 80 78 var barHeight:Float = 50; 81 - 79 + 82 80 var cinemaBar:FlxSprite = new FlxSprite().makeGraphic(FlxG.width, Std.int(barHeight), FlxColor.BLACK); 83 - //add(cinemaBar); 81 + // add(cinemaBar); 84 82 var cinemaBar2:FlxSprite = new FlxSprite(0, FlxG.height - barHeight).makeGraphic(FlxG.width, Std.int(barHeight), FlxColor.BLACK); 85 - //add(cinemaBar2); 86 - 83 + // add(cinemaBar2); 84 + 87 85 cinemaBar.scrollFactor.x = cinemaBar.scrollFactor.y = 0; 88 86 cinemaBar2.scrollFactor.x = cinemaBar2.scrollFactor.y = 0; 89 - 87 + 90 88 FlxG.camera.follow(_player, FlxCameraFollowStyle.SCREEN_BY_SCREEN, 0.25); 91 89 FlxG.camera.snapToTarget(); 92 90 FlxG.camera.deadzone = FlxRect.get(0, cinemaBar.height, FlxG.width, cinemaBar2.y); 93 - 91 + 94 92 _grpPeople.forEach(initPeople); 95 93 _grpEnemies.forEach(initPeople); 96 - 94 + 97 95 var vig:FlxSprite = new FlxSprite().loadGraphic("assets/images/vignetteresized.png", false, 640, 480); 98 96 vig.scrollFactor.x = vig.scrollFactor.y = 0; 99 97 vig.setGraphicSize(FlxG.width, FlxG.height); 100 98 vig.updateHitbox(); 101 99 vig.alpha = 0.4; 102 100 add(vig); 103 - 104 - _grpText.forEach(changeColorintro); 105 - 101 + 106 102 super.create(); 107 103 } 108 - 104 + 109 105 private function placeEntities(entityName:String, entityData:Xml):Void 110 106 { 111 107 var x:Int = Std.parseInt(entityData.get("x")); ··· 127 123 _grpText.add(textSpr); 128 124 } 129 125 } 130 - 126 + 131 127 private function initPeople(p:FlxSprite):Void 132 128 { 133 129 p.acceleration.y = 600; ··· 137 133 { 138 134 super.update(elapsed); 139 135 /* 140 - if (_player.x >= _txtShoot.x) 141 - { 142 - _txtShoot.visible = true; 143 - wasdTxt.visible = false; 144 - } 145 - */ 136 + if (_player.x >= _txtShoot.x) 137 + { 138 + _txtShoot.visible = true; 139 + wasdTxt.visible = false; 140 + } 141 + */ 146 142 if (_player.justShot) 147 143 { 148 144 var flash:MuzzleFlash = new MuzzleFlash(_player.xPos, _player.y + 26); 149 145 add(flash); 150 - 146 + 151 147 FlxG.camera.shake(0.01, 0.1); 152 148 } 153 - 149 + 154 150 playerBullets.forEachAlive(collisionCheck); 155 - 151 + 156 152 FlxG.collide(_grpPeople, _mWalls); 157 153 FlxG.collide(_grpEnemies, _mWalls); 158 - 154 + 159 155 _grpEnemies.forEachAlive(followCheck); 160 - 156 + 161 157 if (_player.y >= 1800 && !finalLevel) 162 158 { 163 159 finalLevel = true; 164 160 FlxG.camera.fade(FlxColor.WHITE, 0.05, false, finalFade); 165 161 FlxG.sound.play("assets/sounds/colorSwap.ogg", 0.8); 166 162 FlxG.sound.music.stop(); 167 - _player.color = FlxG.random.getObject(Enemy.colorArray); 168 163 } 169 164 } 170 - 165 + 171 166 private var finalLevel:Bool = false; 172 - 167 + 173 168 private function enemyThink(e:Enemy, ?textOverride:String):Void 174 169 { 175 170 e.justThought = true; 176 - 171 + 177 172 FlxG.sound.play("assets/sounds/pop" + FlxG.random.int(1, 3) + ".ogg", FlxG.random.float(0.5, 0.7)); 178 - 173 + 179 174 var thoughtText:String; 180 - 175 + 181 176 if (e.finalSection) 182 177 { 183 178 thoughtText = thoughtArray[FlxG.random.int(0, thoughtArray.length)]; 184 179 } 185 180 else 186 181 { 187 - if (e.color == FlxColor.BLACK) 182 + if (e.color == FlxColor.WHITE) 188 183 { 189 184 thoughtText = "insert same opinion here"; 190 185 } ··· 193 188 thoughtText = "insert different opinion here"; 194 189 } 195 190 } 196 - 191 + 197 192 var thought:Thoughts = new Thoughts(e.x + FlxG.random.float(-100, 100), e.y - FlxG.random.float(10, 100), 150, thoughtText, 16); 198 193 add(thought); 199 - 194 + 200 195 if (e.finalSection) 201 196 { 202 - thought.color = FlxColor.WHITE; 203 - } 204 - else 205 - { 206 197 thought.color = FlxColor.BLACK; 207 198 } 208 - 199 + 209 200 if (textOverride != null) 210 201 { 211 202 thought.text = textOverride; 212 203 } 213 - 214 - FlxTween.tween(thought, {y: thought.y - FlxG.random.float(8, 15)}, 1.25, {ease:FlxEase.quartOut}); 215 - 204 + 205 + FlxTween.tween(thought, {y: thought.y - FlxG.random.float(8, 15)}, 1.25, {ease: FlxEase.quartOut}); 216 206 } 217 - 207 + 218 208 private function followCheck(e:Enemy):Void 219 209 { 220 210 e.acceleration.x = 0; 221 211 if (!e.finalSection) 222 212 { 223 - if (e.y > _player.y && e.velocity.y == 0 && e.color == FlxColor.BLACK) 213 + if (e.y > _player.y && e.velocity.y == 0 && e.color == FlxColor.WHITE) 224 214 { 225 215 e.velocity.y -= 360; 226 216 } 227 - 228 - if (e.color == FlxColor.BLACK) 217 + 218 + if (e.color == FlxColor.WHITE) 229 219 { 230 - 231 220 if (FlxMath.distanceBetween(e, _player) >= e.rndDistance) 232 221 { 233 222 var accel:Float = e.rndAccel; ··· 242 231 } 243 232 } 244 233 } 245 - 234 + 246 235 if (FlxMath.distanceBetween(_player, e) < 94 && !e.justThought) 247 236 { 248 237 enemyThink(e); 249 238 } 250 - 251 239 } 252 - 240 + 253 241 private function collisionCheck(b:Bullet):Void 254 242 { 255 243 for (e in _grpEnemies.members) 256 244 { 257 - if (FlxG.overlap(b, e) && e.color != FlxColor.BLACK) 245 + if (FlxG.overlap(b, e) && e.color != FlxColor.WHITE) 258 246 { 259 247 e.hit(); 260 248 e.x += b.velocity.x * FlxG.random.float(0.001, 0.01); 261 249 muzzFlash(b); 262 250 } 263 251 } 264 - 252 + 265 253 if (FlxG.collide(b, _mWalls)) 266 254 { 267 255 muzzFlash(b); 268 256 } 269 - 270 257 } 271 - 258 + 272 259 private function muzzFlash(b:Bullet):Void 273 260 { 274 261 var flash:MuzzleFlash = new MuzzleFlash(b.x, b.y); 275 262 add(flash); 276 - 263 + 277 264 b.kill(); 278 265 } 279 - 266 + 280 267 private function finalFade():Void 281 268 { 282 269 FlxG.camera.fade(FlxColor.WHITE, 3, true); 283 - FlxG.camera.bgColor = FlxColor.BLACK; 270 + FlxG.camera.bgColor = FlxColor.WHITE; 271 + _player.color = Enemy.colorArray[FlxG.random.int(0, Enemy.colorArray.length)]; 284 272 FlxG.sound.playMusic("assets/music/SomewhatOKIDKLMAO_V2.ogg", 0.7); 285 273 FlxG.sound.music.fadeIn(15, 0, 0.7); 286 - 287 - 274 + 288 275 _grpText.forEach(changeColor); 289 276 } 290 - 277 + 291 278 private function changeColor(t:FlxText):Void 292 279 { 293 - t.color = FlxColor.WHITE; 294 - } 295 - 296 - 297 - private function changeColorintro(t:FlxText):Void 298 - { 299 280 t.color = FlxColor.BLACK; 300 281 } 301 - 302 - 303 - private var thoughtArray:Array<String> = 304 - [ 305 - "I like anime a lot", 306 - "You know some pop music isn't that bad", 307 - "Crunchy peanut butter is alright", 308 - "Dogs are pretty alright", 309 - "Children are cool as hell", 310 - "Cats are cool", 311 - "Water is really better than soda", 312 - "La La Land was a good movie", 313 - "Carly Rae Jepsen music is my favourite", 314 - "I'm a bit obnoxious online because I'm kinda shy in person", 315 - "I envy others success", 316 - "I often feel under appreciated", 317 - "I don't like watching sports", 318 - "I love Newgrounds a LOT", 319 - "I feel guilty for not appreciating my heritage", 320 - "Videogames are the best", 321 - "I haven't watched anime for a while", 322 - "I miss my old home sometimes, even though it sucked", 323 - "The internet isn't as bad as many claim it is", 324 - "insert something political here", 325 - "My family is super cool", 326 - "Shoutouts to Simpleflips", 327 - "What kind of music do you like?", 328 - "Wait, this game wasn't about racism?", 329 - "I spend too much time on Twitter", 330 - "Hip hop, man that stuff's my jam!", 331 - "Hifumi from New Game is best waifu", 332 - "I don't really like berries", 333 - "High school was kinda alright", 334 - "Teens are alright", 335 - "Dogs are meh", 282 + 283 + private var thoughtArray:Array<String> = [ 284 + "I like anime a lot", "You know some pop music isn't that bad", "Crunchy peanut butter is alright", "Dogs are pretty alright", 285 + "Children are cool as hell", "Cats are cool", "Water is really better than soda", "La La Land was a good movie", 286 + "Carly Rae Jepsen music is my favourite", "I'm a bit obnoxious online because I'm kinda shy in person", "I envy others success", 287 + "I often feel under appreciated", "I don't like watching sports", "I love Newgrounds a LOT", "I feel guilty for not appreciating my heritage", 288 + "Videogames are the best", "I haven't watched anime for a while", "I miss my old home sometimes, even though it sucked", 289 + "The internet isn't as bad as many claim it is", "insert something political here", "My family is super cool", "Shoutouts to Simpleflips", 290 + "What kind of music do you like?", "Wait, this game wasn't about racism?", "I spend too much time on Twitter", "Hip hop, man that stuff's my jam!", 291 + "Hifumi from New Game is best waifu", "I don't really like berries", "High school was kinda alright", "Teens are alright", "Dogs are meh", 336 292 "Buzzfeed is alright nowadays" 337 293 ]; 338 - 339 - } 294 + }
+37 -40
source/Player.hx
··· 13 13 * ... 14 14 * @author ninjaMuffin 15 15 */ 16 - class Player extends FlxSprite 16 + class Player extends FlxSprite 17 17 { 18 18 private var bulletArray:FlxTypedGroup<Bullet>; 19 + 19 20 public var justShot:Bool = false; 21 + 20 22 private var rateOfFire:Int = 6; 21 23 private var fireCoutner:Int = 0; 24 + 22 25 public var xPos:Float = 0; 23 - 26 + 24 27 private var knockBack:Float = 3; 25 - 28 + 26 29 private var accel:Float = 3000; 27 - 30 + 28 31 public var justThought:Bool = false; 32 + 29 33 private var thoughtTimer:Float = 4; 30 34 private var walkTmr:Float = 0.2; 31 35 private var prevStep:Int = 1; 32 36 33 - public function new(?X:Float=0, ?Y:Float=0, playerBulletArray:FlxTypedGroup<Bullet>) 37 + public function new(?X:Float = 0, ?Y:Float = 0, playerBulletArray:FlxTypedGroup<Bullet>) 34 38 { 35 39 super(X, Y); 36 40 makeGraphic(64, 64); 37 - 41 + 38 42 maxVelocity.x = 300; 39 43 drag.x = 1400; 40 - 44 + 41 45 bulletArray = playerBulletArray; 42 - color = FlxColor.BLACK; 46 + color = FlxColor.WHITE; 43 47 } 44 - 45 - override public function update(elapsed:Float):Void 48 + 49 + override public function update(elapsed:Float):Void 46 50 { 47 51 controls(); 48 - 52 + 49 53 super.update(elapsed); 50 - 51 - 54 + 52 55 if (justThought) 53 56 { 54 57 thoughtTimer -= FlxG.elapsed; ··· 59 62 } 60 63 } 61 64 } 62 - 65 + 63 66 private function controls():Void 64 67 { 65 68 var _left:Bool = FlxG.keys.anyPressed([A, LEFT]); 66 69 var _right:Bool = FlxG.keys.anyPressed([D, RIGHT]); 67 70 var _upP:Bool = FlxG.keys.anyJustPressed([W, UP]); 68 - 71 + 69 72 var _shift:Bool = FlxG.keys.anyPressed([SHIFT, X]); 70 - 73 + 71 74 var canJump:Bool = isTouching(FlxObject.FLOOR); 72 - 75 + 73 76 if (_shift) 74 77 { 75 78 maxVelocity.x = 450; ··· 78 81 { 79 82 maxVelocity.x = 300; 80 83 } 81 - 84 + 82 85 if (_left && _right) 83 86 { 84 87 _left = _right = false; 85 88 } 86 - 89 + 87 90 if (_upP && canJump) 88 91 { 89 - FlxTween.tween(scale, {x: 0.8, y: 1.2}, 0.3, {ease:FlxEase.quadOut}).then(FlxTween.tween(scale, {x: 1, y: 1}, 0.5, {ease:FlxEase.quadInOut})); 92 + FlxTween.tween(scale, {x: 0.8, y: 1.2}, 0.3, {ease: FlxEase.quadOut}).then(FlxTween.tween(scale, {x: 1, y: 1}, 0.5, {ease: FlxEase.quadInOut})); 90 93 velocity.y -= 360; 91 94 } 92 - 95 + 93 96 acceleration.x = 0; 94 - 97 + 95 98 if (_left || _right) 96 99 { 97 100 walkTmr -= FlxG.elapsed; 98 - 101 + 99 102 if (walkTmr <= 0 && isTouching(FlxObject.FLOOR) && velocity.x != 0) 100 103 { 101 104 walkTmr = FlxG.random.float(0.3, 0.36); 102 105 prevStep = FlxG.random.int(1, 4, [prevStep]); 103 106 FlxG.sound.play("assets/sounds/walk" + Std.string(prevStep) + ".ogg"); 104 107 } 105 - 108 + 106 109 if (_left) 107 110 { 108 111 acceleration.x = -accel; 109 - 112 + 110 113 facing = FlxObject.LEFT; 111 114 } 112 115 if (_right) 113 116 { 114 117 acceleration.x = accel; 115 - 118 + 116 119 facing = FlxObject.RIGHT; 117 120 } 118 121 } 119 - 120 - 121 - if (color == FlxColor.BLACK) 122 + 123 + if (color == FlxColor.WHITE) 122 124 { 123 - shooting(); 125 + shooting(); 124 126 } 125 127 } 126 - 128 + 127 129 private function shooting():Void 128 130 { 129 - 130 131 justShot = false; 131 132 if (FlxG.keys.pressed.SPACE) 132 133 { ··· 140 141 } 141 142 } 142 143 } 143 - 144 - 145 - 144 + 146 145 private function attack():Void 147 146 { 148 - switch (facing) 147 + switch (facing) 149 148 { 150 149 case FlxObject.RIGHT: 151 150 xPos = x + 54; ··· 156 155 default: 157 156 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!"); 158 157 } 159 - 158 + 160 159 var newBullet = new Bullet(xPos, y + 32, 1600, facing, 10); 161 160 bulletArray.add(newBullet); 162 - 163 161 } 164 - 165 - } 162 + }