Last active
August 29, 2015 14:01
-
-
Save c023-DeV/21b40ce356baf3a93804 to your computer and use it in GitHub Desktop.
BaseLevel.hx created from Dame Exporter
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
//Code generated with DAME and DeVZoO. http://www.dambots.com http://www.dev-zoo.net | |
package; | |
import flixel.group.FlxGroup; | |
import flixel.FlxSprite; | |
import flixel.FlxObject; | |
import flixel.text.FlxText; | |
import flixel.util.FlxPoint; | |
import flixel.tile.FlxTilemap; | |
import flash.utils.Dictionary; | |
class Level_TestRoom01 extends LvLpk01 | |
{ | |
//Embedded media... | |
//Tilemaps | |
public var layerBGT_dev:FlxTilemap; | |
public var layermainLayer:FlxTilemap; | |
//Sprites | |
public var playerLayerGroup:FlxGroup; | |
public var particleLayerGroup:FlxGroup; | |
//Shapes | |
public var shapezLayerGroup:FlxGroup; | |
//Properties | |
public function new(addToStage:Bool = true, onAddCallback:Dynamic = null, parentObject:Dynamic = null) | |
{ | |
super(); | |
var mapString:String; | |
var image:BitmapData; | |
//Sprites | |
playerLayerGroup = new FlxGroup(); | |
particleLayerGroup = new FlxGroup(); | |
//Shapes | |
shapezLayerGroup= new FlxGroup(); | |
// Generate maps. | |
var properties:Array<Dynamic> = new Array<Dynamic>(); | |
mapString = ApplicationMain.getAsset('assets/lvlpk01/lvldata/mapCSV_TestRoom01_BGT_dev.csv').toString(); | |
image = ApplicationMain.getAsset('assets/lvlpk01/tilemaps/tiles_pk01_innerWallDev02.png'); | |
properties = generateProperties( [null] ); | |
layerBGT_dev = addTilemap(mapString ,image, 0.000, 0.000, 16, 16, 1.000, 1.000, false, 1, 1, properties, onAddCallback ); | |
mapString = ApplicationMain.getAsset('assets/lvlpk01/lvldata/mapCSV_TestRoom01_mainLayer.csv').toString(); | |
image = ApplicationMain.getAsset('assets/lvlpk01/tilemaps/atlas_main_01.png'); | |
properties = generateProperties( [null] ); | |
layermainLayer = addTilemap(mapString ,image, 0.000, 0.000, 16, 16, 1.000, 1.000, true, 1, 1, properties, onAddCallback ); | |
//Add layers to the master group in correct order. | |
masterLayer.add(layerBGT_dev); | |
masterLayer.add(playerLayerGroup); | |
playerLayerGroup.scrollFactor.x = 1.0000; | |
playerLayerGroup.scrollFactor.y = 1.0000; | |
masterLayer.add(layermainLayer); | |
masterLayer.add(particleLayerGroup); | |
particleLayerGroup.scrollFactor.x = 1.0000; | |
particleLayerGroup.scrollFactor.y = 1.0000; | |
masterLayer.add(shapezLayerGroup); | |
shapezLayerGroup.scrollFactor.x = 1.0000; | |
shapezLayerGroup.scrollFactor.y = 1.0000; | |
if ( addToStage ) | |
createObjects(onAddCallback, parentObject); | |
boundsMinX = 0; | |
boundsMinY = 0; | |
boundsMaxX = 800; | |
boundsMaxY = 320; | |
boundsMin = new FlxPoint(0, 0); | |
boundsMax = new FlxPoint(800, 320); | |
bgColor = 0xff171326; | |
} | |
override public function createObjects(onAddCallback:Dynamic = null, parentObject:Dynamic = null):Void | |
{ | |
addShapesForLayershapezLayer(onAddCallback); | |
addSpritesForLayerplayerLayer(onAddCallback); | |
addSpritesForLayerparticleLayer(onAddCallback); | |
generateObjectLinks(onAddCallback); | |
if ( parentObject != null ) | |
parentObject.add(masterLayer); | |
else | |
FlxG.state.add(masterLayer); | |
} | |
public function addShapesForLayershapezLayer(onAddCallback:Dynamic = null):Void | |
{ | |
var obj:Dynamic; | |
obj = new BoxData(368.000, 192.000, 0.000, 64.000, 50.000, shapezLayerGroup ); | |
shapes.push(obj); | |
callbackNewData( obj, onAddCallback, shapezLayerGroup, generateProperties( [null] ), 1, 1 ); | |
} | |
public function addSpritesForLayerplayerLayer(onAddCallback:Dynamic = null):Void | |
{ | |
addSpriteToLayer(null, Entity_PlayerSpawn, playerLayerGroup , 384.000, 96.000, 0.000, 1, 1, false, 1.000, 1.000, generateProperties( [{ name:"Checkpoint", value:0 }, null] ), onAddCallback );//"Entity_PlayerSpawn" | |
} | |
public function addSpritesForLayerparticleLayer(onAddCallback:Dynamic = null):Void | |
{ | |
addSpriteToLayer(null, Entity_ParticleLoader, particleLayerGroup , 400.000, 96.000, 0.000, 1, 1, false, 1.000, 1.000, generateProperties( [null] ), onAddCallback );//"Entity_ParticleLoader" | |
} | |
public function generateObjectLinks(onAddCallback:Dynamic = null):Void | |
{ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment