Merge branch 'main' of https://github.com/progtime-net/DangerousD
This commit is contained in:
commit
695a8fb871
41 changed files with 1589 additions and 264 deletions
|
@ -5,6 +5,7 @@ using System;
|
|||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
|
||||
namespace AnimationsFileCreator
|
||||
{
|
||||
|
@ -62,7 +63,7 @@ namespace AnimationsFileCreator
|
|||
container.TextureFrameInterval = 1;
|
||||
container.Id = id;
|
||||
string json = JsonConvert.SerializeObject(container);
|
||||
StreamWriter writer = new StreamWriter("../../../../DangerousD/Content/animations/" + id);
|
||||
StreamWriter writer = new StreamWriter("../../../../DangerousD/Content/animations/"+id);
|
||||
writer.WriteLine(json);
|
||||
writer.Close();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#-------------------------------- References --------------------------------#
|
||||
|
||||
/reference:references/MonoGame.Extended.Content.Pipeline.dll
|
||||
|
||||
#---------------------------------- Content ---------------------------------#
|
||||
|
||||
|
@ -83,6 +84,19 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:menuFon.jpg
|
||||
|
||||
#begin MonstersAnimations.png
|
||||
#begin menuFon.jpg
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
/processorParam:ColorKeyEnabled=True
|
||||
/processorParam:GenerateMipmaps=False
|
||||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:menuFon.jpg
|
||||
|
||||
#begin MenuFon2.jpg
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -107,7 +121,7 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:menuFon3.jpg
|
||||
|
||||
#begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png
|
||||
#begin tiles.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -117,7 +131,7 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png
|
||||
/build:tiles.png
|
||||
|
||||
#begin wall.jpg
|
||||
/importer:TextureImporter
|
||||
|
|
20
DangerousD/Content/animations/SilasAttack
Normal file
20
DangerousD/Content/animations/SilasAttack
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"id": "SilasAttack",
|
||||
"textureName": "MonstersAnimations",
|
||||
"startSpriteRectangle": {
|
||||
"X": 1,
|
||||
"Y": 618,
|
||||
"Width": 72,
|
||||
"Height": 80
|
||||
},
|
||||
"frameSecond": [
|
||||
{
|
||||
"Item1": 0,
|
||||
"Item2": 5
|
||||
}
|
||||
],
|
||||
"textureFrameInterval": 1,
|
||||
"framesCount": 2,
|
||||
"isCycle": true,
|
||||
"offset": "0, 0"
|
||||
}
|
1
DangerousD/Content/animations/SilasBallMove
Normal file
1
DangerousD/Content/animations/SilasBallMove
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"SilasBallMove","textureName":"MonstersAnimations","startSpriteRectangle":{"X":147,"Y":618,"Width":24,"Height":24},"frameSecond":[{"Item1":0,"Item2":8}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
DangerousD/Content/animations/SilasHandMove
Normal file
1
DangerousD/Content/animations/SilasHandMove
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"SilasHandMove","textureName":"MonstersAnimations","startSpriteRectangle":{"X":197,"Y":618,"Width":24,"Height":24},"frameSecond":[{"Item1":0,"Item2":8}],"textureFrameInterval":1,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
20
DangerousD/Content/animations/SilasMove
Normal file
20
DangerousD/Content/animations/SilasMove
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"id": "SilasMove",
|
||||
"textureName": "MonstersAnimations",
|
||||
"startSpriteRectangle": {
|
||||
"X": 1,
|
||||
"Y": 618,
|
||||
"Width": 72,
|
||||
"Height": 80
|
||||
},
|
||||
"frameSecond": [
|
||||
{
|
||||
"Item1": 0,
|
||||
"Item2": 60
|
||||
}
|
||||
],
|
||||
"textureFrameInterval": 1,
|
||||
"framesCount": 2,
|
||||
"isCycle": true,
|
||||
"offset": "0, 0"
|
||||
}
|
759
DangerousD/Content/lvl.tmx
Normal file
759
DangerousD/Content/lvl.tmx
Normal file
|
@ -0,0 +1,759 @@
|
|||
<?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">
|
||||
<tileset firstgid="1" source="map.tsx"/>
|
||||
<layer id="1" name="Collision" class="StopTile" width="30" height="20" locked="1" offsetx="-352.033" offsety="192.098">
|
||||
<data encoding="csv">
|
||||
<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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,75,52,52,52,52,
|
||||
0,0,0,0,0,0,0,0,0,0,0,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,52,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="16" 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,
|
||||
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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,0,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" 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,
|
||||
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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="48" 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,
|
||||
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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="64" 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,
|
||||
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,
|
||||
52,52,52,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,40,41,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,53,54,0
|
||||
</chunk>
|
||||
<chunk x="0" y="0" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,52,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,52,52,52,52,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,52,52,52,52,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,74,75,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,13,75,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="16" y="0" width="16" height="16">
|
||||
52,0,0,0,52,0,0,0,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,0,0,52,0,0,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,0,52,0,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" y="0" width="16" height="16">
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="48" y="0" width="16" height="16">
|
||||
52,52,52,52,52,52,52,52,52,0,0,0,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,0,0,0,52,52,52,52,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,52,52,52,52,52,0,0,0,52,52,52,52,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="64" y="0" width="16" height="16">
|
||||
52,52,52,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="-16" y="16" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,46,0,0,66,67,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,66,67,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,66,67,0,
|
||||
0,0,0,0,0,0,76,76,76,76,76,76,76,76,76,76,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
</chunk>
|
||||
<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,
|
||||
0,0,0,0,0,0,0,0,0,51,52,52,52,52,52,52,
|
||||
76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="16" 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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="32" 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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="48" 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,
|
||||
52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,52,
|
||||
76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="64" y="16" width="16" height="16">
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,75,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
52,52,52,52,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
76,76,76,76,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="4" name="Background 2" class="Tile" width="30" height="20" visible="0" locked="1">
|
||||
<data encoding="csv">
|
||||
<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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,149,152,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,150,153,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,151,154,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,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,0,149,152,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,151,154,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,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,0,0,0,0
|
||||
</chunk>
|
||||
<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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,149,152,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" 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,79,80,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,92,93,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,105,106,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,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,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,149,152,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,151,154,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,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,149,152,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="-16" 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,
|
||||
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,
|
||||
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,149,152,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,151,154,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,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,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,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,0,0,0,0,0
|
||||
</chunk>
|
||||
<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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,149,152,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,150,153,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,151,154,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,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="16" y="16" width="16" height="16">
|
||||
0,0,0,0,150,153,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,151,154,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,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,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,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,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,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,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,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" y="16" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,151,154,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,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,149,152,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,151,154,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,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,149,152,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,151,154,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,0,0,0,0
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="6" name="Ladders" class="Platform" width="30" height="20" locked="1">
|
||||
<data encoding="csv">
|
||||
<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,
|
||||
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,
|
||||
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,
|
||||
0,0,0,0,0,0,147,199,148,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,147,199,148,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,147,199,148,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,147,199,148,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,147,199,148,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" 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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
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,
|
||||
0,0,0,147,199,148,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,147,199,148,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
|
||||
</chunk>
|
||||
<chunk x="-16" y="16" width="16" height="16">
|
||||
0,0,0,0,0,0,147,199,148,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,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,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,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,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,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,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,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="32" y="16" width="16" height="16">
|
||||
0,0,0,147,199,148,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,147,199,148,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,147,199,148,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,147,199,148,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,147,199,148,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,160,199,161,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,
|
||||
183,184,185,186,199,187,188,189,190,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,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
<layer id="3" name="Backgrond" class="Tile" width="30" height="20" visible="0" locked="1" offsetx="-256.033" offsety="256.098">
|
||||
<data encoding="csv">
|
||||
<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,
|
||||
29,29,29,29,29,29,29,29,29,29,29,29,29,2,3,4,
|
||||
29,29,29,29,5,6,29,29,29,29,29,29,14,15,16,17,
|
||||
29,29,29,29,29,29,29,29,29,29,29,29,27,28,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,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,29,29,
|
||||
29,29,29,2,3,4,29,29,29,23,24,29,29,29,29,29,
|
||||
29,29,14,15,16,17,29,29,29,29,29,29,29,29,29,29,
|
||||
29,29,27,28,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,5,6,
|
||||
29,29,29,23,24,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,29,29,29,29,29,29,29,29,29,29,29
|
||||
</chunk>
|
||||
<chunk x="0" y="-16" width="16" height="16">
|
||||
29,29,29,29,29,0,0,0,0,0,0,0,0,0,0,0,
|
||||
29,29,29,29,29,0,144,144,144,144,144,144,144,144,247,144,
|
||||
29,29,29,29,0,0,157,157,167,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,157,157,180,157,254,255,157,157,260,157,
|
||||
29,29,29,29,0,0,157,157,193,157,267,268,157,157,260,157,
|
||||
29,29,29,29,0,0,204,204,204,204,280,281,204,272,260,272,
|
||||
29,29,29,29,0,0,147,199,148,0,0,0,0,0,260,0,
|
||||
29,29,29,29,0,0,147,199,148,144,144,144,144,144,260,144,
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,204,272,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,0,0,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,144,144,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157
|
||||
</chunk>
|
||||
<chunk x="16" y="-16" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,178,179,157,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,157,191,192,157,157,252,253,157,157,157,157,157,157,258,
|
||||
157,157,157,157,157,157,157,265,266,157,157,157,696,697,157,271,
|
||||
204,204,204,204,204,204,204,278,279,204,204,204,709,710,204,284,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,157,157,157,157,258,157,157,157,252,253,157,157,157,157,
|
||||
157,157,157,157,157,157,271,157,157,157,265,266,157,696,697,157,
|
||||
157,157,272,204,204,204,284,204,204,204,278,279,204,709,710,204,
|
||||
157,157,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
157,157,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,157,157,157,157,157,157,157,167,157,157,209,210,
|
||||
157,157,157,157,254,255,157,157,157,157,157,180,157,157,222,223
|
||||
</chunk>
|
||||
<chunk x="32" y="-16" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,243,157,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,157,157,256,257,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,157,157,269,270,157,157,157,157,217,261,262,263,264,217,
|
||||
204,204,204,204,282,283,204,204,204,204,230,274,275,276,277,230,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,209,210,211,212,157,157,157,167,157,157,157,157,
|
||||
157,254,255,157,222,223,224,225,157,157,157,180,157,157,157,157,
|
||||
157,267,268,157,235,236,237,238,157,157,157,193,157,157,157,157,
|
||||
204,280,281,204,204,204,204,204,204,204,204,204,204,204,204,204,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
211,212,157,157,157,157,157,157,157,157,157,157,157,157,157,157,
|
||||
224,225,157,157,252,253,157,248,249,157,157,258,157,157,157,157
|
||||
</chunk>
|
||||
<chunk x="48" y="-16" width="16" height="16">
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,621,622,144,144,144,0,0,0,
|
||||
157,157,157,157,157,157,157,157,634,635,157,157,157,0,0,0,
|
||||
157,248,249,157,157,157,272,157,647,648,157,272,157,0,0,0,
|
||||
157,250,251,157,157,157,145,147,199,200,148,145,157,0,0,0,
|
||||
204,239,240,204,204,204,204,160,199,200,161,204,204,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,0,0,0,
|
||||
178,179,157,157,157,157,157,243,157,157,157,157,157,0,0,0,
|
||||
191,192,157,157,157,157,157,256,257,157,252,253,157,0,0,0,
|
||||
157,157,157,157,157,157,157,269,270,157,265,266,157,0,0,0,
|
||||
204,204,204,204,204,204,204,282,283,204,278,279,204,0,0,0,
|
||||
0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0,
|
||||
157,157,157,147,199,148,157,243,157,157,157,157,157,0,0,0,
|
||||
254,255,157,147,199,148,157,256,257,157,252,253,157,0,0,0
|
||||
</chunk>
|
||||
<chunk x="-16" y="0" 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,
|
||||
29,29,29,29,29,29,29,29,29,29,29,29,2,3,4,29,
|
||||
29,29,29,29,29,29,29,29,29,29,29,14,15,16,17,29,
|
||||
29,29,29,29,29,29,29,29,29,29,29,27,28,29,29,29,
|
||||
29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,
|
||||
29,29,29,29,5,6,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,5,
|
||||
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,
|
||||
29,29,29,19,20,21,22,0,0,29,29,29,29,29,29,29,
|
||||
29,30,31,32,33,34,35,0,0,29,29,29,29,29,29,29,
|
||||
29,43,44,45,46,47,48,0,0,29,29,29,29,29,29,29,
|
||||
64,65,18,58,59,60,18,0,0,29,29,29,29,29,29,29,
|
||||
77,78,18,71,72,73,18,0,0,68,56,56,55,56,56,69,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
||||
</chunk>
|
||||
<chunk x="0" y="0" width="16" height="16">
|
||||
29,29,29,29,0,0,147,199,148,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,160,200,161,204,204,272,157,157,260,157,
|
||||
29,29,29,29,0,0,0,0,0,0,0,0,157,157,260,157,
|
||||
29,29,29,29,0,0,144,144,144,144,144,144,157,157,260,157,
|
||||
29,29,29,29,0,0,157,167,157,157,157,157,157,157,260,157,
|
||||
29,29,29,29,0,0,157,180,157,252,253,157,157,157,260,157,
|
||||
29,29,29,29,0,0,157,193,157,265,266,157,157,157,260,157,
|
||||
6,29,29,29,0,0,204,204,204,278,279,204,272,157,260,157,
|
||||
29,29,29,29,0,0,0,0,0,0,0,0,0,157,260,157,
|
||||
29,29,29,29,0,0,144,144,144,144,144,144,144,157,260,157,
|
||||
29,29,29,29,0,0,157,157,157,157,157,157,157,219,220,221,
|
||||
29,29,29,12,0,0,157,157,157,254,255,157,157,232,233,234,
|
||||
29,29,29,29,26,63,157,157,157,267,268,218,213,214,215,216,
|
||||
29,29,29,38,39,63,204,204,204,280,281,231,226,227,228,229,
|
||||
29,29,29,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
|
||||
</chunk>
|
||||
<chunk x="16" y="0" width="16" height="16">
|
||||
157,157,157,157,267,268,157,696,697,157,157,193,157,157,235,236,
|
||||
157,272,204,204,280,281,204,709,710,204,204,204,204,204,204,204,
|
||||
157,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
157,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,178,179,157,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,157,191,192,157,248,249,157,157,157,157,157,157,157,157,
|
||||
157,157,157,157,157,157,250,251,157,217,261,262,263,264,217,157,
|
||||
272,204,204,204,204,204,239,240,204,230,274,275,276,277,230,204,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,157,157,157,157,243,157,157,209,210,211,212,157,
|
||||
157,252,253,157,157,258,157,157,256,257,157,222,223,224,225,157,
|
||||
218,265,266,157,157,271,157,157,269,270,157,235,236,237,238,157,
|
||||
231,278,279,204,204,284,204,204,282,283,204,204,204,204,204,204,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="32" y="0" width="16" height="16">
|
||||
237,238,157,157,265,266,157,250,251,157,157,271,157,157,157,157,
|
||||
204,204,204,204,278,279,204,239,240,204,204,284,204,204,204,204,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,157,157,157,157,157,157,157,243,157,157,209,210,211,212,
|
||||
157,157,254,255,157,248,249,157,157,256,257,157,222,223,224,225,
|
||||
157,157,267,268,157,250,251,157,157,269,270,157,235,236,237,238,
|
||||
204,204,280,281,204,239,240,204,204,282,283,204,204,204,204,204,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,
|
||||
157,157,178,179,157,157,157,157,157,157,157,157,157,157,157,157,
|
||||
157,157,191,192,157,157,157,157,258,157,157,157,248,249,157,157,
|
||||
157,157,157,157,157,696,697,157,271,157,157,157,250,251,157,157,
|
||||
204,204,204,204,204,709,710,204,284,204,204,204,239,240,204,204,
|
||||
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
|
||||
</chunk>
|
||||
<chunk x="48" y="0" width="16" height="16">
|
||||
267,268,157,147,199,148,157,269,270,157,265,266,218,0,0,0,
|
||||
280,281,204,160,200,161,204,282,283,204,278,279,231,0,0,0,
|
||||
0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0,
|
||||
157,157,157,147,199,148,157,157,157,157,157,157,157,0,0,0,
|
||||
157,157,157,147,199,148,157,157,157,157,252,253,157,0,0,0,
|
||||
157,157,157,147,199,148,157,217,157,157,265,266,157,0,0,0,
|
||||
204,204,204,160,200,161,204,230,204,204,278,279,204,0,0,0,
|
||||
0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0,
|
||||
144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0,
|
||||
157,157,159,160,200,161,162,157,157,157,157,157,157,0,0,0,
|
||||
157,171,172,173,199,174,175,176,157,157,252,253,157,0,0,0,
|
||||
183,184,185,186,199,187,188,189,190,157,265,266,157,0,0,0,
|
||||
196,197,198,199,199,200,201,202,203,204,278,279,204,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,0,0,0
|
||||
</chunk>
|
||||
</data>
|
||||
</layer>
|
||||
<objectgroup id="8" name="Zombies" class="LivingEntities.Monsters.Zombie" locked="1">
|
||||
<object id="26" x="265" y="469.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="27" x="55" y="472.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="28" x="488.5" y="472">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="29" x="409.5" y="469.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="30" x="665" y="376">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="31" x="521.5" y="373">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="32" x="262" y="372.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="33" x="473" y="277.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="34" x="152" y="275">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="35" x="485.5" y="181.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="36" x="70" y="181">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="37" x="20" y="87">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="38" x="99.5" y="84.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="39" x="279" y="83.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="40" x="392.5" y="82.5">
|
||||
<point/>
|
||||
</object>
|
||||
<object id="41" x="582" y="83">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
<objectgroup id="10" name="Player" class="LivingEntities.Player">
|
||||
<object id="47" x="-260" y="461.333">
|
||||
<point/>
|
||||
</object>
|
||||
</objectgroup>
|
||||
</map>
|
4
DangerousD/Content/map.tsx
Normal file
4
DangerousD/Content/map.tsx
Normal file
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<tileset version="1.10" tiledversion="1.10.2" name="map" tilewidth="16" tileheight="16" tilecount="871" columns="13">
|
||||
<image source="tiles.BMP" width="208" height="1072"/>
|
||||
</tileset>
|
BIN
DangerousD/Content/tiles.png
Normal file
BIN
DangerousD/Content/tiles.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 27 KiB |
16
DangerousD/Desktop/DangerousD map/map_0.mgcontent
Normal file
16
DangerousD/Desktop/DangerousD map/map_0.mgcontent
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<SourceFile>C:/Users/Semejkin_AV/Desktop/DangerousD map/map.tsx</SourceFile>
|
||||
<SourceTime>2023-08-16T13:04:13.796245+03:00</SourceTime>
|
||||
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/DangerousD/DangerousD/Content/bin/DesktopGL/Content/../../../../../Desktop/DangerousD map/map_0.xnb</DestFile>
|
||||
<DestTime>2023-08-16T15:38:41.8125207+03:00</DestTime>
|
||||
<Importer>TiledMapTilesetImporter</Importer>
|
||||
<ImporterTime>2023-07-14T20:14:40+03:00</ImporterTime>
|
||||
<Processor>TiledMapTilesetProcessor</Processor>
|
||||
<ProcessorTime>2023-07-14T20:14:40+03:00</ProcessorTime>
|
||||
<Dependencies />
|
||||
<BuildAsset>
|
||||
<string>C:/Users/Semejkin_AV/Documents/Github_repos/DangerousD/DangerousD/Content/bin/DesktopGL/Content/../../../../../Desktop/DangerousD map/tiles_0.xnb</string>
|
||||
</BuildAsset>
|
||||
<BuildOutput />
|
||||
</PipelineBuildEvent>
|
22
DangerousD/Desktop/DangerousD map/tiles_0.mgcontent
Normal file
22
DangerousD/Desktop/DangerousD map/tiles_0.mgcontent
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<SourceFile>C:/Users/Semejkin_AV/Desktop/DangerousD map/tiles.BMP</SourceFile>
|
||||
<SourceTime>2023-08-16T12:47:16.3453923+03:00</SourceTime>
|
||||
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/DangerousD/DangerousD/Content/bin/DesktopGL/Content/../../../../../Desktop/DangerousD map/tiles_0.xnb</DestFile>
|
||||
<DestTime>2023-08-16T15:38:41.7865192+03:00</DestTime>
|
||||
<Importer>TextureImporter</Importer>
|
||||
<ImporterTime>2022-07-26T14:44:56+03:00</ImporterTime>
|
||||
<Processor>TextureProcessor</Processor>
|
||||
<ProcessorTime>2022-07-26T14:44:56+03:00</ProcessorTime>
|
||||
<Parameters>
|
||||
<Key>ColorKeyColor</Key>
|
||||
<Value>0,0,0,0</Value>
|
||||
</Parameters>
|
||||
<Parameters>
|
||||
<Key>ColorKeyEnabled</Key>
|
||||
<Value>True</Value>
|
||||
</Parameters>
|
||||
<Dependencies />
|
||||
<BuildAsset />
|
||||
<BuildOutput />
|
||||
</PipelineBuildEvent>
|
|
@ -17,9 +17,9 @@ public abstract class AbstractGui : IDrawableObject
|
|||
|
||||
protected abstract void CreateUI();
|
||||
private GraphicsDevice graphicsDevice;
|
||||
public virtual void Initialize(GraphicsDevice graphicsDevice)
|
||||
public virtual void Initialize()
|
||||
{
|
||||
Manager.Initialize(graphicsDevice);
|
||||
Manager.Initialize(AppManager.Instance.GraphicsDevice);
|
||||
this.graphicsDevice = graphicsDevice;
|
||||
CreateUI();
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ using System.Threading.Tasks;
|
|||
using DangerousD.GameCore.Managers;
|
||||
using MonogameLibrary.UI.Base;
|
||||
using System.Diagnostics;
|
||||
using DangerousD.GameCore.Network;
|
||||
|
||||
namespace DangerousD.GameCore.GUI
|
||||
{
|
||||
|
@ -32,8 +33,32 @@ namespace DangerousD.GameCore.GUI
|
|||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(screenWidth / 30 * 2, screenHeight / 30 * 5,
|
||||
screenWidth / 30 * 26, screenHeight / 15 * 10) });
|
||||
|
||||
// Buttons
|
||||
// Buttons and ip textbox
|
||||
{
|
||||
TextBox searchBarTextBox = new TextBox(Manager)
|
||||
{
|
||||
rectangle = new Rectangle(screenWidth / 30 * 14, screenHeight / 30,
|
||||
screenWidth / 30 * 10, screenHeight / 30 * 3),
|
||||
text = "ip",
|
||||
scale = 0.16f,
|
||||
fontColor = Color.Gray,
|
||||
fontName = "font2",
|
||||
textAligment = TextAligment.Left
|
||||
|
||||
};
|
||||
searchBarTextBox.TextChanged += input => {
|
||||
if (searchBarTextBox.fontColor == Color.Gray)
|
||||
{
|
||||
searchBarTextBox.text = ""; searchBarTextBox.fontColor = Color.Black;
|
||||
}
|
||||
};
|
||||
searchBarTextBox.StopChanging += input => {
|
||||
if (input.Length == 0)
|
||||
{
|
||||
searchBarTextBox.fontColor = Color.Gray;
|
||||
searchBarTextBox.text = "ip";
|
||||
}
|
||||
};
|
||||
Button backButton = new ButtonText(Manager)
|
||||
{
|
||||
rectangle = new Rectangle(screenWidth / 30, screenHeight / 30, 60, 50),
|
||||
|
@ -56,6 +81,8 @@ namespace DangerousD.GameCore.GUI
|
|||
};
|
||||
hostButton.LeftButtonPressed += () => {
|
||||
|
||||
AppManager.Instance.NetworkManager.HostInit(AppManager.Instance.IpAddress);
|
||||
|
||||
};
|
||||
|
||||
Button refreshButton = new ButtonText(Manager)
|
||||
|
@ -79,7 +106,7 @@ namespace DangerousD.GameCore.GUI
|
|||
fontName = "font2"
|
||||
};
|
||||
joinSelectedButton.LeftButtonPressed += () => {
|
||||
|
||||
AppManager.Instance.NetworkManager.ClientInit(AppManager.Instance.IpAddress);
|
||||
};
|
||||
Button joinByIpButton = new ButtonText(Manager)
|
||||
{
|
||||
|
@ -90,34 +117,7 @@ namespace DangerousD.GameCore.GUI
|
|||
fontName = "font2"
|
||||
};
|
||||
joinByIpButton.LeftButtonPressed += () => {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
// SearchBar
|
||||
{
|
||||
TextBox searchBarTextBox = new TextBox(Manager) {
|
||||
rectangle = new Rectangle(screenWidth / 30 * 14, screenHeight / 30,
|
||||
screenWidth / 30 * 10, screenHeight / 30 * 3),
|
||||
text = "ip",
|
||||
scale = 0.16f,
|
||||
fontColor = Color.Gray,
|
||||
fontName = "font2",
|
||||
textAligment = TextAligment.Left
|
||||
|
||||
};
|
||||
searchBarTextBox.TextChanged += input => {
|
||||
if (searchBarTextBox.fontColor == Color.Gray)
|
||||
{
|
||||
searchBarTextBox.text = ""; searchBarTextBox.fontColor = Color.Black;
|
||||
}
|
||||
};
|
||||
searchBarTextBox.StopChanging += input => {
|
||||
if (input.Length == 0)
|
||||
{
|
||||
searchBarTextBox.fontColor = Color.Gray;
|
||||
searchBarTextBox.text = "ip";
|
||||
}
|
||||
AppManager.Instance.NetworkManager.ClientInit(searchBarTextBox.text);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ internal class MenuGUI : AbstractGui
|
|||
butSingle.LeftButtonPressed += () =>
|
||||
{
|
||||
AppManager.Instance.ChangeGameState(GameState.Game);
|
||||
AppManager.Instance.SetMultiplayerState(MultiPlayerStatus.SinglePlayer);
|
||||
};
|
||||
var butMulti = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, 190, 300, 50), text = "Multiplayer", fontName = "ButtonFont" };
|
||||
Elements.Add(butMulti);
|
||||
|
|
36
DangerousD/GameCore/GameObjects/Entities/SilasBall.cs
Normal file
36
DangerousD/GameCore/GameObjects/Entities/SilasBall.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.Entities
|
||||
{
|
||||
public class SilasBall : LivingEntity
|
||||
{
|
||||
public SilasBall(Vector2 position) : base(position)
|
||||
{
|
||||
Height = 60;
|
||||
Width = 60;
|
||||
acceleration = Vector2.Zero;
|
||||
|
||||
}
|
||||
public SilasBall(Vector2 position, Vector2 velosity) : base(position)
|
||||
{
|
||||
Height = 60;
|
||||
Width = 60;
|
||||
acceleration = Vector2.Zero;
|
||||
velocity = velosity;
|
||||
|
||||
}
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SilasBallMove" }, "SilasBallMove");
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -8,11 +8,8 @@ namespace DangerousD.GameCore.GameObjects
|
|||
{
|
||||
public abstract class Entity : GameObject
|
||||
{
|
||||
|
||||
|
||||
public Entity(Vector2 position) : base(position) {}
|
||||
|
||||
|
||||
public virtual void SetPosition(Vector2 position) { _pos = position; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,12 @@ namespace DangerousD.GameCore
|
|||
protected abstract GraphicsComponent GraphicsComponent { get; }
|
||||
public GameObject(Vector2 pos)
|
||||
{
|
||||
Initialize();
|
||||
_pos = pos;
|
||||
Width = 500;
|
||||
Height = 101;
|
||||
//Animator = new GraphicsComponent(new() { "playerIdle" });
|
||||
|
||||
LoadContent();
|
||||
AppManager.Instance.GameManager.Register(this);
|
||||
}
|
||||
|
@ -34,7 +36,7 @@ namespace DangerousD.GameCore
|
|||
{
|
||||
}
|
||||
|
||||
public virtual void Initialize(GraphicsDevice graphicsDevice)
|
||||
public virtual void Initialize()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace DangerousD.GameCore.GUI
|
|||
{
|
||||
interface IDrawableObject
|
||||
{
|
||||
void Initialize(GraphicsDevice graphicsDevice);
|
||||
void Initialize();
|
||||
void LoadContent();
|
||||
void Update(GameTime gameTime);
|
||||
void Draw(SpriteBatch spriteBatch);
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
using System;
|
||||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -6,7 +10,61 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
internal class SilasHands
|
||||
public class SilasHands : CoreEnemy
|
||||
{
|
||||
public SilasHands(Vector2 position) : base(position)
|
||||
{
|
||||
name = "SilasHand";
|
||||
Width = 48;
|
||||
Height = 48;
|
||||
monster_health = 2;
|
||||
monster_speed = 2;
|
||||
acceleration = Vector2.Zero;
|
||||
|
||||
}
|
||||
|
||||
protected override GraphicsComponent GraphicsComponent { get; }=new GraphicsComponent(new List<string>() { "SilasHandMove" }, "SilasHandMove");
|
||||
|
||||
public override void Attack()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Death()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Move(GameTime gameTime)
|
||||
{
|
||||
if (Pos.Y> AppManager.Instance.GameManager.GetPlayer1.Pos.Y)
|
||||
{
|
||||
velocity.Y = -monster_speed;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.Y = monster_speed;
|
||||
}
|
||||
if (Pos.X> AppManager.Instance.GameManager.GetPlayer1.Pos.X)
|
||||
{
|
||||
velocity.X = -monster_speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.X = monster_speed;
|
||||
}
|
||||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
Move(gameTime);
|
||||
if ((Pos.X + 20 <= AppManager.Instance.GameManager.GetPlayer1.Pos.X || Pos.X - 20 >= AppManager.Instance.GameManager.GetPlayer1.Pos.X)&&(Pos.Y + 20 <= AppManager.Instance.GameManager.GetPlayer1.Pos.Y || Pos.Y - 20 >= AppManager.Instance.GameManager.GetPlayer1.Pos.Y))
|
||||
{
|
||||
|
||||
AppManager.Instance.GameManager.GetPlayer1.Death(name);
|
||||
}
|
||||
GraphicsComponent.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
using System;
|
||||
using DangerousD.GameCore.GameObjects.Entities;
|
||||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
@ -6,7 +11,116 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
public class SilasMaster
|
||||
public class SilasMaster : CoreEnemy
|
||||
{
|
||||
private int attackTime = 60;
|
||||
private int moveTime = 360;
|
||||
private int currentTime = 0;
|
||||
private bool isGoRight = true;
|
||||
int leftBorder;
|
||||
int rightBorder;
|
||||
List<SilasHands> hands = new List<SilasHands>();
|
||||
List<SilasBall> balls = new List<SilasBall>();
|
||||
public SilasMaster(Vector2 position) : base(position)
|
||||
{
|
||||
name = "SilasMaster";
|
||||
Width = 144;
|
||||
Height = 160;
|
||||
monster_health = 15;
|
||||
monster_speed = 4;
|
||||
acceleration = Vector2.Zero;
|
||||
leftBorder = (int)position.X - 60;
|
||||
rightBorder = (int)position.X + 120;
|
||||
acceleration = Vector2.Zero;
|
||||
hands.Add(new SilasHands(new Vector2(Pos.X+60,Pos.Y+120)));
|
||||
hands.Add(new SilasHands(new Vector2(Pos.X + 90, Pos.Y + 120)));
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
SilasBall silasball = new SilasBall(new Vector2(Pos.X + i * 40, Pos.Y + 120), new Vector2((i - 2) * 4, 6));
|
||||
balls.Add(silasball);
|
||||
}
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "SilasMove", "SilasAttack" }, "SilasMove");
|
||||
public override void Attack()
|
||||
{
|
||||
|
||||
if (currentTime == 0)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasAttack");
|
||||
|
||||
}
|
||||
else if (currentTime == attackTime / 2)
|
||||
{
|
||||
SpawnAttackBall();
|
||||
}
|
||||
else if (currentTime >= attackTime)
|
||||
{
|
||||
|
||||
GraphicsComponent.StartAnimation("SilasMove");
|
||||
currentTime = 0;
|
||||
}
|
||||
currentTime++;
|
||||
}
|
||||
private void SpawnAttackBall()
|
||||
{
|
||||
for (int i = 0; i < balls.Count; i++)
|
||||
{
|
||||
balls[i].SetPosition(new Vector2(Pos.X + i * 40, Pos.Y + 120));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public override void Death()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Move(GameTime gameTime)
|
||||
{
|
||||
if (currentTime == 0)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasMove");
|
||||
}
|
||||
else if (currentTime >= moveTime)
|
||||
{
|
||||
GraphicsComponent.StartAnimation("SilasAttack");
|
||||
currentTime = 0;
|
||||
}
|
||||
currentTime++;
|
||||
if (isGoRight)
|
||||
{
|
||||
velocity.X = monster_speed;
|
||||
}
|
||||
else if (!isGoRight)
|
||||
{
|
||||
velocity.X = -monster_speed;
|
||||
}
|
||||
|
||||
if (Pos.X >= rightBorder)
|
||||
{
|
||||
isGoRight = false;
|
||||
}
|
||||
else if (Pos.X <= leftBorder)
|
||||
{
|
||||
isGoRight = true;
|
||||
}
|
||||
}
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
base.Update(gameTime);
|
||||
if (hands.Count<2)
|
||||
{
|
||||
hands.Add(new SilasHands(new Vector2(Pos.X + 60, Pos.Y + 120)));
|
||||
}
|
||||
if (GraphicsComponent.CurrentAnimation.Id == "SilasMove")
|
||||
{
|
||||
Move(gameTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity = Vector2.Zero;
|
||||
Attack();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,23 +7,27 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DangerousD.GameCore.Managers;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
||||
{
|
||||
public class Zombie : CoreEnemy
|
||||
{
|
||||
private bool isGoRight = true;
|
||||
int leftBorder;
|
||||
int rightBorder;
|
||||
float leftBorder;
|
||||
float rightBorder;
|
||||
bool isAttaking = false;
|
||||
bool isTarget = false;
|
||||
PhysicsManager physicsManager;
|
||||
public Zombie(Vector2 position) : base(position)
|
||||
{
|
||||
Width = 72;
|
||||
Height = 120;
|
||||
Width = 24;
|
||||
Height = 40;
|
||||
monster_speed = 3;
|
||||
name = "Zombie";
|
||||
leftBorder = (int)position.X - 60;
|
||||
rightBorder = (int)position.X + 120;
|
||||
leftBorder = (int)position.X - 100;
|
||||
rightBorder = (int)position.X + 100;
|
||||
physicsManager = new PhysicsManager();
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack" }, "ZombieMoveLeft");
|
||||
|
||||
|
@ -31,6 +35,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
{
|
||||
if (!isAttaking)
|
||||
{
|
||||
Target();
|
||||
Move(gameTime);
|
||||
}
|
||||
|
||||
|
@ -106,5 +111,25 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
}
|
||||
base.OnCollision(gameObject);
|
||||
}
|
||||
|
||||
public void Target()
|
||||
{
|
||||
if(physicsManager.RayCast(this, AppManager.Instance.GameManager.players[0]) == null)
|
||||
{
|
||||
if(isGoRight && this._pos.X <= AppManager.Instance.GameManager.players[0].Pos.X)
|
||||
{
|
||||
isTarget = true;
|
||||
leftBorder = Pos.X - 10;
|
||||
rightBorder = Pos.X + AppManager.Instance.GameManager.players[0].Pos.X;
|
||||
}
|
||||
|
||||
else if(!isGoRight && this._pos.X >= AppManager.Instance.GameManager.players[0].Pos.X)
|
||||
{
|
||||
isTarget = true;
|
||||
rightBorder = Pos.X + 10;
|
||||
leftBorder = AppManager.Instance.GameManager.players[0].Pos.X;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,9 @@ namespace DangerousD.GameCore.GameObjects.PlayerDeath
|
|||
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> {"DeathFromZombie"},
|
||||
"DeathFromZombie");
|
||||
|
||||
public GraphicsComponent Gr => GraphicsComponent;
|
||||
|
||||
private void PlayDeath(string deathName)
|
||||
{
|
||||
if (GraphicsComponent.GetCurrentAnimation != "DeathFromZombie")
|
||||
|
|
|
@ -16,10 +16,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
{
|
||||
Width = 32;
|
||||
Height = 64;
|
||||
GraphicsComponent.actionOfAnimationEnd += (a) =>
|
||||
{
|
||||
AppManager.Instance.ChangeGameState(GameState.GameOver);
|
||||
};
|
||||
AppManager.Instance.InputManager.MovEventJump += AnimationJump;
|
||||
}
|
||||
public bool IsAlive { get { return isAlive; } }
|
||||
|
||||
|
@ -35,9 +32,19 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
|
|||
if(monsterName == "Zombie")
|
||||
{
|
||||
DeathRectangle deathRectangle = new DeathRectangle(Pos, "DeathFrom" + monsterName);
|
||||
GraphicsComponent.actionOfAnimationEnd("0");
|
||||
deathRectangle.Gr.actionOfAnimationEnd += (a) =>
|
||||
{
|
||||
if (a == "DeathFrom" + monsterName)
|
||||
{
|
||||
AppManager.Instance.ChangeGameState(GameState.GameOver);
|
||||
}
|
||||
};
|
||||
}
|
||||
isAlive = false;
|
||||
}
|
||||
public void AnimationJump()
|
||||
{
|
||||
velocity.Y = -300;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,11 @@ public abstract class LivingEntity : Entity
|
|||
{
|
||||
acceleration = new Vector2(0, 30);
|
||||
}
|
||||
public void SetPosition(Vector2 position) { targetPosition = position; _pos = position; } //TODO befrend targetpos and physics engine
|
||||
public override void SetPosition(Vector2 position)
|
||||
{
|
||||
targetPosition = position; _pos = position;
|
||||
|
||||
} //TODO befrend targetpos and physics engine
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
namespace DangerousD.GameCore.GameObjects;
|
||||
|
||||
public abstract class MapObject : GameObject
|
||||
{
|
||||
public bool IsColliderOn;
|
||||
public MapObject(Vector2 position) : base(position)
|
||||
private Rectangle _sourceRectangle;
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new("tiles");
|
||||
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position)
|
||||
{
|
||||
_sourceRectangle = sourceRectangle;
|
||||
Width = (int)size.X;
|
||||
Height = (int)size.Y;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
GraphicsComponent.DrawAnimation(Rectangle, spriteBatch, _sourceRectangle);
|
||||
}
|
||||
}
|
|
@ -1,23 +0,0 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using DangerousD.GameCore.Graphics;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.MapObjects
|
||||
{
|
||||
internal class GrassBlock : MapObject
|
||||
{
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new("wall");
|
||||
|
||||
public GrassBlock(Vector2 position) : base(position)
|
||||
{
|
||||
Width = 32;
|
||||
Height = 32;
|
||||
}
|
||||
}
|
||||
}
|
12
DangerousD/GameCore/GameObjects/MapObjects/Platform.cs
Normal file
12
DangerousD/GameCore/GameObjects/MapObjects/Platform.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.MapObjects;
|
||||
|
||||
public class Platform : MapObject
|
||||
{
|
||||
public Platform(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position, size, sourceRectangle)
|
||||
{
|
||||
IsColliderOn = true;
|
||||
}
|
||||
}
|
12
DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs
Normal file
12
DangerousD/GameCore/GameObjects/MapObjects/StopTile.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.MapObjects;
|
||||
|
||||
public class StopTile : MapObject
|
||||
{
|
||||
public StopTile(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position, size, sourceRectangle)
|
||||
{
|
||||
IsColliderOn = true;
|
||||
}
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.MapObjects
|
||||
{
|
||||
internal class TestAnimationDeath : Entity
|
||||
{
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "death1", "deathbear" },"death1");
|
||||
|
||||
public TestAnimationDeath(Vector2 position) : base(position)
|
||||
{
|
||||
Width =512;
|
||||
Height = 512;
|
||||
|
||||
GraphicsComponent.StartAnimation("deathbear");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
12
DangerousD/GameCore/GameObjects/MapObjects/Tile.cs
Normal file
12
DangerousD/GameCore/GameObjects/MapObjects/Tile.cs
Normal file
|
@ -0,0 +1,12 @@
|
|||
using DangerousD.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace DangerousD.GameCore.GameObjects.MapObjects;
|
||||
|
||||
public class Tile : MapObject
|
||||
{
|
||||
public Tile(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position, size, sourceRectangle)
|
||||
{
|
||||
IsColliderOn = false;
|
||||
}
|
||||
}
|
|
@ -11,12 +11,19 @@ namespace DangerousD.GameCore.Graphics
|
|||
|
||||
public class GraphicsComponent
|
||||
{
|
||||
public Action<string> actionOfAnimationEnd;
|
||||
public event Action<string> actionOfAnimationEnd;
|
||||
private List<AnimationContainer> animations;
|
||||
private List<Texture2D> textures;
|
||||
private List<string> texturesNames;
|
||||
private AnimationContainer currentAnimation;
|
||||
|
||||
public AnimationContainer CurrentAnimation
|
||||
{
|
||||
get
|
||||
{
|
||||
return currentAnimation;
|
||||
}
|
||||
}
|
||||
public string LastAnimation { get; set; }
|
||||
public string GetCurrentAnimation
|
||||
{
|
||||
get { return currentAnimation.Id; }
|
||||
|
@ -26,16 +33,21 @@ namespace DangerousD.GameCore.Graphics
|
|||
//private SpriteBatch _spriteBatch;
|
||||
|
||||
private int currentFrame;
|
||||
public int CurrentFrame
|
||||
{
|
||||
get
|
||||
{
|
||||
return currentFrame;
|
||||
}
|
||||
}
|
||||
private int interval;
|
||||
private int lastInterval;
|
||||
private Rectangle sourceRectangle;
|
||||
|
||||
public GraphicsComponent(List<string> animationsId, string neitralAnimationId)
|
||||
{
|
||||
//this._spriteBatch = _spriteBatch;
|
||||
currentFrame = 0;
|
||||
lastInterval = 1;
|
||||
|
||||
LoadAnimations(animationsId, neitralAnimationId);
|
||||
currentAnimation = neitralAnimation;
|
||||
SetInterval();
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
namespace DangerousD.GameCore.Levels
|
||||
{
|
||||
interface ILevel
|
||||
{
|
||||
void InitLevel();
|
||||
}
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
using DangerousD.GameCore.GameObjects.LivingEntities;
|
||||
using DangerousD.GameCore.GameObjects.MapObjects;
|
||||
using Microsoft.Xna.Framework;
|
||||
using DangerousD.GameCore.GameObjects.LivingEntities.Monsters;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DangerousD.GameCore.Levels
|
||||
{
|
||||
public class Level1 : ILevel
|
||||
{
|
||||
public void InitLevel()
|
||||
{
|
||||
new Player(new Vector2(80,0));
|
||||
var Zombie = new Zombie(new Vector2(140, 128));
|
||||
var Frank = new Frank(new Vector2(384, 128));
|
||||
|
||||
var Spider = new Spider(new Vector2(112, 0));
|
||||
var FlameSkull = new FlameSkull(new Vector2(512, 0));
|
||||
var Werewolf = new Werewolf(new Vector2(640, 0));
|
||||
var Ghost = new Ghost(new Vector2(730, 0));
|
||||
var FrankBalls = new FrankBalls(new Vector2(Frank.Pos.X, Frank.Pos.Y));
|
||||
|
||||
new GrassBlock(new Vector2(0, 224));
|
||||
for (int i = 0; i < 50; i++)
|
||||
{
|
||||
new GrassBlock(new Vector2(i*32, 256));
|
||||
}
|
||||
new GrassBlock(new Vector2(500, 224));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,12 +14,15 @@ using DangerousD.GameCore.Managers;
|
|||
namespace DangerousD.GameCore
|
||||
{
|
||||
public enum GameState { Menu, Options, Lobby, Game, Login, GameOver }
|
||||
public enum MultiPlayerStatus { SinglePlayer, Host, Client }
|
||||
public class AppManager : Game
|
||||
{
|
||||
public static AppManager Instance { get; private set; }
|
||||
public static AppManager Instance { get; private set; }
|
||||
public string IpAddress { get; private set; } = "127.0.0.1";
|
||||
private GraphicsDeviceManager _graphics;
|
||||
private SpriteBatch _spriteBatch;
|
||||
GameState gameState;
|
||||
public GameState gameState { get; private set; }
|
||||
public MultiPlayerStatus multiPlayerStatus { get; private set; } = MultiPlayerStatus.SinglePlayer;
|
||||
IDrawableObject MenuGUI;
|
||||
IDrawableObject OptionsGUI;
|
||||
IDrawableObject LoginGUI;
|
||||
|
@ -28,7 +31,7 @@ namespace DangerousD.GameCore
|
|||
public Point inGameResolution = new Point(800, 480);
|
||||
private RenderTarget2D renderTarget;
|
||||
|
||||
public GameManager GameManager { get; private set; } = new GameManager();
|
||||
public GameManager GameManager { get; private set; } = new();
|
||||
public AnimationBuilder AnimationBuilder { get; private set; } = new AnimationBuilder();
|
||||
public NetworkManager NetworkManager { get; private set; } = new NetworkManager();
|
||||
public InputManager InputManager { get; private set; } = new InputManager();
|
||||
|
@ -36,15 +39,17 @@ namespace DangerousD.GameCore
|
|||
public SettingsManager SettingsManager { get; private set; } = new SettingsManager();
|
||||
public AppManager()
|
||||
{
|
||||
Content.RootDirectory = "Content";
|
||||
Instance = this;
|
||||
_graphics = new GraphicsDeviceManager(this);
|
||||
Content.RootDirectory = "Content";
|
||||
IsMouseVisible = true;
|
||||
TargetElapsedTime = TimeSpan.FromMilliseconds(1000 / 30);
|
||||
|
||||
SettingsManager = new SettingsManager();
|
||||
SettingsManager.LoadSettings();
|
||||
|
||||
NetworkManager.GetReceivingMessages += NetworkSync;
|
||||
|
||||
resolution = SettingsManager.Resolution;
|
||||
_graphics.PreferredBackBufferWidth = resolution.X;
|
||||
_graphics.PreferredBackBufferHeight = resolution.Y;
|
||||
|
@ -59,10 +64,11 @@ namespace DangerousD.GameCore
|
|||
|
||||
protected override void Initialize()
|
||||
{
|
||||
GameManager.Initialize();
|
||||
AnimationBuilder.LoadAnimations();
|
||||
MenuGUI.Initialize(GraphicsDevice);
|
||||
LoginGUI.Initialize(GraphicsDevice);
|
||||
LobbyGUI.Initialize(GraphicsDevice);
|
||||
MenuGUI.Initialize();
|
||||
LoginGUI.Initialize();
|
||||
LobbyGUI.Initialize();
|
||||
base.Initialize();
|
||||
}
|
||||
|
||||
|
@ -160,12 +166,45 @@ namespace DangerousD.GameCore
|
|||
case GameState.Lobby:
|
||||
break;
|
||||
case GameState.Game:
|
||||
GameManager.mapManager.LoadLevel("");
|
||||
GameManager.mapManager.LoadLevel("lvl");
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
|
||||
public void NetworkSync(List<NetworkTask> networkTasks)
|
||||
{
|
||||
foreach (NetworkTask networkTask in networkTasks)
|
||||
{
|
||||
switch (networkTask.operation)
|
||||
{
|
||||
case NetworkTaskOperationEnum.TakeDamage:
|
||||
break;
|
||||
case NetworkTaskOperationEnum.SendSound:
|
||||
SoundManager.StartSound(networkTask.name, networkTask.position, GameManager.GetPlayer1.Pos);
|
||||
break;
|
||||
case NetworkTaskOperationEnum.CreateEntity:
|
||||
break;
|
||||
case NetworkTaskOperationEnum.SendPosition:
|
||||
break;
|
||||
case NetworkTaskOperationEnum.ChangeState:
|
||||
break;
|
||||
case NetworkTaskOperationEnum.ConnectToHost:
|
||||
break;
|
||||
case NetworkTaskOperationEnum.GetClientPlayerId:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public void SetMultiplayerState(MultiPlayerStatus multiPlayerStatus)
|
||||
{
|
||||
this.multiPlayerStatus = multiPlayerStatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,15 +7,17 @@ using Microsoft.Xna.Framework.Graphics;
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DangerousD.GameCore.GameObjects.LivingEntities.Monsters;
|
||||
|
||||
namespace DangerousD.GameCore
|
||||
{
|
||||
public class GameManager
|
||||
{
|
||||
|
||||
public List<GameObject> GetAllGameObjects { get; private set; }
|
||||
public List<LivingEntity> livingEntities;
|
||||
public List<Entity> entities;
|
||||
public List<MapObject> mapObjects;
|
||||
public List<GameObject> others;
|
||||
public MapManager mapManager;
|
||||
public PhysicsManager physicsManager;
|
||||
public List<Player> players;
|
||||
|
@ -23,13 +25,23 @@ namespace DangerousD.GameCore
|
|||
public Player GetPlayer1 { get; private set; }
|
||||
public GameManager()
|
||||
{
|
||||
others = new List<GameObject>();
|
||||
GetAllGameObjects = new List<GameObject>();
|
||||
livingEntities = new List<LivingEntity>();
|
||||
mapObjects = new List<MapObject>();
|
||||
entities = new List<Entity>();
|
||||
players = new List<Player>();
|
||||
mapManager = new MapManager();
|
||||
mapManager = new MapManager(1);
|
||||
physicsManager = new PhysicsManager();
|
||||
mapManager.Init();
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
//mapManager.LoadLevel("Level1");
|
||||
}
|
||||
|
||||
public void LoadContent()
|
||||
{
|
||||
}
|
||||
|
||||
internal void Register(GameObject gameObject)
|
||||
|
@ -76,8 +88,11 @@ namespace DangerousD.GameCore
|
|||
item.Update(gameTime);
|
||||
foreach (var item in entities)
|
||||
item.Update(gameTime);
|
||||
foreach (var item in livingEntities)
|
||||
item.Update(gameTime);
|
||||
|
||||
for (int i = 0; i < livingEntities.Count; i++)
|
||||
{
|
||||
livingEntities[i].Update(gameTime);
|
||||
}
|
||||
foreach (var item in otherObjects)
|
||||
item.Update(gameTime);
|
||||
|
||||
|
|
|
@ -1,26 +1,115 @@
|
|||
using DangerousD.GameCore.GameObjects;
|
||||
using DangerousD.GameCore.Graphics;
|
||||
using DangerousD.GameCore.Levels;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using DangerousD.GameCore.GameObjects.MapObjects;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System.Xml.Serialization;
|
||||
using DangerousD.GameCore.GameObjects;
|
||||
|
||||
namespace DangerousD.GameCore.Managers
|
||||
{
|
||||
public class MapManager
|
||||
{
|
||||
ILevel Level;
|
||||
public void Init()
|
||||
private int _columns;
|
||||
private int _scale;
|
||||
|
||||
public MapManager(int scale)
|
||||
{
|
||||
Level = new Level1();
|
||||
_scale = scale;
|
||||
}
|
||||
|
||||
//Level
|
||||
public void LoadLevel(string level)
|
||||
{
|
||||
Level.InitLevel();
|
||||
LoadTilesData();
|
||||
|
||||
XmlDocument xml = new();
|
||||
xml.Load($"../../../Content/{level}.tmx");
|
||||
Vector2 tileSize = new(int.Parse(xml.DocumentElement.Attributes["tilewidth"].Value),
|
||||
int.Parse(xml.DocumentElement.Attributes["tileheight"].Value));
|
||||
//tileSize *= _scale;
|
||||
|
||||
foreach (XmlNode layer in xml.DocumentElement.SelectNodes("layer"))
|
||||
{
|
||||
InstantiateTiles(layer, tileSize);
|
||||
}
|
||||
|
||||
foreach (XmlNode layer in xml.DocumentElement.SelectNodes("objectgroup"))
|
||||
{
|
||||
InstantiateEntities(layer);
|
||||
}
|
||||
}
|
||||
|
||||
private void InstantiateTiles(XmlNode layer, Vector2 tileSize)
|
||||
{
|
||||
string tileType = layer.Attributes["class"].Value;
|
||||
float offsetX = layer.Attributes["offsetx"] is not null ? float.Parse(layer.Attributes["offsetx"].Value) : 0;
|
||||
float offsetY = layer.Attributes["offsety"] is not null ? float.Parse(layer.Attributes["offsety"].Value) : 0;
|
||||
|
||||
|
||||
Debug.Write(layer.SelectNodes("data/chunk").Count);
|
||||
foreach (XmlNode chunk in layer.SelectNodes("data/chunk"))
|
||||
{
|
||||
int chunkW = int.Parse(chunk.Attributes["width"].Value);
|
||||
int chunkX = int.Parse(chunk.Attributes["x"].Value);
|
||||
int chunkY = int.Parse(chunk.Attributes["y"].Value);
|
||||
|
||||
|
||||
List<int> tiles = chunk.InnerText.Split(',').Select(int.Parse).ToList();
|
||||
for (int i = 0; i < tiles.Count; i++)
|
||||
{
|
||||
if (tiles[i] != 0)
|
||||
{
|
||||
Vector2 pos = new(((chunkX+ i % chunkW) * tileSize.X + offsetX) * _scale,
|
||||
((chunkY + i / chunkW) * tileSize.Y + offsetY) * _scale);
|
||||
//pos *= _scale;
|
||||
Rectangle sourceRect = new(new Point((tiles[i] -1) % _columns, (tiles[i] -1) / _columns) * tileSize.ToPoint(), tileSize.ToPoint());
|
||||
Type type = Type.GetType($"DangerousD.GameCore.GameObjects.MapObjects.{tileType}");
|
||||
Activator.CreateInstance(type, pos, tileSize * _scale, sourceRect);
|
||||
|
||||
/*switch (tileType)
|
||||
{
|
||||
case "collidable":
|
||||
new StopTile(pos, tileSize * _scale, sourceRect);
|
||||
break;
|
||||
case "platform":
|
||||
new Platform(pos, tileSize * _scale, sourceRect);
|
||||
break;
|
||||
case "non_collidable":
|
||||
new Tile(pos, tileSize * _scale, sourceRect);
|
||||
break;
|
||||
}*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadTilesData()
|
||||
{
|
||||
XmlDocument xml = new();
|
||||
xml.Load($"../../../Content/map.tsx");
|
||||
XmlNode root = xml.DocumentElement;
|
||||
|
||||
_columns = int.Parse(root.Attributes["columns"].Value);
|
||||
}
|
||||
|
||||
private void InstantiateEntities(XmlNode group)
|
||||
{
|
||||
string entityType = group.Attributes["class"].Value;
|
||||
float offsetX = group.Attributes["offsetx"] is not null ? float.Parse(group.Attributes["offsetx"].Value) : 0;
|
||||
float offsetY = group.Attributes["offsety"] is not null ? float.Parse(group.Attributes["offsety"].Value) : 0;
|
||||
foreach (XmlNode entity in group.ChildNodes)
|
||||
{
|
||||
Type type = Type.GetType($"DangerousD.GameCore.GameObjects.{entityType}");
|
||||
Entity inst = (Entity)Activator.CreateInstance(type, new Vector2(float.Parse(entity.Attributes["x"].Value) + offsetX, float.Parse(entity.Attributes["y"].Value) + offsetY) * _scale);
|
||||
inst.SetPosition(new Vector2(inst.Pos.X, inst.Pos.Y - inst.Height));
|
||||
inst.Height *= _scale;
|
||||
inst.Width *= _scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,7 +136,7 @@ namespace DangerousD.GameCore.Managers
|
|||
|
||||
Rectangle rectangle;
|
||||
Vector2 distance = entity1.Pos - entity2.Pos;
|
||||
rectangle = new Rectangle((int)entity1.Pos.X, (int)entity1.Pos.Y, entity2.Width, entity2.Height);
|
||||
rectangle = new Rectangle((int)entity1.Pos.X, (int)entity1.Pos.Y - 5, entity2.Width, entity2.Height);
|
||||
GameObject gameObject = null;
|
||||
double length = distance.Length();
|
||||
|
||||
|
@ -144,30 +144,36 @@ namespace DangerousD.GameCore.Managers
|
|||
{
|
||||
rectangle.X = (int)(entity2.Pos.X + (i / length) * distance.X);
|
||||
rectangle.Y = (int)(entity2.Pos.Y + (i / length) * distance.Y);
|
||||
}
|
||||
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.entities.Count; i++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.entities[i].Rectangle.Intersects(rectangle))
|
||||
if (i == length - 1)
|
||||
{
|
||||
return AppManager.Instance.GameManager.entities[i];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.mapObjects.Count; i++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.mapObjects[i].Rectangle.Intersects(rectangle))
|
||||
for (int j = 0; j < AppManager.Instance.GameManager.entities.Count; j++)
|
||||
{
|
||||
return AppManager.Instance.GameManager.mapObjects[i];
|
||||
if (AppManager.Instance.GameManager.entities[j].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.entities[j];
|
||||
}
|
||||
}
|
||||
for (int r = 0; r < AppManager.Instance.GameManager.mapObjects.Count; r++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.mapObjects[r].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.mapObjects[r];
|
||||
}
|
||||
}
|
||||
for (int w = 0; w < AppManager.Instance.GameManager.livingEntities.Count; w++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.livingEntities[w].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.livingEntities[w];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.livingEntities.Count; i++)
|
||||
if (gameObject == entity1)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.livingEntities[i].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
return AppManager.Instance.GameManager.livingEntities[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return gameObject;
|
||||
}
|
||||
|
@ -176,35 +182,57 @@ namespace DangerousD.GameCore.Managers
|
|||
Rectangle rectangle;
|
||||
Vector2 direction = entity1.Pos - targetCast;
|
||||
rectangle = new Rectangle((int)targetCast.X, (int)targetCast.Y, 1, 1);
|
||||
GameObject gameObject = null;
|
||||
double k = direction.Length();
|
||||
|
||||
for (int i = 0; i < k; i++)
|
||||
{
|
||||
rectangle.X = (int)(targetCast.X + (i / k) * direction.X);
|
||||
rectangle.Y = (int)(targetCast.Y + (i / k) * direction.X);
|
||||
}
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.entities.Count; i++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.entities[i].Rectangle.Intersects(rectangle))
|
||||
for (int j = 0; j < AppManager.Instance.GameManager.entities.Count; j++)
|
||||
{
|
||||
return AppManager.Instance.GameManager.entities[i];
|
||||
if (AppManager.Instance.GameManager.entities[j].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.entities[j];
|
||||
}
|
||||
}
|
||||
for (int r = 0; r < AppManager.Instance.GameManager.mapObjects.Count; r++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.mapObjects[r].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.mapObjects[r];
|
||||
}
|
||||
}
|
||||
for (int w = 0; w < AppManager.Instance.GameManager.livingEntities.Count; w++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.livingEntities[w].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
gameObject = AppManager.Instance.GameManager.livingEntities[w];
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.mapObjects.Count; i++)
|
||||
if (gameObject == entity1)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.mapObjects[i].Rectangle.Intersects(rectangle))
|
||||
return null;
|
||||
}
|
||||
return gameObject;
|
||||
}
|
||||
|
||||
public List<GameObject> CheckRectangle(Rectangle rectangle, Type type)
|
||||
{
|
||||
var gameObjects = AppManager.Instance.GameManager.GetAllGameObjects;
|
||||
List<GameObject> intersected = new List<GameObject>();
|
||||
for (int i = 0; i < gameObjects.Count; i++)
|
||||
{
|
||||
if (gameObjects[i].GetType() == type)
|
||||
{
|
||||
return AppManager.Instance.GameManager.mapObjects[i];
|
||||
if (gameObjects[i].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
intersected.Add(gameObjects[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < AppManager.Instance.GameManager.livingEntities.Count; i++)
|
||||
{
|
||||
if (AppManager.Instance.GameManager.livingEntities[i].Rectangle.Intersects(rectangle))
|
||||
{
|
||||
return AppManager.Instance.GameManager.livingEntities[i];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return intersected;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,8 +38,11 @@ namespace DangerousD.GameCore
|
|||
sound.SoundEffect.IsLooped = false;
|
||||
sound.SoundEffect.Play();
|
||||
PlayingSounds.Add(sound);
|
||||
if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
|
||||
{
|
||||
AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(Vector2.Zero, soundName));
|
||||
}
|
||||
}
|
||||
|
||||
public void StartSound(string soundName, Vector2 soundPos, Vector2 playerPos) // запустить звук у которого есть позиция
|
||||
{
|
||||
var sound = new Sound(Sounds[soundName], soundPos);
|
||||
|
@ -47,6 +50,10 @@ namespace DangerousD.GameCore
|
|||
sound.SoundEffect.Volume = (float)sound.GetDistance(playerPos) / MaxSoundDistance;
|
||||
sound.SoundEffect.Play();
|
||||
PlayingSounds.Add(sound);
|
||||
if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
|
||||
{
|
||||
AppManager.Instance.NetworkManager.SendMsg(new Network.NetworkTask(soundPos, soundName));
|
||||
}
|
||||
}
|
||||
public void StopAllSounds() // остановка всех звуков
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace DangerousD.GameCore.Network
|
|||
{
|
||||
public class NetworkManager
|
||||
{
|
||||
public delegate void ReceivingHandler(NetworkTask networkTask);
|
||||
public delegate void ReceivingHandler(List<NetworkTask> networkTask);
|
||||
|
||||
public event ReceivingHandler GetReceivingMessages;
|
||||
|
||||
|
@ -21,20 +21,27 @@ namespace DangerousD.GameCore.Network
|
|||
|
||||
private void Init(string IpAddress)
|
||||
{
|
||||
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
IPAddress address = IPAddress.Parse(IpAddress);
|
||||
int port = 8000;
|
||||
endPoint = new IPEndPoint(address, port);
|
||||
try
|
||||
{
|
||||
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||
IPAddress address = IPAddress.Parse(IpAddress);
|
||||
int port = 8000;
|
||||
endPoint = new IPEndPoint(address, port);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
private void AcceptSockets()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
Socket clientSocket = socket.Accept();
|
||||
clientSockets.Add(clientSocket);
|
||||
Thread receiveThread = new Thread(BeginHostReceive);
|
||||
receiveThread.Start(clientSocket);
|
||||
Console.WriteLine("Connected");
|
||||
try
|
||||
{
|
||||
Socket clientSocket = socket.Accept();
|
||||
clientSockets.Add(clientSocket);
|
||||
Thread receiveThread = new Thread(BeginHostReceive);
|
||||
receiveThread.Start(clientSocket);
|
||||
}
|
||||
catch { }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -43,31 +50,42 @@ namespace DangerousD.GameCore.Network
|
|||
Socket clientSocket = clSocket as Socket;
|
||||
while (clientSocket != null)
|
||||
{
|
||||
byte[] bytesCount = new byte[4];
|
||||
clientSocket.Receive(bytesCount);
|
||||
byte[] Data = new byte[BitConverter.ToInt32(bytesCount)];
|
||||
StateObject so = new StateObject(clientSocket, Data);
|
||||
IAsyncResult count = clientSocket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, AsyncReceiveCallback, so);
|
||||
try
|
||||
{
|
||||
byte[] bytesCount = new byte[4];
|
||||
clientSocket.Receive(bytesCount);
|
||||
byte[] Data = new byte[BitConverter.ToInt32(bytesCount)];
|
||||
StateObject so = new StateObject(clientSocket, Data);
|
||||
IAsyncResult count = clientSocket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, AsyncReceiveCallback, so);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
public void HostInit(string IpAddress)
|
||||
{
|
||||
Init(IpAddress);
|
||||
socket.Bind(endPoint);
|
||||
socket.Listen(4);
|
||||
Thread acceptThread = new Thread(AcceptSockets);
|
||||
acceptThread.Start();
|
||||
state = "Host";
|
||||
Console.WriteLine("Start Accept");
|
||||
try
|
||||
{
|
||||
Init(IpAddress);
|
||||
socket.Bind(endPoint);
|
||||
socket.Listen(4);
|
||||
Thread acceptThread = new Thread(AcceptSockets);
|
||||
acceptThread.Start();
|
||||
state = "Host";
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
public void ClientInit(string IpAddress)
|
||||
{
|
||||
Init(IpAddress);
|
||||
socket.Connect(endPoint);
|
||||
state = "Client";
|
||||
Thread.Sleep(10);
|
||||
Thread ReceivingThread = new Thread(ReceiveMsgFromHost);
|
||||
ReceivingThread.Start();
|
||||
try
|
||||
{
|
||||
Init(IpAddress);
|
||||
socket.Connect(endPoint);
|
||||
state = "Client";
|
||||
Thread.Sleep(10);
|
||||
Thread ReceivingThread = new Thread(ReceiveMsgFromHost);
|
||||
ReceivingThread.Start();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
public void SendMsg(NetworkTask networkTask)
|
||||
{
|
||||
|
@ -75,45 +93,61 @@ namespace DangerousD.GameCore.Network
|
|||
int count = Data.Length;
|
||||
if (state == "Host")
|
||||
{
|
||||
foreach (Socket socket in clientSockets)
|
||||
try
|
||||
{
|
||||
foreach (Socket socket in clientSockets)
|
||||
{
|
||||
socket.Send(BitConverter.GetBytes(count));
|
||||
socket.Send(Data);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
socket.Send(BitConverter.GetBytes(count));
|
||||
socket.Send(Data);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
socket.Send(BitConverter.GetBytes(count));
|
||||
socket.Send(Data);
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
private void ReceiveMsgFromHost()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
byte[] bytesCount = new byte[4];
|
||||
socket.Receive(bytesCount);
|
||||
byte[] Data = new byte[BitConverter.ToInt32(bytesCount)];
|
||||
StateObject so = new StateObject(socket, Data);
|
||||
IAsyncResult count = socket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, AsyncReceiveCallback, so);
|
||||
try
|
||||
{
|
||||
byte[] bytesCount = new byte[4];
|
||||
socket.Receive(bytesCount);
|
||||
byte[] Data = new byte[BitConverter.ToInt32(bytesCount)];
|
||||
StateObject so = new StateObject(socket, Data);
|
||||
IAsyncResult count = socket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, AsyncReceiveCallback, so);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
private void AsyncReceiveCallback(IAsyncResult ar)
|
||||
{
|
||||
StateObject so = ar.AsyncState as StateObject;
|
||||
Socket clientSocket = so.workSocket;
|
||||
int readCount = clientSocket.EndReceive(ar);
|
||||
so.UploadedBytesCount += readCount;
|
||||
so.sb.Append(Encoding.Unicode.GetString(so.buffer, 0, readCount));
|
||||
if (so.UploadedBytesCount < so.bufferSize)
|
||||
try
|
||||
{
|
||||
clientSocket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, new AsyncCallback(AsyncReceiveCallback), so);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetReceivingMessages(JsonConvert.DeserializeObject<NetworkTask>(so.sb.ToString()));
|
||||
StateObject so = ar.AsyncState as StateObject;
|
||||
Socket clientSocket = so.workSocket;
|
||||
int readCount = clientSocket.EndReceive(ar);
|
||||
so.UploadedBytesCount += readCount;
|
||||
so.sb.Append(Encoding.Unicode.GetString(so.buffer, 0, readCount));
|
||||
if (so.UploadedBytesCount < so.bufferSize)
|
||||
{
|
||||
clientSocket.BeginReceive(so.buffer, 0, so.bufferSize, SocketFlags.None, new AsyncCallback(AsyncReceiveCallback), so);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetReceivingMessages(JsonConvert.DeserializeObject<List<NetworkTask>>(so.sb.ToString()));
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ namespace DangerousD.GameCore.Network
|
|||
public NetworkTaskOperationEnum operation { get; set; }
|
||||
public string name { get; set; }
|
||||
public int value { get; set; }
|
||||
public bool isParam { get; set; }
|
||||
public int objId { get; set; }
|
||||
public Vector2 position { get; set; }
|
||||
public Vector2 velocity { get; set; }
|
||||
|
@ -102,5 +103,28 @@ namespace DangerousD.GameCore.Network
|
|||
operation = NetworkTaskOperationEnum.GetClientPlayerId;
|
||||
objId = PlayerId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Универсальный конструктор для нестандартных операций. То, что не нужно(кроме операции) делать null.
|
||||
/// </summary>
|
||||
/// <param name="operation"></param>
|
||||
/// <param name="name"></param>
|
||||
/// <param name="value"></param>
|
||||
/// <param name="isParam"></param>
|
||||
/// <param name="objId"></param>
|
||||
/// <param name="position"></param>
|
||||
/// <param name="velocity"></param>
|
||||
/// <param name="type"></param>
|
||||
public NetworkTask(NetworkTaskOperationEnum operation, string name, int value, bool isParam, int objId, Vector2 position, Vector2 velocity, Type type)
|
||||
{
|
||||
this.operation = operation;
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
this.isParam = isParam;
|
||||
this.objId = objId;
|
||||
this.position = position;
|
||||
this.velocity = velocity;
|
||||
this.type = type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
6
NuGet.config
Normal file
6
NuGet.config
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="MonoGame.Extended" value="https://www.myget.org/F/lithiumtoast/api/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
Loading…
Add table
Reference in a new issue