public void initTiles(GDKnyttArea area) { var llayers = new List <GDAreaLayer>(); TileSet ta = area.GDWorld.AssetManager.getTileSet(area.Area.TilesetA); TileSet tb = area.GDWorld.AssetManager.getTileSet(area.Area.TilesetB); foreach (GDAreaLayer c in this.GetChildren()) { llayers.Add(c); c.initLayer(ta, tb); } // Render map this.Layers = llayers.ToArray(); for (int layer = 0; layer < KnyttArea.AREA_TILE_LAYERS; layer++) { var data = area.Area.TileLayers[layer]; for (int y = 0; y < KnyttArea.AREA_HEIGHT; y++) { for (int x = 0; x < KnyttArea.AREA_WIDTH; x++) { var tile = data.getTile(x, y); if (tile == 0 || tile == 128) { continue; } setTile(layer, x, y, data.getTile(x, y)); } } } }
public void destroyArea(KnyttPoint point, GDKnyttArea area) { if (area == null) { return; } area.destroyArea(); area.QueueFree(); }
public void initLayers(GDKnyttArea area) { GDArea = area; var llayers = new List <GDKnyttObjectLayer>(); foreach (GDKnyttObjectLayer c in this.GetChildren()) { llayers.Add(c); c.initLayer(this); } this.Layers = llayers.ToArray(); //Load objects for (int layer = 0; layer < KnyttArea.AREA_SPRITE_LAYERS; layer++) { var data = area.Area.ObjectLayers[layer]; for (int y = 0; y < KnyttArea.AREA_HEIGHT; y++) { for (int x = 0; x < KnyttArea.AREA_WIDTH; x++) { var oid = data.getObjectID(x, y); if (oid.isZero()) { continue; } var bundle = GDArea.GDWorld.AssetManager.GetObject(oid); this.UsedAssets.Add(oid); if (bundle == null) { continue; } this.Layers[layer].addObject(new KnyttPoint(x, y), bundle); } } } }
public void moveToPosition(GDKnyttArea area, KnyttPoint position) { GlobalPosition = (area.getTileLocation(position) + (velocity.y < 0 ? -1 : 1) * BaseCorrection); }
public void initLayers(GDKnyttArea area) { GDArea = area; var llayers = new List <GDKnyttObjectLayer>(); foreach (GDKnyttObjectLayer c in this.GetChildren()) { llayers.Add(c); c.initLayer(this); } this.Layers = llayers.ToArray(); //Load objects for (int layer = 0; layer < KnyttArea.AREA_SPRITE_LAYERS; layer++) { var data = area.Area.ObjectLayers[layer]; for (int y = 0; y < KnyttArea.AREA_HEIGHT; y++) { for (int x = 0; x < KnyttArea.AREA_WIDTH; x++) { var oid = data.getObjectID(x, y); if (oid.isZero()) { continue; } var bundle = GDArea.GDWorld.AssetManager.GetObject(oid); this.UsedAssets.Add(oid); if (bundle == null) { continue; } this.Layers[layer].addObject(new KnyttPoint(x, y), bundle); } } } /* With overlay: Without overlay: * 1 Tiles 1 Tiles 1 * 2 Tiles 2 * 3 Tiles 3 Tiles 3 * 4 Objects 4 bullets Objects 4 bullets * 5 Objects 4 Objects 4 * 6 Objects 5 bullets Objects 5 bullets * 7 Objects 5 + effect Objects 5 + shift effect * 8 Juni Juni * 9 Objects 6 bullets Objects 6 bullets * 10 Objects 6 Objects 6 * 11 Objects 7 bullets * 12 Tiles 2 Objects 7 * 13 Juni's attachment Juni's attachment * 14 Objects 7 bullets * 15 Objects 7 * 16 Signs and titles Signs and titles */ if (GDArea.Area.getExtraData("Overlay")?.ToLower() == "true") { turnOffObjects(Layers[3]); Layers[3].ZIndex = 15; } }
public void moveToPosition(GDKnyttArea area, KnyttPoint position) { GlobalPosition = (area.getTileLocation(position) + BaseCorrection); }