this repo has no description

tilemap, jumping

+142 -17
+1 -1
Project.xml
··· 36 36 <haxelib name="flixel" /> 37 37 38 38 <!--In case you want to use the addons package--> 39 - <!--<haxelib name="flixel-addons" />--> 39 + <haxelib name="flixel-addons" /> 40 40 41 41 <!--In case you want to use the ui package--> 42 42 <!--<haxelib name="flixel-ui"/>-->
+2 -1
WhitesOnly.hxproj
··· 19 19 <class path="C:\HaxeToolkit\haxe\lib\openfl\3,6,1" /> 20 20 <class path="C:\HaxeToolkit\haxe\lib\lime\2,9,1" /> 21 21 <class path="C:\HaxeToolkit\haxe\lib\hscript\2,1,1" /> 22 + <class path="C:\HaxeToolkit\haxe\lib\flixel-addons\2,5,0" /> 22 23 <class path="source" /> 23 24 <class path="C:\HaxeToolkit\haxe\lib\openfl\3,6,1\extern" /> 24 25 <class path="export\flash\haxe" /> 25 26 </classpaths> 26 27 <!-- Build options --> 27 28 <build> 28 - <option directives="flixel=4.3.0&#xA;openfl=3.6.1&#xA;lime=2.9.1&#xA;hscript=2.1.1&#xA;HXCPP_QUIET&#xA;openfl-next&#xA;tools=2.9.1&#xA;no-compilation&#xA;openfl-flash&#xA;web&#xA;display" /> 29 + <option directives="flixel=4.3.0&#xA;openfl=3.6.1&#xA;lime=2.9.1&#xA;hscript=2.1.1&#xA;flixel-addons=2.5.0&#xA;HXCPP_QUIET&#xA;openfl-next&#xA;tools=2.9.1&#xA;no-compilation&#xA;openfl-flash&#xA;web&#xA;display" /> 29 30 <option flashStrict="False" /> 30 31 <option noInlineOnDebug="False" /> 31 32 <option mainClass="ApplicationMain" />
+17
assets/data/level1.oel
··· 1 + <level width="720" height="480" room="0"> 2 + <Floors tileset="black" exportMode="CSV">-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 3 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 4 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 5 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 6 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 7 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 8 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 9 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 10 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 11 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 12 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 13 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 14 + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 15 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 16 + -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1</Floors> 17 + </level>
+56
assets/data/map.oep
··· 1 + <?xml version="1.0"?> 2 + <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 3 + <OgmoVersion>2.1.0.6</OgmoVersion> 4 + <Name>WhitesOnly</Name> 5 + <BackgroundColor A="255" R="125" G="160" B="255" /> 6 + <GridColor A="255" R="255" G="240" B="90" /> 7 + <LevelDefaultSize> 8 + <Width>720</Width> 9 + <Height>480</Height> 10 + </LevelDefaultSize> 11 + <LevelMinimumSize> 12 + <Width>720</Width> 13 + <Height>480</Height> 14 + </LevelMinimumSize> 15 + <LevelMaximumSize> 16 + <Width>7200</Width> 17 + <Height>4800</Height> 18 + </LevelMaximumSize> 19 + <Filename>C:\Users\NinjaMuffin\Documents\GitHub\WhitesOnly\assets\data\map.oep</Filename> 20 + <AngleMode>Radians</AngleMode> 21 + <CameraEnabled>false</CameraEnabled> 22 + <CameraSize> 23 + <Width>640</Width> 24 + <Height>480</Height> 25 + </CameraSize> 26 + <ExportCameraPosition>false</ExportCameraPosition> 27 + <LevelValueDefinitions> 28 + <ValueDefinition xsi:type="IntValueDefinition" Name="room" Default="0" Min="0" Max="100" ShowSlider="false" /> 29 + </LevelValueDefinitions> 30 + <LayerDefinitions> 31 + <LayerDefinition xsi:type="TileLayerDefinition"> 32 + <Name>Floors</Name> 33 + <Grid> 34 + <Width>32</Width> 35 + <Height>32</Height> 36 + </Grid> 37 + <ScrollFactor> 38 + <X>1</X> 39 + <Y>1</Y> 40 + </ScrollFactor> 41 + <ExportMode>CSV</ExportMode> 42 + </LayerDefinition> 43 + </LayerDefinitions> 44 + <Tilesets> 45 + <Tileset> 46 + <Name>black</Name> 47 + <FilePath>tiles.png</FilePath> 48 + <TileSize> 49 + <Width>32</Width> 50 + <Height>32</Height> 51 + </TileSize> 52 + <TileSep>0</TileSep> 53 + </Tileset> 54 + </Tilesets> 55 + <EntityDefinitions /> 56 + </project>
assets/data/tiles.png

This is a binary file and will not be displayed.

+1 -1
export/.build
··· 1 - 57 1 + 82
+10 -4
source/Bullet.hx
··· 12 12 */ 13 13 class Bullet extends FlxSprite 14 14 { 15 - 16 - private var speed:Float; 17 - private var dir:Int; 18 - private var damage:Float; 15 + private var life:Float = 3; 16 + public var speed:Float; 17 + public var dir:Int; 18 + public var damage:Float; 19 19 20 20 public function new(?X:Float=0, ?Y:Float=0, Speed:Float, Direction:Int, Damage:Float) 21 21 { ··· 41 41 if (dir == FlxObject.RIGHT) 42 42 { 43 43 velocity.x = speed; 44 + } 45 + 46 + life -= FlxG.elapsed; 47 + if (life < 0) 48 + { 49 + kill(); 44 50 } 45 51 46 52 }
+28 -6
source/PlayState.hx
··· 2 2 3 3 import flixel.FlxCamera.FlxCameraFollowStyle; 4 4 import flixel.FlxG; 5 + import flixel.FlxObject; 5 6 import flixel.FlxSprite; 6 7 import flixel.FlxState; 8 + import flixel.addons.editors.ogmo.FlxOgmoLoader; 7 9 import flixel.group.FlxGroup.FlxTypedGroup; 8 10 import flixel.text.FlxText; 11 + import flixel.tile.FlxTilemap; 9 12 import flixel.ui.FlxButton; 10 13 import flixel.math.FlxMath; 11 14 import flixel.util.FlxColor; ··· 13 16 class PlayState extends FlxState 14 17 { 15 18 private var _player:Player; 19 + private var playerBullets:FlxTypedGroup<Bullet>; 20 + 16 21 private var _enemy:Enemy; 17 22 18 - private var playerBullets:FlxTypedGroup<Bullet>; 23 + private var _map:FlxOgmoLoader; 24 + private var _mWalls:FlxTilemap; 25 + 26 + private var _grpPeople:FlxTypedGroup<FlxSprite>; 19 27 20 28 override public function create():Void 21 29 { 22 30 FlxG.camera.bgColor = FlxColor.GRAY; 23 31 32 + _map = new FlxOgmoLoader(AssetPaths.level1__oel); 33 + _mWalls = _map.loadTilemap(AssetPaths.tiles__png, 32, 32, "Floors"); 34 + _mWalls.setTileProperties(1, FlxObject.ANY); 35 + add(_mWalls); 36 + 37 + _grpPeople = new FlxTypedGroup<FlxSprite>(); 38 + add(_grpPeople); 39 + 24 40 playerBullets = new FlxTypedGroup<Bullet>(); 25 41 add(playerBullets); 26 42 27 43 _player = new Player(20, 300, playerBullets); 28 - add(_player); 44 + _grpPeople.add(_player); 29 45 30 46 _enemy = new Enemy(400, 300); 31 - add(_enemy); 32 - 47 + _grpPeople.add(_enemy); 33 48 34 49 35 50 var barHeight:Float = 50; ··· 44 59 45 60 FlxG.camera.follow(_player, FlxCameraFollowStyle.SCREEN_BY_SCREEN, 0.25); 46 61 62 + _grpPeople.forEach(initPeople); 63 + 47 64 super.create(); 48 65 } 66 + 67 + private function initPeople(p:FlxSprite):Void 68 + { 69 + p.acceleration.y = 600; 70 + } 49 71 50 72 override public function update(elapsed:Float):Void 51 73 { ··· 61 83 62 84 playerBullets.forEachAlive(collisionCheck); 63 85 64 - 86 + FlxG.collide(_grpPeople, _mWalls); 65 87 } 66 88 67 89 private function collisionCheck(b:Bullet):Void 68 90 { 69 - if (FlxG.overlap(b, _enemy)) 91 + if (FlxG.overlap(b, _enemy) && _enemy.color != FlxColor.WHITE) 70 92 { 71 93 _enemy.hit(); 72 94 _enemy.x += b.velocity.x * FlxG.random.float(0.001, 0.01);
+24 -3
source/Player.hx
··· 20 20 public var xPos:Float = 0; 21 21 22 22 private var knockBack:Float = 3; 23 + 24 + private var accel:Float = 3000; 25 + 23 26 24 27 public function new(?X:Float=0, ?Y:Float=0, playerBulletArray:FlxTypedGroup<Bullet>) 25 28 { ··· 30 33 drag.x = 1400; 31 34 32 35 bulletArray = playerBulletArray; 33 - 34 36 } 35 37 36 38 override public function update(elapsed:Float):Void ··· 46 48 { 47 49 var _left:Bool = FlxG.keys.anyPressed([A, LEFT]); 48 50 var _right:Bool = FlxG.keys.anyPressed([D, RIGHT]); 51 + var _upP:Bool = FlxG.keys.anyJustPressed([W, UP]); 52 + 53 + var _shift:Bool = FlxG.keys.anyPressed([SHIFT, X]); 54 + 55 + var canJump:Bool = isTouching(FlxObject.FLOOR); 56 + 57 + if (_shift) 58 + { 59 + maxVelocity.x = 450; 60 + } 61 + else 62 + { 63 + maxVelocity.x = 300; 64 + } 49 65 50 66 if (_left && _right) 51 67 { 52 68 _left = _right = false; 53 69 } 54 70 71 + if (_upP && canJump) 72 + { 73 + velocity.y -= 300; 74 + } 75 + 55 76 acceleration.x = 0; 56 77 57 78 if (_left || _right) 58 79 { 59 - var accel:Float = 3000; 80 + 60 81 if (_left) 61 82 { 62 83 acceleration.x = -accel; ··· 103 124 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!"); 104 125 } 105 126 106 - var newBullet = new Bullet(xPos, y + 32, 800, facing, 10); 127 + var newBullet = new Bullet(xPos, y + 32, 1600, facing, 10); 107 128 bulletArray.add(newBullet); 108 129 109 130 }
+3 -1
source/designDoc.txt designDoc.txt
··· 10 10 its really about individuality and trying to make everyone the same as you 11 11 12 12 if you do something, likle overlap with them, they start talking to you, and if you shoot them, they run away. 13 - 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. 13 + 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. 14 + 15 + a segment where the player goes through a boring section where they all say the same thing