Main map convert to new format

This commit is contained in:
Mootfrost777 2023-08-18 01:36:16 +03:00
parent b9f0740c17
commit 9c9b2b035e
5 changed files with 15 additions and 12 deletions

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="left-up" width="30" height="20" tilewidth="16" tileheight="16" infinite="1" nextlayerid="11" nextobjectid="49"> <map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="left-up" width="30" height="20" tilewidth="16" tileheight="16" infinite="1" nextlayerid="11" nextobjectid="49">
<tileset firstgid="1" source="map.tsx"/> <tileset firstgid="1" source="map.tsx"/>
<layer id="1" name="Collision" class="StopTile" width="30" height="20" offsetx="-352.033" offsety="192.098"> <layer id="1" name="Collision" class="StopTile" width="30" height="20" visible="0" offsetx="-352.033" offsety="192.098">
<data encoding="csv"> <data encoding="csv">
<chunk x="0" y="-16" width="16" height="16"> <chunk x="0" y="-16" width="16" height="16">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -311,7 +311,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<layer id="4" name="Background 2" class="Tile" width="30" height="20" locked="1"> <layer id="4" name="Background 2" class="Tile" width="30" height="20" visible="0" locked="1">
<data encoding="csv"> <data encoding="csv">
<chunk x="0" y="0" width="16" height="16"> <chunk x="0" y="0" width="16" height="16">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -441,7 +441,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<layer id="6" name="Ladders" class="Platform" width="30" height="20" locked="1"> <layer id="6" name="Ladders" class="Platform" width="30" height="20" visible="0" locked="1">
<data encoding="csv"> <data encoding="csv">
<chunk x="-16" y="0" width="16" height="16"> <chunk x="-16" y="0" width="16" height="16">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -517,7 +517,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<layer id="3" name="Backgrond" class="Tile" width="30" height="20" locked="1" offsetx="-256.033" offsety="256.098"> <layer id="3" name="Backgrond" class="Tile" width="30" height="20" visible="0" locked="1" offsetx="-256.033" offsety="256.098">
<data encoding="csv"> <data encoding="csv">
<chunk x="-16" y="-16" width="16" height="16"> <chunk x="-16" y="-16" width="16" height="16">
29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29, 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
@ -701,7 +701,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<objectgroup id="8" name="Zombies" class="LivingEntities.Monsters.Zombie" locked="1"> <objectgroup id="8" name="Zombies" class="LivingEntities.Monsters.Zombie" visible="0">
<object id="26" x="265" y="469.5"> <object id="26" x="265" y="469.5">
<point/> <point/>
</object> </object>

View file

@ -1,4 +1,4 @@
using DangerousD.GameCore.Graphics;  using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework; using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Graphics;

View file

@ -25,10 +25,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public int leftBorder; public int leftBorder;
public bool isVisible = true; public bool isVisible = true;
private bool isAttacked = false; private bool isAttacked = false;
public bool isInvincible; public bool isInvincible = false;
public GameObject objectAttack; public GameObject objectAttack;
public Player(Vector2 position, bool isInvincible = false) : base(position) public Player(Vector2 position) : base(position)
{ {
Width = 16; Width = 16;
Height = 32; Height = 32;
@ -41,8 +41,11 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
velocity = new Vector2(0, 0); velocity = new Vector2(0, 0);
rightBorder = (int)position.X + 100; rightBorder = (int)position.X + 100;
leftBorder = (int)position.X - 100; leftBorder = (int)position.X - 100;
this.isInvincible = isInvincible; }
public Player(Vector2 position, bool isInvincible = false) : this(position)
{
this.isInvincible = isInvincible;
} }
public bool IsAlive { get { return isAlive; } } public bool IsAlive { get { return isAlive; } }

View file

@ -202,7 +202,7 @@ namespace DangerousD.GameCore
case GameState.Lobby: case GameState.Lobby:
break; break;
case GameState.Game: case GameState.Game:
GameManager.mapManager.LoadLevel("debug"); GameManager.mapManager.LoadLevel("lvl");
break; break;
case GameState.Death: case GameState.Death:
break; break;

View file

@ -98,7 +98,7 @@ namespace DangerousD.GameCore.Managers
new Vector2(float.Parse(entity.Attributes["x"].Value, CultureInfo.InvariantCulture) + offsetX, new Vector2(float.Parse(entity.Attributes["x"].Value, CultureInfo.InvariantCulture) + offsetX,
float.Parse(entity.Attributes["y"].Value, CultureInfo.InvariantCulture) + offsetY) * _scale; float.Parse(entity.Attributes["y"].Value, CultureInfo.InvariantCulture) + offsetY) * _scale;
Entity inst; Entity inst;
if (type.Equals(typeof(Player)) && entity.Attributes["name"].Value == "DEBUGUS") if (type.Equals(typeof(Player)) && entity.Attributes["name"] is not null && entity.Attributes["name"].Value == "DEBUGUS")
{ {
inst = (Entity)Activator.CreateInstance(type, pos, true); inst = (Entity)Activator.CreateInstance(type, pos, true);
} }