Merge branch 'main' into livingEntitiesVlad

This commit is contained in:
N4K 2023-08-18 15:10:36 +03:00
commit 9b2a57cd85
44 changed files with 1211 additions and 398 deletions

View file

@ -21,18 +21,6 @@
/processorParam:TextureFormat=Compressed /processorParam:TextureFormat=Compressed
/build:ButtonFont.spritefont /build:ButtonFont.spritefont
#begin checkboxs_off-on.png
/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:checkboxs_off-on.png
#begin checkboxs_off.png #begin checkboxs_off.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -45,6 +33,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:checkboxs_off.png /build:checkboxs_off.png
#begin checkboxs_off-on.png
/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:checkboxs_off-on.png
#begin checkboxs_on.png #begin checkboxs_on.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -81,11 +81,24 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:deathBackground.jpg /build:deathBackground.jpg
#begin DoomTestSong.mp3 #begin DoomTestSong.mp3
/importer:Mp3Importer /importer:Mp3Importer
/processor:SoundEffectProcessor /processor:SoundEffectProcessor
/processorParam:Quality=Best /processorParam:Quality=Best
/build:DoomTestSong.mp3 /build:sounds/DoomTestSong.mp3
#begin doors.png
/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:doors.png
#begin Font_12.spritefont #begin Font_12.spritefont
/importer:FontDescriptionImporter /importer:FontDescriptionImporter
@ -187,6 +200,13 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png /build:PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png
#begin PixelFont.spritefont
/importer:FontDescriptionImporter
/processor:FontDescriptionProcessor
/processorParam:PremultiplyAlpha=True
/processorParam:TextureFormat=Compressed
/build:PixelFont.spritefont
#begin playerAnimation.png #begin playerAnimation.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -223,6 +243,30 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:sliderBackground.png /build:sliderBackground.png
#begin sounds/DoomTestSong.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:sounds/DoomTestSong.mp3
#begin sounds/shotgun_shot.mp3
/importer:Mp3Importer
/processor:SoundEffectProcessor
/processorParam:Quality=Best
/build:sounds/shotgun_shot.mp3
#begin SmokeAnimation2.png
/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:SmokeAnimation2.png
#begin textboxbackground1-1.png #begin textboxbackground1-1.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -235,18 +279,6 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:textboxbackground1-1.png /build:textboxbackground1-1.png
#begin textboxbackground2-1.png
/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:textboxbackground2-1.png
#begin textboxbackground2,5-1.png #begin textboxbackground2,5-1.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor
@ -259,6 +291,18 @@
/processorParam:TextureFormat=Color /processorParam:TextureFormat=Color
/build:textboxbackground2,5-1.png /build:textboxbackground2,5-1.png
#begin textboxbackground2-1.png
/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:textboxbackground2-1.png
#begin textboxbackground6-1.png #begin textboxbackground6-1.png
/importer:TextureImporter /importer:TextureImporter
/processor:TextureProcessor /processor:TextureProcessor

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.10.2" name="Door" tilewidth="32" tileheight="48" tilecount="2" columns="2">
<image source="door.png" width="64" height="48"/>
</tileset>

View file

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file contains an xml description of a font, and will be read by the XNA
Framework Content Pipeline. Follow the comments to customize the appearance
of the font in your game, and to change the characters which are available to draw
with.
-->
<XnaContent xmlns:Graphics="Microsoft.Xna.Framework.Content.Pipeline.Graphics">
<Asset Type="Graphics:FontDescription">
<!--
Modify this string to change the font that will be imported.
-->
<FontName>PublicPixel-z84yD.ttf</FontName>
<!--
Size is a float value, measured in points. Modify this value to change
the size of the font.
-->
<Size>12</Size>
<!--
Spacing is a float value, measured in pixels. Modify this value to change
the amount of spacing in between characters.
-->
<Spacing>0</Spacing>
<!--
UseKerning controls the layout of the font. If this value is true, kerning information
will be used when placing characters.
-->
<UseKerning>true</UseKerning>
<!--
Style controls the style of the font. Valid entries are "Regular", "Bold", "Italic",
and "Bold, Italic", and are case sensitive.
-->
<Style>Regular</Style>
<!--
If you uncomment this line, the default character will be substituted if you draw
or measure text that contains characters which were not included in the font.
-->
<!-- <DefaultCharacter>*</DefaultCharacter> -->
<!--
CharacterRegions control what letters are available in the font. Every
character from Start to End will be built and made available for drawing. The
default range is from 32, (ASCII space), to 126, ('~'), covering the basic Latin
character set. The characters are ordered according to the Unicode standard.
See the documentation for more information.
-->
<CharacterRegions>
<CharacterRegion>
<Start>&#32;</Start>
<End>&#126;</End>
</CharacterRegion>
<CharacterRegion>
<Start>&#1072;</Start>
<End>&#1103;</End>
</CharacterRegion>
</CharacterRegions>
</Asset>
</XnaContent>

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -1 +1,24 @@
{"id":"playerShootLeft","textureName":"playerAnimation","startSpriteRectangle":{"X":201,"Y":34,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":2,"isCycle":false,"offset":"4, 0"} {
"id": "playerShootLeft",
"textureName": "playerAnimation",
"startSpriteRectangle": {
"X": 201,
"Y": 34,
"Width": 32,
"Height": 32
},
"frameSecond": [
{
"Item1": 0,
"Item2": 3
},
{
"Item1": 1,
"Item2": 20
}
],
"textureFrameInterval": 1,
"framesCount": 2,
"isCycle": false,
"offset": "4, 0"
}

View file

@ -1 +1,24 @@
{"id":"playerShootRight","textureName":"playerAnimation","startSpriteRectangle":{"X":201,"Y":1,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":2,"isCycle":false,"offset":"4, 0"} {
"id": "playerShootRight",
"textureName": "playerAnimation",
"startSpriteRectangle": {
"X": 201,
"Y": 1,
"Width": 32,
"Height": 32
},
"frameSecond": [
{
"Item1": 0,
"Item2": 3
},
{
"Item1": 1,
"Item2": 20
}
],
"textureFrameInterval": 1,
"framesCount": 2,
"isCycle": false,
"offset": "4, 0"
}

View file

@ -0,0 +1 @@
{"id":"playerShootUpLeft","textureName":"playerAnimation","startSpriteRectangle":{"X":267,"Y":34,"Width":24,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}

View file

@ -0,0 +1 @@
{"id":"playerShootUpRight","textureName":"playerAnimation","startSpriteRectangle":{"X":267,"Y":1,"Width":24,"Height":32},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}

View file

@ -0,0 +1 @@
{"id":"smokeAfterShoot","textureName":"smokeAnimation2","startSpriteRectangle":{"X":0,"Y":0,"Width":64,"Height":64},"frameSecond":[{"Item1":0,"Item2":3}],"textureFrameInterval":1,"framesCount":10,"isCycle":false,"offset":"0, 0"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 472 B

View file

@ -1,7 +1,13 @@
<?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="15" nextobjectid="80">
<tileset firstgid="1" source="map.tsx"/> <tileset firstgid="1" name="map" tilewidth="16" tileheight="16" tilecount="871" columns="13">
<layer id="1" name="Collision" class="StopTile" width="30" height="20" visible="0" offsetx="-352.033" offsety="192.098"> <image source="tiles.BMP" width="208" height="1072"/>
</tileset>
<tileset firstgid="872" name="Door" tilewidth="32" tileheight="48" tilecount="2" columns="2">
<image source="doors.png" width="64" height="48"/>
</tileset>
<tileset firstgid="874" source="../../../../../Desktop/deathAnimation.tsx"/>
<layer id="1" name="Collidable" 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,
@ -31,13 +37,13 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,272,0,272,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, 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, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 272,0,0,0,0,0,0,0,272,0,0,0,0,0,0,0
</chunk> </chunk>
<chunk x="32" y="-16" width="16" height="16"> <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,
@ -135,13 +141,13 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,272,0,0,0,0,0,272,0,0,0,0,0,0,0,0,
52,52,0,0,0,0,0,52,52,52,52,52,52,52,52,52, 52,52,0,0,0,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, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,272,0,0,0,272,0,0,0,0,0,0,0,0,0,
52,52,52,0,0,0,52,52,52,52,52,52,52,52,52,52, 52,52,52,0,0,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, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -202,7 +208,7 @@
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>
<chunk x="-16" y="16" width="16" height="16"> <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,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,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,76,76,76,76,76,76,76,76,76,76,
@ -311,137 +317,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<layer id="4" name="Background 2" class="Tile" width="30" height="20" visible="0" locked="1"> <layer id="6" name="Ladders" class="Platform" width="30" height="20" visible="0" offsetx="-1" offsety="0">
<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" 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,
@ -460,13 +336,31 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,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,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
</chunk>
<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,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,696,697,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,696,697,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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>
<chunk x="32" y="0" width="16" height="16"> <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,147,199,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,
@ -478,6 +372,24 @@
0,0,0,0,0,0,0,0,0,0,0,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,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
</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,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,46,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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>
<chunk x="-16" y="16" width="16" height="16"> <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,147,199,148,0,0,0,0,0,0,0,
@ -496,6 +408,42 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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,696,697,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,696,697,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,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>
<chunk x="32" y="16" width="16" height="16"> <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,147,199,148,0,0,0,0,0,0,0,0,0,0,
@ -517,7 +465,7 @@
</chunk> </chunk>
</data> </data>
</layer> </layer>
<layer id="3" name="Backgrond" class="Tile" width="30" height="20" visible="0" locked="1" offsetx="-256.033" offsety="256.098"> <layer id="3" name="Backgrond" class="Tile" width="30" height="20" 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,
@ -543,13 +491,13 @@
29,29,29,29,0,0,157,157,167,157,157,157,157,157,260,157, 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,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,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,204,204,204,204,280,281,204,0,260,0,
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,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,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,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,204,0,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,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,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,
@ -559,15 +507,15 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,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,144,144,144, 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,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,191,192,157,157,149,152,157,157,157,157,157,157,258,
157,157,157,157,157,157,157,265,266,157,157,157,696,697,157,271, 157,157,157,157,157,157,157,150,153,157,157,157,696,697,157,271,
204,204,204,204,204,204,204,278,279,204,204,204,709,710,204,284, 204,204,204,204,204,204,204,151,154,204,204,204,709,710,204,284,
0,0,0,0,0,0,0,0,0,0,0,0,0,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,144,144,144, 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,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,258,157,157,157,149,152,157,157,157,157,
157,157,157,157,157,157,271,157,157,157,265,266,157,696,697,157, 157,157,157,157,157,157,271,157,157,157,150,153,157,0,0,157,
157,157,272,204,204,204,284,204,204,204,278,279,204,709,710,204, 157,157,0,204,204,204,284,204,204,204,151,154,204,709,710,204,
157,157,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 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,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,157,157,157,157,157,157,157,167,157,157,209,210,
@ -589,25 +537,25 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,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,144,144,144, 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, 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 224,225,157,157,149,152,157,248,249,157,157,258,157,157,157,157
</chunk> </chunk>
<chunk x="48" y="-16" width="16" height="16"> <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,
144,144,144,144,144,144,144,144,621,622,144,144,144,0,0,0, 144,144,144,144,144,144,144,144,79,80,144,144,144,0,0,0,
157,157,157,157,157,157,157,157,634,635,157,157,157,0,0,0, 157,157,157,157,157,157,157,157,92,93,157,157,157,0,0,0,
157,248,249,157,157,157,272,157,647,648,157,272,157,0,0,0, 157,248,249,157,157,157,272,157,105,106,157,272,157,0,0,0,
157,250,251,157,157,157,145,147,199,200,148,145,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, 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, 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, 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, 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, 191,192,157,157,157,157,157,256,257,157,149,152,157,0,0,0,
157,157,157,157,157,157,157,269,270,157,265,266,157,0,0,0, 157,157,157,157,157,157,157,269,270,157,150,153,157,0,0,0,
204,204,204,204,204,204,204,282,283,204,278,279,204,0,0,0, 204,204,204,204,204,204,204,282,283,204,151,154,204,0,0,0,
0,0,0,147,199,148,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,
144,144,144,147,199,148,144,144,144,144,144,144,144,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, 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 254,255,157,147,199,148,157,256,257,157,149,152,157,0,0,0
</chunk> </chunk>
<chunk x="-16" y="0" width="16" height="16"> <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,
@ -622,20 +570,20 @@
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,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,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, 29,43,44,45,0,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, 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, 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 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</chunk> </chunk>
<chunk x="0" y="0" width="16" height="16"> <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,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,160,200,161,204,204,0,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,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,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,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,180,157,149,152,157,157,157,260,157,
29,29,29,29,0,0,157,193,157,265,266,157,157,157,260,157, 29,29,29,29,0,0,157,193,157,150,153,157,157,157,260,157,
6,29,29,29,0,0,204,204,204,278,279,204,272,157,260,157, 6,29,29,29,0,0,204,204,204,151,154,204,0,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,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,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,29,0,0,157,157,157,157,157,157,157,219,220,221,
@ -646,26 +594,26 @@
0,0,0,0,0,0,0,0,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>
<chunk x="16" y="0" width="16" height="16"> <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,157,157,157,267,268,157,0,0,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,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,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,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,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,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, 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,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, 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, 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,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, 157,149,152,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, 218,150,153,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, 231,151,154,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,
0,0,0,0,0,0,0,0,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>
<chunk x="32" y="0" width="16" height="16"> <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, 237,238,157,157,150,153,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, 204,204,204,204,151,154,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, 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, 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,157,157,157,157,157,157,157,243,157,157,209,210,211,212,
@ -676,32 +624,32 @@
144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 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,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,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, 157,157,157,157,157,0,0,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, 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,
0,0,0,0,0,0,0,0,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>
<chunk x="48" y="0" width="16" height="16"> <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, 267,268,157,147,199,148,157,269,270,157,150,153,218,0,0,0,
280,281,204,160,200,161,204,282,283,204,278,279,231,0,0,0, 280,281,204,160,200,161,204,282,283,204,151,154,231,0,0,0,
0,0,0,147,199,148,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,
144,144,144,147,199,148,144,144,144,144,144,144,144,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,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,157,157,157,149,152,157,0,0,0,
157,157,157,147,199,148,157,217,157,157,265,266,157,0,0,0, 157,157,157,147,199,148,157,217,157,157,150,153,157,0,0,0,
204,204,204,160,200,161,204,230,204,204,278,279,204,0,0,0, 204,204,204,160,200,161,204,230,204,204,151,154,204,0,0,0,
0,0,0,147,199,148,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,
144,144,144,147,199,148,144,144,144,144,144,144,144,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,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, 157,171,172,173,199,174,175,176,157,157,149,152,157,0,0,0,
183,184,185,186,199,187,188,189,190,157,265,266,157,0,0,0, 183,184,185,186,199,187,188,189,190,157,150,153,157,0,0,0,
196,197,198,199,199,200,201,202,203,204,278,279,204,0,0,0, 196,197,198,199,199,200,201,202,203,204,151,154,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,
0,0,0,0,0,0,0,0,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>
</data> </data>
</layer> </layer>
<objectgroup id="8" name="Zombies" class="LivingEntities.Monsters.Zombie" visible="0"> <objectgroup id="8" name="Zombies" class="LivingEntities.Monsters.Zombie">
<object id="26" x="265" y="469.5"> <object id="26" x="265" y="469.5">
<point/> <point/>
</object> </object>
@ -756,4 +704,16 @@
<point/> <point/>
</object> </object>
</objectgroup> </objectgroup>
<objectgroup id="12" name="Doors" class="Entities.Door">
<object id="69" gid="873" x="640" y="64" width="32" height="48"/>
<object id="70" gid="872" x="672" y="192" width="32" height="48"/>
<object id="71" gid="872" x="672" y="288" width="32" height="48"/>
<object id="72" gid="872" x="672" y="480" width="32" height="48"/>
<object id="73" gid="872" x="672" y="384" width="32" height="48"/>
<object id="74" gid="872" x="320" y="288" width="32" height="48"/>
<object id="75" gid="872" x="160" y="192" width="32" height="48"/>
<object id="76" gid="872" x="112" y="96" width="32" height="48"/>
<object id="77" gid="872" x="16" y="480" width="32" height="48"/>
<object id="78" gid="872" x="-112" y="384" width="32" height="48"/>
</objectgroup>
</map> </map>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

View file

@ -1,8 +1,14 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Xml;
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;
using Microsoft.Xna.Framework.Input;
using MonogameLibrary.UI.Base; using MonogameLibrary.UI.Base;
using MonogameLibrary.UI.Elements;
namespace DangerousD.GameCore.GUI; namespace DangerousD.GameCore.GUI;
@ -10,6 +16,10 @@ public abstract class AbstractGui : IDrawableObject
{ {
protected UIManager Manager = new(); protected UIManager Manager = new();
protected List<DrawableUIElement> Elements = new(); protected List<DrawableUIElement> Elements = new();
private List<DrawableUIElement> ActiveElements;
protected DrawableUIElement SelectedElement;
private bool isStartedPrint = false;
private bool isPressed = false;
public AbstractGui() public AbstractGui()
{ {
@ -21,6 +31,16 @@ public abstract class AbstractGui : IDrawableObject
{ {
Manager.Initialize(AppManager.Instance.GraphicsDevice); Manager.Initialize(AppManager.Instance.GraphicsDevice);
CreateUI(); CreateUI();
ActiveElements = new List<DrawableUIElement>();
foreach (var element in Elements)
{
if (CheckOnBadElements(element))
{
ActiveElements.Add(element);
}
}
if (ActiveElements.Count > 0) { SelectedElement = ActiveElements.First(); }
} }
public virtual void LoadContent() public virtual void LoadContent()
@ -30,11 +50,163 @@ public abstract class AbstractGui : IDrawableObject
public virtual void Update(GameTime gameTime) public virtual void Update(GameTime gameTime)
{ {
string state = AppManager.Instance.InputManager.currentControlsState;
if (ActiveElements.Count != 0)
{
if (state == "Gamepad")
{
GamePadState gamePadState = GamePad.GetState(0);
GamepadInput(gamePadState);
}
else if (state == "Keyboard" || state == "Mouse")
{
KeyboardState keyBoardState = Keyboard.GetState();
KeyBoardInput(keyBoardState);
}
}
Manager.Update(gameTime); Manager.Update(gameTime);
if (SelectedElement is not null)
{
if (SelectedElement is Button)
{
(SelectedElement as Button).hoverState = MonogameLibrary.UI.Enums.HoverState.Hovering;
}
if (SelectedElement is ButtonText)
{
(SelectedElement as ButtonText).hoverState = MonogameLibrary.UI.Enums.HoverState.Hovering;
}
if (SelectedElement is TextBox)
{
TextBox box = (TextBox)SelectedElement;
box.hoverState = MonogameLibrary.UI.Enums.HoverState.Hovering;
if (isStartedPrint)
{
box.SelectIt();
}
}
}
} }
public virtual void Draw(SpriteBatch spriteBatch) public virtual void Draw(SpriteBatch spriteBatch)
{ {
Manager.Draw(spriteBatch); Manager.Draw(spriteBatch);
} }
protected virtual void GamepadInput(GamePadState gamePadState)
{
if (gamePadState.DPad.Up == ButtonState.Pressed && !isPressed)
{
isPressed = true;
ChangeSelectedElement(-1);
Debug.WriteLine("switch");
}
else if (gamePadState.DPad.Down == ButtonState.Pressed && !isPressed)
{
isPressed = true;
ChangeSelectedElement(1);
}
else if (gamePadState.Buttons.A == ButtonState.Pressed && !isPressed)
{
isPressed = true;
if (SelectedElement is Button)
{
Button button = SelectedElement as Button;
button.CallLeftBtnEvent();
}
else if (SelectedElement is TextBox)
{
TextBox textBox = SelectedElement as TextBox;
isStartedPrint = true;
}
}
else if (isPressed && (gamePadState.Buttons.A == ButtonState.Released &&
gamePadState.DPad.Down == ButtonState.Released &&
gamePadState.DPad.Up == ButtonState.Released))
{
isPressed = false;
}
}
protected virtual void KeyBoardInput(KeyboardState keyboardState)
{
if (keyboardState.IsKeyDown(Keys.Up) && !isPressed)
{
isPressed = true;
isStartedPrint = false;
ChangeSelectedElement(-1);
}
else if (keyboardState.IsKeyDown(Keys.Down) && !isPressed)
{
isPressed = true;
isStartedPrint = false;
ChangeSelectedElement(1);
}
else if (keyboardState.IsKeyDown(Keys.Enter) && !isPressed)
{
isPressed = true;
if (SelectedElement is Button)
{
Button button = SelectedElement as Button;
button.CallLeftBtnEvent();
}
else if (SelectedElement is TextBox)
{
TextBox textBox = SelectedElement as TextBox;
isStartedPrint = true;
}
}
else if (isPressed && (keyboardState.IsKeyUp(Keys.Enter) &&
keyboardState.IsKeyUp(Keys.Down) &&
keyboardState.IsKeyUp(Keys.Up)))
{
isPressed = false;
}
}
private void ChangeSelectedElement(int x) // Меняет выбранный элемент
{
for (int i = 0; i < ActiveElements.Count; i++)
{
if (ActiveElements[i] == SelectedElement)
{
if (i + x >= ActiveElements.Count)
{
SelectedElement = ActiveElements.First();
return;
}
else
{
if (i + x < 0)
{
SelectedElement = ActiveElements.Last();
return;
}
else
{
SelectedElement = ActiveElements[i + x];
return;
}
}
}
}
}
private bool CheckOnBadElements(DrawableUIElement element)
{
if (element is Button)
{
return true;
}
else if (element is ButtonText)
{
return true;
}
else if (element is TextBox)
{
return true;
}
else return false;
}
} }

View file

@ -13,17 +13,29 @@ internal class DeathGUI : AbstractGui
{ {
int wigth = AppManager.Instance.inGameResolution.X; int wigth = AppManager.Instance.inGameResolution.X;
int height = AppManager.Instance.inGameResolution.Y; int height = AppManager.Instance.inGameResolution.Y;
float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "deathBackground" }; var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "deathBackground" };
Elements.Add(menuBackground); Elements.Add(menuBackground);
menuBackground.LoadTexture(AppManager.Instance.Content); menuBackground.LoadTexture(AppManager.Instance.Content);
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2, (height - 50) / 2 - 80, 50, 50), text = "You death", mainColor = Color.Transparent, scale = 0.7f, fontName = "ButtonFont", fontColor = Color.White }); Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2, (height - 50) / 2 - 80, 50, 50), text = "You died", mainColor = Color.Transparent, scale = 0.7f, fontName = "ButtonFont", fontColor = Color.White });
Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2, (height - 50) / 2, 50, 50), text = $"Score = {0}", mainColor = Color.Transparent, scale = 0.7f, fontName = "ButtonFont", fontColor = Color.White }); Elements.Add(new Label(Manager) { rectangle = new Rectangle((wigth - 50) / 2, (height - 50) / 2, 50, 50), text = $"Score: {0}", mainColor = Color.Transparent, scale = 0.7f, fontName = "ButtonFont", fontColor = Color.White });
var butMenu = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, (height - 50) / 2 + 80, 300, 50), text = "Back to menu", scale = 0.7f, fontName = "ButtonFont" }; var butMenu = new ButtonText(Manager) { rectangle = new Rectangle((wigth - 300) / 2, (height - 50) / 2 + 80, 300, 50), text = "Back to menu", scale = 0.7f, fontName = "ButtonFont" };
Elements.Add(butMenu); Elements.Add(butMenu);
butMenu.LeftButtonPressed += () => butMenu.LeftButtonPressed += () =>
{ {
AppManager.Instance.ChangeGameState(GameState.Menu); AppManager.Instance.ChangeGameState(GameState.Menu);
}; };
foreach (var item in Elements)
{
item.rectangle.X = (int)(scaler * item.rectangle.X);
item.rectangle.Y = (int)(scaler * item.rectangle.Y);
item.rectangle.Width = (int)(scaler * item.rectangle.Width);
item.rectangle.Height = (int)(scaler * item.rectangle.Height);
if (item is DrawableTextedUiElement)
{
(item as DrawableTextedUiElement).scale *= scaler;
}
}
} }
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)

View file

@ -6,34 +6,80 @@ using System.Xml.Linq;
using DangerousD.GameCore.Managers; using DangerousD.GameCore.Managers;
using DangerousD.GameCore; using DangerousD.GameCore;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;
using static System.Formats.Asn1.AsnWriter;
using static System.Net.Mime.MediaTypeNames;
namespace DangerousD.GameCore.GUI namespace DangerousD.GameCore.GUI
{ {
public class HUD : AbstractGui public class HUD : IDrawableObject
{ {
List<Rect> rects = new List<Rect> { };
int wigth = AppManager.Instance.inGameResolution.X; int wigth = AppManager.Instance.inGameResolution.X;
int height = AppManager.Instance.inGameResolution.Y; int height = AppManager.Instance.inGameResolution.Y;
protected override void CreateUI() float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
{ Texture2D texture;
DrawableUIElement background = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), mainColor = Color.Transparent }; SpriteFont spriteFont;
Elements.Add(background);
Rect rect = new Rect(Manager) { rectangle = new Rectangle(wigth / 35, height / 35, 120, 70), mainColor = Color.DarkRed };
Elements.Add(rect);
Label label = new Label(Manager) { rectangle = new Rectangle(wigth / 34, height / 30, 120, 20), text = "ammout", fontName = "font2", scale = 0.2f, mainColor = Color.Transparent, fontColor = Color.Black };
Elements.Add(label);
} public void Draw(SpriteBatch spriteBatch)
public override void Update(GameTime gameTime)
{ {
rects.Clear(); spriteBatch.Begin();
for (int i = 0; i < AppManager.Instance.GameManager.GetPlayer1.Bullets; i++) spriteBatch.Draw(texture, new Rectangle(wigth / 35 - 2, height / 35 - 2, 120 + 2, 70 + 2), Color.DarkRed);
spriteBatch.DrawString(spriteFont, "AMMO", new Vector2(wigth / 34 + 4, height / 30 - 6), Color.Gray, 0, Vector2.Zero, 1.8f, SpriteEffects.None, 0);
spriteBatch.DrawString(spriteFont, "AMMO", new Vector2(wigth / 34 + 1, height / 30 - 6), Color.White, 0, Vector2.Zero, 1.8f, SpriteEffects.None, 0);
for (int i = 1; i < 6; i++)
{ {
rects.Add(new Rect(Manager) { rectangle = new Rectangle(wigth / 29 + i * 13, height / 17, 5, 20), mainColor = Color.Yellow }); if (i <= AppManager.Instance.GameManager.players[0].Bullets)
rects[i].LoadTexture(AppManager.Instance.Content); {
spriteBatch.Draw(texture, new Rectangle(wigth / 30 + i * 13 + 2, height / 17 + 4, 5, 20), new Color(0.8f, 0.8f, 0, 1f));
spriteBatch.Draw(texture, new Rectangle(wigth / 30 + i * 13, height / 17 + 4, 5, 20), Color.Yellow);
} }
base.Update(gameTime); else
{
spriteBatch.Draw(texture, new Rectangle(wigth / 30 + i * 13, height / 17 + 4, 7, 20), new Color(0.2f, 0.2f, 0, 1f));
} }
} }
spriteBatch.End();
}
public void Initialize()
{
}
public void LoadContent()
{
texture = new Texture2D(AppManager.Instance.GraphicsDevice, 1, 1);
texture.SetData<Color>(new Color[] { Color.White });
spriteFont = AppManager.Instance.Content.Load<SpriteFont>("PixelFont");
}
public void Update(GameTime gameTime)
{
}
}
//public class HUD1 : AbstractGui
//{
//
// protected override void CreateUI()
// {
// DrawableUIElement background = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), mainColor = Color.Transparent };
// Elements.Add(background);
// Rect rect = new Rect(Manager) { rectangle = new Rectangle(wigth / 35, height / 35, 120, 70), mainColor = Color.DarkRed };
// Elements.Add(rect);
// Label label = new Label(Manager) { rectangle = new Rectangle(wigth / 34, height / 30, 120, 20), text = "ammout", fontName = "font2", scale = 0.2f, mainColor = Color.Transparent, fontColor = Color.Black };
// Elements.Add(label);
// }
// public override void Update(GameTime gameTime)
// {
//
// rects.Clear();
// for (int i = 0; i < ammout; i++)
// {
// rects.Add(new Rect(Manager) { rectangle = new Rectangle(wigth / 29 + i * 13, height / 17, 5, 20), mainColor = Color.Yellow });
// rects[i].LoadTexture(AppManager.Instance.Content);
// }
// base.Update(gameTime);
// }
//}
} }

View file

@ -25,6 +25,7 @@ namespace DangerousD.GameCore.GUI
{ {
int screenWidth = AppManager.Instance.inGameResolution.X; int screenWidth = AppManager.Instance.inGameResolution.X;
int screenHeight = AppManager.Instance.inGameResolution.Y; int screenHeight = AppManager.Instance.inGameResolution.Y;
float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
var lobbyBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, screenWidth, screenHeight), textureName = "menuFon3" }; var lobbyBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, screenWidth, screenHeight), textureName = "menuFon3" };
Elements.Add(lobbyBackground); Elements.Add(lobbyBackground);
@ -51,6 +52,7 @@ namespace DangerousD.GameCore.GUI
textureName = "textboxbackground6-1" textureName = "textboxbackground6-1"
}; };
Elements.Add(searchBarTextBox);
searchBarTextBox.TextChanged += input => { searchBarTextBox.TextChanged += input => {
if (searchBarTextBox.fontColor == Color.Gray) if (searchBarTextBox.fontColor == Color.Gray)
{ {
@ -73,6 +75,7 @@ namespace DangerousD.GameCore.GUI
fontName = "font2", fontName = "font2",
textureName = "textboxbackground1-1" textureName = "textboxbackground1-1"
}; };
Elements.Add(backButton);
backButton.LeftButtonPressed += () => { backButton.LeftButtonPressed += () => {
AppManager.Instance.ChangeGameState(GameState.Menu); AppManager.Instance.ChangeGameState(GameState.Menu);
}; };
@ -86,6 +89,7 @@ namespace DangerousD.GameCore.GUI
fontName = "buttonFont", fontName = "buttonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(hostButton);
hostButton.LeftButtonPressed += () => { hostButton.LeftButtonPressed += () => {
AppManager.Instance.ChangeGameState(GameState.Game); AppManager.Instance.ChangeGameState(GameState.Game);
AppManager.Instance.NetworkManager.HostInit(AppManager.Instance.IpAddress); AppManager.Instance.NetworkManager.HostInit(AppManager.Instance.IpAddress);
@ -101,6 +105,7 @@ namespace DangerousD.GameCore.GUI
fontName = "buttonFont", fontName = "buttonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(refreshButton);
refreshButton.LeftButtonPressed += () => { refreshButton.LeftButtonPressed += () => {
}; };
@ -114,6 +119,7 @@ namespace DangerousD.GameCore.GUI
fontName = "buttonFont", fontName = "buttonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(joinSelectedButton);
joinSelectedButton.LeftButtonPressed += () => { joinSelectedButton.LeftButtonPressed += () => {
AppManager.Instance.ChangeGameState(GameState.Game); AppManager.Instance.ChangeGameState(GameState.Game);
AppManager.Instance.NetworkManager.ClientInit(AppManager.Instance.IpAddress); AppManager.Instance.NetworkManager.ClientInit(AppManager.Instance.IpAddress);
@ -127,10 +133,25 @@ namespace DangerousD.GameCore.GUI
fontName = "buttonFont", fontName = "buttonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(joinByIpButton);
joinByIpButton.LeftButtonPressed += () => { joinByIpButton.LeftButtonPressed += () => {
AppManager.Instance.NetworkManager.ClientInit(searchBarTextBox.text); AppManager.Instance.NetworkManager.ClientInit(searchBarTextBox.text);
}; };
} }
foreach (var item in Elements)
{
item.rectangle.X = (int)(scaler * item.rectangle.X);
item.rectangle.Y = (int)(scaler * item.rectangle.Y);
item.rectangle.Width = (int)(scaler * item.rectangle.Width);
item.rectangle.Height = (int)(scaler * item.rectangle.Height);
if (item is DrawableTextedUiElement)
{
(item as DrawableTextedUiElement).scale *= scaler;
}
}
} }
} }
} }

View file

@ -26,6 +26,7 @@ namespace DangerousD.GameCore.GUI
{ {
int screenWidth = AppManager.Instance.inGameResolution.X; int screenWidth = AppManager.Instance.inGameResolution.X;
int screenHeight = AppManager.Instance.inGameResolution.Y; int screenHeight = AppManager.Instance.inGameResolution.Y;
float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
var loginBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, screenWidth, screenHeight), textureName = "menuFon2" }; var loginBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, screenWidth, screenHeight), textureName = "menuFon2" };
Elements.Add(loginBackground); Elements.Add(loginBackground);
@ -40,6 +41,19 @@ namespace DangerousD.GameCore.GUI
fontName = "ButtonFont" fontName = "ButtonFont"
}); });
Button backButton = new Button(Manager)
{
rectangle = new Rectangle(screenWidth / 20, screenHeight / 15, (int)(40 * 2.4), (int)(40 * 2.4)),
fontColor = Color.Black,
fontName = "font2",
textureName = "textboxbackground1-1"
};
backButton.LeftButtonPressed += () => {
AppManager.Instance.ChangeGameState(GameState.Menu);
};
Elements.Add(backButton);
// TextBox-ы // TextBox-ы
{ {
TextBox loginTextBox = new TextBox(Manager) TextBox loginTextBox = new TextBox(Manager)
@ -53,6 +67,7 @@ namespace DangerousD.GameCore.GUI
textureName = "textboxbackground6-1" textureName = "textboxbackground6-1"
}; };
Elements.Add(loginTextBox);
loginTextBox.LoadTexture(AppManager.Instance.Content); loginTextBox.LoadTexture(AppManager.Instance.Content);
loginTextBox.TextChanged += input => { loginTextBox.TextChanged += input => {
if (loginTextBox.fontColor == Color.Gray) if (loginTextBox.fontColor == Color.Gray)
@ -67,6 +82,7 @@ namespace DangerousD.GameCore.GUI
loginTextBox.fontColor = Color.Gray; loginTextBox.fontColor = Color.Gray;
} }
}; };
Elements.Add(loginTextBox);
TextBox passwordTextBox = new TextBox(Manager) TextBox passwordTextBox = new TextBox(Manager)
{ {
@ -78,6 +94,7 @@ namespace DangerousD.GameCore.GUI
textAligment = TextAligment.Left, textAligment = TextAligment.Left,
textureName = "textboxbackground6-1" textureName = "textboxbackground6-1"
}; };
Elements.Add(passwordTextBox);
passwordTextBox.LoadTexture(AppManager.Instance.Content); passwordTextBox.LoadTexture(AppManager.Instance.Content);
passwordTextBox.TextChanged += input => { passwordTextBox.TextChanged += input => {
if (passwordTextBox.fontColor == Color.Gray) if (passwordTextBox.fontColor == Color.Gray)
@ -92,6 +109,7 @@ namespace DangerousD.GameCore.GUI
passwordTextBox.fontColor = Color.Gray; passwordTextBox.fontColor = Color.Gray;
} }
}; };
Elements.Add(passwordTextBox);
} }
// Кнопки // Кнопки
@ -104,12 +122,14 @@ namespace DangerousD.GameCore.GUI
fontName = "ButtonFont", fontName = "ButtonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(logButton);
logButton.LeftButtonPressed += () => { logButton.LeftButtonPressed += () => {
if (CheckUser()) if (CheckUser())
{ {
AppManager.Instance.ChangeGameState(GameState.Lobby); AppManager.Instance.ChangeGameState(GameState.Lobby);
} }
}; };
Elements.Add(logButton);
Button regButton = new Button(Manager) Button regButton = new Button(Manager)
{ {
@ -120,20 +140,22 @@ namespace DangerousD.GameCore.GUI
fontName = "ButtonFont", fontName = "ButtonFont",
textureName = "textboxbackground2-1" textureName = "textboxbackground2-1"
}; };
Elements.Add(regButton);
regButton.LeftButtonPressed += GoToRegWebServer; regButton.LeftButtonPressed += GoToRegWebServer;
Elements.Add(regButton);
Button backButton = new Button(Manager)
}
foreach (var item in Elements)
{ {
rectangle = new Rectangle(screenWidth / 20, screenHeight / 15, (int)(40 * 2.4), (int)(40 * 2.4)), item.rectangle.X = (int)(scaler * item.rectangle.X);
text = "<-", item.rectangle.Y = (int)(scaler * item.rectangle.Y);
scale = 0.72f, item.rectangle.Width = (int)(scaler * item.rectangle.Width);
fontColor = Color.Black, item.rectangle.Height = (int)(scaler * item.rectangle.Height);
fontName = "font2", if (item is DrawableTextedUiElement)
textureName = "textboxbackground1-1" {
}; (item as DrawableTextedUiElement).scale *= scaler;
backButton.LeftButtonPressed += () => { }
AppManager.Instance.ChangeGameState(GameState.Menu);
};
} }
} }

View file

@ -22,8 +22,9 @@ internal class MenuGUI : AbstractGui
List<Vector2> BigLetterPositions = new List<Vector2>(); List<Vector2> BigLetterPositions = new List<Vector2>();
protected override void CreateUI() protected override void CreateUI()
{ {
int wigth = AppManager.Instance.inGameResolution.X; int wigth = AppManager.Instance.inGameHUDHelperResolution.X;
int height = AppManager.Instance.inGameResolution.Y; int height = AppManager.Instance.inGameHUDHelperResolution.Y;
float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "menuFon" }; var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "menuFon" };
Elements.Add(menuBackground); Elements.Add(menuBackground);
@ -50,6 +51,7 @@ internal class MenuGUI : AbstractGui
{ {
AppManager.Instance.ChangeGameState(GameState.Game); AppManager.Instance.ChangeGameState(GameState.Game);
AppManager.Instance.SetMultiplayerState(MultiPlayerStatus.SinglePlayer); AppManager.Instance.SetMultiplayerState(MultiPlayerStatus.SinglePlayer);
}; };
var butMulti = new ButtonText(Manager) { rectangle = new Rectangle((wigth - (int)(300 * 2.4)) / 2, 470, (int)(300 * 2.4), (int)(50 * 2.4)), text = "Multiplayer", scale = 1.2f, fontName = "ButtonFont" }; var butMulti = new ButtonText(Manager) { rectangle = new Rectangle((wigth - (int)(300 * 2.4)) / 2, 470, (int)(300 * 2.4), (int)(50 * 2.4)), text = "Multiplayer", scale = 1.2f, fontName = "ButtonFont" };
@ -72,6 +74,18 @@ internal class MenuGUI : AbstractGui
{ {
AppManager.Instance.Exit(); AppManager.Instance.Exit();
}; };
foreach ( var item in Elements)
{
item.rectangle.X = (int)(scaler * item.rectangle.X);
item.rectangle.Y = (int)(scaler * item.rectangle.Y);
item.rectangle.Width = (int)(scaler * item.rectangle.Width);
item.rectangle.Height = (int)(scaler * item.rectangle.Height);
if (item is DrawableTextedUiElement)
{
(item as DrawableTextedUiElement).scale *= scaler;
}
}
} }

View file

@ -13,10 +13,11 @@ namespace DangerousD.GameCore.GUI
int selectedGUI = 0; int selectedGUI = 0;
protected override void CreateUI() protected override void CreateUI()
{ {
int wigth = AppManager.Instance.inGameResolution.X; int wigth = AppManager.Instance.inGameHUDHelperResolution.X;
int height = AppManager.Instance.inGameResolution.Y; int height = AppManager.Instance.inGameHUDHelperResolution.Y;
float scaler = AppManager.Instance.resolution.Y / (float)AppManager.Instance.inGameHUDHelperResolution.Y;
var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "optionsBackground" }; var menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, wigth, height), textureName = "optionsBackground" };
Elements.Add(menuBackground); //Elements.Add(menuBackground);
menuBackground.LoadTexture(AppManager.Instance.Content); menuBackground.LoadTexture(AppManager.Instance.Content);
var slider = new Slider(Manager) var slider = new Slider(Manager)
@ -27,6 +28,8 @@ namespace DangerousD.GameCore.GUI
indentation = 5, indentation = 5,
textureName = "sliderBackground" textureName = "sliderBackground"
}; };
//Elements.Add(slider);
//AppManager.Instance.SettingsManager.SetMainVolume(slider.GetSliderValue);
var cB = new CheckBox(Manager); var cB = new CheckBox(Manager);
cB.rectangle = new Rectangle(wigth / 2 + 440, 405, (int)(40 * 2.4), (int)(40 * 2.4)); cB.rectangle = new Rectangle(wigth / 2 + 440, 405, (int)(40 * 2.4), (int)(40 * 2.4));
@ -35,14 +38,16 @@ namespace DangerousD.GameCore.GUI
SettingsManager sM = new SettingsManager(); SettingsManager sM = new SettingsManager();
}; };
cB.LoadTexture(AppManager.Instance.Content); cB.LoadTexture(AppManager.Instance.Content);
Elements.Add(cB);
var checkBox = new CheckBox(Manager); var checkBox = new CheckBox(Manager);
checkBox.rectangle = new Rectangle(wigth / 2 + 360, 540, (int)(40 * 2.4), (int)(40 * 2.4)); checkBox.rectangle = new Rectangle(wigth / 2 + 360, 540, (int)(40 * 2.4), (int)(40 * 2.4));
checkBox.Checked += (newCheckState) => checkBox.Checked += (newCheckState) =>
{ {
SettingsManager sM = new SettingsManager(); AppManager.Instance.SettingsManager.SetIsFullScreen(newCheckState);
}; };
checkBox.LoadTexture(AppManager.Instance.Content); checkBox.LoadTexture(AppManager.Instance.Content);
Elements.Add(checkBox);
Label lblOptions = new Label(Manager) Label lblOptions = new Label(Manager)
{ fontName = "buttonFont", scale = 1.2f, text = "Options", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 40, 50, 50), mainColor = Color.Transparent }; { fontName = "buttonFont", scale = 1.2f, text = "Options", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 40, 50, 50), mainColor = Color.Transparent };
@ -54,7 +59,7 @@ namespace DangerousD.GameCore.GUI
Label lblIsFullScreen = new Label(Manager) Label lblIsFullScreen = new Label(Manager)
{ fontName = "buttonFont", scale = 1f , text = "Full Screen", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 580, 50, 50), mainColor = Color.Transparent }; { fontName = "buttonFont", scale = 1f , text = "Full Screen", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 580, 50, 50), mainColor = Color.Transparent };
Elements.Add(lblOptions); Elements.Add(lblIsFullScreen);
Label lblSwitchMode = new Label(Manager) Label lblSwitchMode = new Label(Manager)
{ fontName = "buttonFont", scale = 1f, text = "Left/Right Mode", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 415, 50, 50), mainColor = Color.Transparent }; { fontName = "buttonFont", scale = 1f, text = "Left/Right Mode", fontColor = Color.White, rectangle = new Rectangle((wigth - 50) / 2, 415, 50, 50), mainColor = Color.Transparent };
@ -67,6 +72,26 @@ namespace DangerousD.GameCore.GUI
{ {
AppManager.Instance.ChangeGameState(GameState.Menu); AppManager.Instance.ChangeGameState(GameState.Menu);
}; };
foreach (var item in Elements)
{
item.rectangle.X = (int)(scaler * item.rectangle.X);
item.rectangle.Y = (int)(scaler * item.rectangle.Y);
item.rectangle.Width = (int)(scaler * item.rectangle.Width);
item.rectangle.Height = (int)(scaler * item.rectangle.Height);
if (item is DrawableTextedUiElement)
{
(item as DrawableTextedUiElement).scale *= scaler;
}
}
slider.rectangle.X = (int)(scaler * slider.rectangle.X);
slider.rectangle.Y = (int)(scaler * slider.rectangle.Y);
//slider.rectangle.Width = (int)(scaler * slider.rectangle.Width);
//slider.rectangle.Height = (int)(scaler * slider.rectangle.Height);
if (slider is DrawableTextedUiElement)
{
(slider as DrawableTextedUiElement).scale *= scaler;
}
} }
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {

View file

@ -6,21 +6,34 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Xna.Framework.Graphics;
namespace DangerousD.GameCore.GameObjects.Entities namespace DangerousD.GameCore.GameObjects.Entities
{ {
public class Door : Entity public class Door : Entity
{ {
public Door(Vector2 position) : base(position) private Rectangle _sourceRectangle;
public Door(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position)
{ {
_sourceRectangle = sourceRectangle;
Width = (int)size.X;
Height = (int)size.Y;
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SilasBallMove" }, "SilasBallMove"); protected override GraphicsComponent GraphicsComponent { get; } = new("doors");
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {
base.Update(gameTime); base.Update(gameTime);
} }
public override void Draw(SpriteBatch spriteBatch)
{
GraphicsComponent.DrawAnimation(Rectangle, spriteBatch, _sourceRectangle);
//spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.White);
}
public override void OnCollision(GameObject gameObject) public override void OnCollision(GameObject gameObject)
{ {
base.OnCollision(gameObject); base.OnCollision(gameObject);

View file

@ -0,0 +1,13 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.Entities.Items;
public class Coin : Entity
{
public Coin(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; }
}

View file

@ -0,0 +1,13 @@
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.Entities.Items;
public class Diamond : Entity
{
public Diamond(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; }
}

View file

@ -30,6 +30,7 @@ namespace DangerousD.GameCore
LoadContent(); LoadContent();
AppManager.Instance.GameManager.Register(this); AppManager.Instance.GameManager.Register(this);
GraphicsComponent.parentId = id;
} }
public virtual void OnCollision(GameObject gameObject) public virtual void OnCollision(GameObject gameObject)
@ -68,5 +69,9 @@ namespace DangerousD.GameCore
} }
} }
public GraphicsComponent GetGraphicsComponent()
{
return this.GraphicsComponent;
}
} }
} }

View file

@ -12,7 +12,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
public class Slime : CoreEnemy public class Slime : CoreEnemy
{ {
private bool isDown = false;
private bool isGoRight = true;
private bool isDown = true;
int leftBorder; int leftBorder;
int rightBorder; int rightBorder;
bool isAttaking = false; bool isAttaking = false;
@ -29,6 +32,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
rightBorder = 400; rightBorder = 400;
//acceleration = Vector2.Zero; //acceleration = Vector2.Zero;
delay = 30; delay = 30;
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SlimeMoveLeftTop", "SlimeMoveLeftBottom", "SlimeMoveRightTop", protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "SlimeMoveLeftTop", "SlimeMoveLeftBottom", "SlimeMoveRightTop",
@ -39,11 +43,12 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
} }
public void Jump() public void Jump(GameTime gameTime)
{ {
var getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle(0, 0, 100, 100)); var getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle(0, 0, 100, 100));
velocity.X = 0; velocity.X = 0;
Height = 32; Height = 32;
if (isGoRight && isDown) if (isGoRight && isDown)
{ {
if (GraphicsComponent.GetCurrentAnimation != "SlimeReadyJumpLeftBottom") if (GraphicsComponent.GetCurrentAnimation != "SlimeReadyJumpLeftBottom")
@ -53,8 +58,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
delay--; delay--;
if (delay <= 0) if (delay <= 0)
{ {
isJumping = true;
velocity = new Vector2(5, -3); velocity = new Vector2(5, -4);
acceleration.Y = 0;
if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpLeftBottom") if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpLeftBottom")
{ {
GraphicsComponent.StartAnimation("SlimeJumpLeftBottom"); GraphicsComponent.StartAnimation("SlimeJumpLeftBottom");
@ -64,29 +71,33 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
isJumping = false; isJumping = false;
isDown = false; isDown = false;
isAttaking = false;
} }
} }
} }
else if (!isGoRight && isDown) else if (!isGoRight && isDown)
{ {
if (GraphicsComponent.GetCurrentAnimation != "SlimeReadyJumpRightTop") if (GraphicsComponent.GetCurrentAnimation != "SlimeReadyJumpRightBottom")
{ {
GraphicsComponent.StartAnimation("SlimeReadyJumpRightTop"); GraphicsComponent.StartAnimation("SlimeReadyJumpRightBottom");
} }
delay--; delay--;
if (delay <= 0) if (delay <= 0)
{ {
velocity = new Vector2(-5, -3);
if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpRightTop") velocity = new Vector2(-5, -4);
acceleration.Y = 0;
if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpRightBottom")
{ {
GraphicsComponent.StartAnimation("SlimeJumpRightTop"); GraphicsComponent.StartAnimation("SlimeJumpRightBottom");
} }
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y - 5, 48, 5)); getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y - 5, 48, 5));
if (getCols.Count > 0) if (getCols.Count > 0)
{ {
isJumping = false; isJumping = false;
isDown = false; isDown = false;
isAttaking = false;
} }
} }
} }
@ -100,17 +111,23 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
delay--; delay--;
if (delay <= 0) if (delay <= 0)
{ {
isJumping = true;
velocity = new Vector2(5, 3); velocity = new Vector2(5, 4);
acceleration.Y = 0;
if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpLeftTop") if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpLeftTop")
{ {
GraphicsComponent.StartAnimation("SlimeJumpLeftTop"); GraphicsComponent.StartAnimation("SlimeJumpLeftTop");
} }
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y + Height, 48, 5)); getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X+1, (int)Pos.Y + Height, 46, 5));
if (getCols.Count > 0 ) if (getCols.Count > 0 )
{ {
isJumping = false; isJumping = false;
isDown = true; isDown = true;
isAttaking = false;
acceleration.Y = 10;
Move(gameTime);
} }
} }
@ -124,27 +141,34 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
delay--; delay--;
if (delay <= 0) if (delay <= 0)
{ {
velocity = new Vector2(-5, 3); velocity = new Vector2(-5, 4);
acceleration.Y = 0;
if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpRightTop") if (GraphicsComponent.GetCurrentAnimation != "SlimeJumpRightTop")
{ {
GraphicsComponent.StartAnimation("SlimeJumpRightTop"); GraphicsComponent.StartAnimation("SlimeJumpRightTop");
} }
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y + Height, 48, 5)); getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X+1, (int)Pos.Y + Height, 46, 5));
if (getCols.Count > 0 ) if (getCols.Count > 0 )
{ {
isJumping = false; isJumping = false;
isDown = true; isDown = true;
isAttaking = false;
acceleration.Y = 10;
Move(gameTime);
} }
} }
} }
} }
public override void Draw(SpriteBatch spriteBatch) public override void Draw(SpriteBatch spriteBatch)
{ {
spriteBatch.Draw(debugTexture, new Rectangle((int)Pos.X, (int)Pos.Y - 5, 48, 5), Color.White);
spriteBatch.Draw(debugTexture, new Rectangle((int)Pos.X, (int)Pos.Y + Height, 48, 5), Color.White);
base.Draw(spriteBatch); base.Draw(spriteBatch);
} }
public override void Death() public override void Death()
@ -196,15 +220,24 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
velocity.X = -monster_speed; velocity.X = -monster_speed;
} }
var getCols= AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y + Height / 2 - 2, 50, 2)); ;
if (Pos.X >= rightBorder) if (isGoRight)
{ {
isGoRight = false; getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y + Height / 2 - 2, 51, 2));
}
else
{
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X-3, (int)Pos.Y + Height / 2 - 2, 51, 2));
} }
else if (Pos.X <= leftBorder)
foreach(var item in getCols)
{ {
isGoRight = true; if(item is MapObject)
{
isGoRight = !isGoRight;
break;
}
} }
} }
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
@ -226,7 +259,26 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
acceleration.Y = -acceleration.Y; acceleration.Y = -acceleration.Y;
} }
} }
//if (!isAttaking){ Move(gameTime); } AppManager.Instance.DebugHUD.Set(name, isAttaking.ToString());
if(!isJumping)
{
if (isDown)
{
Jump(gameTime);
}
else if(IsInAim())
{
Jump(gameTime);
isAttaking = true;
}
else if(!isAttaking)
{
Move(gameTime);
}
else { Jump(gameTime); }
}
base.Update(gameTime); base.Update(gameTime);
@ -236,10 +288,65 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
} }
public bool IsInAim()
{
var getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)Pos.Y + Height, 48, 5));
if (isGoRight && !isDown)
{
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X + Width, (int)Pos.Y + Height, 200, 500), false);
if (getCols.Count > 0)
{
return true;
}
}
else if (!isGoRight && !isDown)
{
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 200, (int)Pos.Y + Height, 200, 500), false);
if (getCols.Count > 0)
{
return true;
}
}
/*/else if (isGoRight && isDown)
{
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X +Width, (int)Pos.Y -500, 200, 500), false);
if (getCols.Count > 0)
{
isAttaking = true;
return true;
}
}
else if (!isGoRight && isDown)
{
getCols = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 200, (int)Pos.Y - 500, 200, 500), false);
if (getCols.Count > 0)
{
isAttaking = true;
return true;
}
}/*/
return false;
}
public override void Attack(GameTime gameTime) public override void Attack(GameTime gameTime)
{ {
} }
public override void OnCollision(GameObject gameObject)
{
if (gameObject is Player)
{
if (AppManager.Instance.GameManager.players[0].IsAlive)
{
AppManager.Instance.GameManager.players[0].Death(name);
}
}
base.OnCollision(gameObject);
}
} }
} }

View file

@ -38,6 +38,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
widthS = Width; widthS = Width;
web = new SpiderWeb(new Vector2(Pos.X+Width/2,Pos.Y)); web = new SpiderWeb(new Vector2(Pos.X+Width/2,Pos.Y));
delay = 0; delay = 0;
web = new SpiderWeb(new Vector2(Pos.X-Width/2,Pos.Y));
webLength = 0; webLength = 0;
monster_speed = 3; monster_speed = 3;
acceleration = new Vector2(0, -50); acceleration = new Vector2(0, -50);

View file

@ -8,6 +8,7 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using DangerousD.GameCore.Managers; using DangerousD.GameCore.Managers;
using DangerousD.GameCore.GameObjects;
namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
@ -24,7 +25,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
Width = 24; Width = 24;
Height = 40; Height = 40;
monster_speed = 3; monster_speed = 2;
name = "Zombie"; name = "Zombie";
monster_health = 2; monster_health = 2;
leftBorder = (int)position.X - 100; leftBorder = (int)position.X - 100;
@ -39,6 +40,14 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
isGoRight = false; isGoRight = false;
} }
this.GraphicsComponent.actionOfAnimationEnd += (a) =>
{
if (a == "ZombieRightAttack" || a == "ZombieLeftAttack")
{
isAttaking = false;
}
};
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack" }, "ZombieMoveLeft"); protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack" }, "ZombieMoveLeft");
@ -90,19 +99,13 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
{ {
if (isGoRight) if (isGoRight)
{ {
if (GraphicsComponent.GetCurrentAnimation != "ZombieMoveRight") StartCicycleAnimation("ZombieMoveRight");
{
GraphicsComponent.StartAnimation("ZombieMoveRight");
}
velocity.X = monster_speed; velocity.X = monster_speed;
} }
else if (!isGoRight) else if (!isGoRight)
{ {
if (GraphicsComponent.GetCurrentAnimation != "ZombieMoveLeft") StartCicycleAnimation("ZombieMoveLeft");
{
GraphicsComponent.StartAnimation("ZombieMoveLeft");
}
velocity.X = -monster_speed; velocity.X = -monster_speed;
} }
@ -123,6 +126,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
if (AppManager.Instance.GameManager.players[0].IsAlive) if (AppManager.Instance.GameManager.players[0].IsAlive)
{ {
Attack(); Attack();
} }
} }
base.OnCollision(gameObject); base.OnCollision(gameObject);
@ -130,19 +134,19 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
public override void Target() public override void Target()
{ {
if (AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 50, (int)Pos.Y, Width + 100, Height), typeof(Player)).Count > 0) if (AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - 50, (int)Pos.Y, Width + 200, Height), typeof(Player)).Count > 0)
{ {
if(isGoRight && this._pos.X <= AppManager.Instance.GameManager.players[0].Pos.X) if(isGoRight && this._pos.X <= AppManager.Instance.GameManager.players[0].Pos.X)
{ {
isTarget = true; isTarget = true;
leftBorder = Pos.X - 10; leftBorder = Pos.X - 100;
rightBorder = Pos.X + AppManager.Instance.GameManager.players[0].Pos.X; rightBorder = Pos.X + AppManager.Instance.GameManager.players[0].Pos.X;
} }
else if(!isGoRight && this._pos.X >= AppManager.Instance.GameManager.players[0].Pos.X) else if(!isGoRight && this._pos.X >= AppManager.Instance.GameManager.players[0].Pos.X)
{ {
isTarget = true; isTarget = true;
rightBorder = Pos.X + 10; rightBorder = Pos.X + 100;
leftBorder = AppManager.Instance.GameManager.players[0].Pos.X; leftBorder = AppManager.Instance.GameManager.players[0].Pos.X;
} }
} }
@ -158,6 +162,15 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
rightBorder = 760; rightBorder = 760;
} }
} }
public void SwitchToRight()
{
isGoRight = true;
}
public void SwitchToLeft()
{
isGoRight = false;
}
public override void Attack(GameTime gameTime) public override void Attack(GameTime gameTime)
{} {}

View file

@ -12,29 +12,58 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public class Particle : LivingEntity public class Particle : LivingEntity
{ {
int delay; int delay;
bool isFall;
public Particle(Vector2 position) : base(position) public Particle(Vector2 position) : base(position)
{ {
Width = 14; Width = 14;
Height = 14; Height = 14;
Random random = new Random(); Random random = new Random();
velocity = new Vector2(random.Next(3, 15), random.Next(3,30)); velocity = new Vector2(random.Next(-6, 6), random.Next(-8,4));
acceleration.Y = 10; acceleration.Y = 10;
delay = 100; delay = 100;
isFall = false;
isOnGround = false;
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "GibsMoveLeftBottom", "GibsMoveLeftTop", "GibsMoveRightBottom", "GibsMoveRightTop" }, "GibsMoveRightTop"); protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "GibsMoveLeftBottom", "GibsMoveLeftTop", "GibsMoveRightBottom", "GibsMoveRightTop", "GibsNotMove" }, "GibsMoveRightTop");
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {
delay--; delay--;
if (velocity.X > 0) if (delay<=80)
{ {
velocity.X--; velocity.X=0;
} }
if(velocity.Y<=0) if(isOnGround)
{ {
GraphicsComponent.StartAnimation("GipsNoMove"); GraphicsComponent.StartAnimation("GibsNotMove");
Width = 16;
Height = 5;
isFall=true;
; } ; }
else if(!isFall)
{
Width = 14;
Height= 14;
if (velocity.Y<0 && velocity.X>0)
{
GraphicsComponent.StartAnimation("GibsMoveRightTop");
}
else if (velocity.Y < 0 && velocity.X < 0)
{
GraphicsComponent.StartAnimation("GibsMoveLeftTop");
}
else if (velocity.Y > 0 && velocity.X > 0)
{
GraphicsComponent.StartAnimation("GibsMoveRightBottom");
}
else if (velocity.Y > 0 && velocity.X < 0)
{
GraphicsComponent.StartAnimation("GibsMoveLeftBottom");
}
}
if(delay<=0) if(delay<=0)
{ {
AppManager.Instance.GameManager.Remove(this); AppManager.Instance.GameManager.Remove(this);

View file

@ -9,9 +9,9 @@ using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.PlayerDeath namespace DangerousD.GameCore.GameObjects.PlayerDeath
{ {
public class DeathRectangle : GameObject public class AnimationRectangle : GameObject
{ {
public DeathRectangle(Vector2 pos, string DeathType) : base(pos) public AnimationRectangle(Vector2 pos, string DeathType) : base(pos)
{ {
Height = 48; Height = 48;
Width = 48; Width = 48;

View file

@ -16,11 +16,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public class Player : LivingEntity public class Player : LivingEntity
{ {
bool isAlive = true; bool isAlive = true;
bool isRight; bool isRight = true;
string stayAnimation; string stayAnimation;
bool isJump = false; bool isJump = false;
public int health; public int health;
public bool isGoRight = false;
public Vector2 playerVelocity; public Vector2 playerVelocity;
public int rightBorder; public int rightBorder;
public int leftBorder; public int leftBorder;
@ -31,6 +30,9 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
private int bullets; private int bullets;
public bool FallingThroughPlatform = false; public bool FallingThroughPlatform = false;
public bool isUping = false; public bool isUping = false;
public bool isNetworkPlayer;
private int shootLength = 160;
@ -39,6 +41,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public Player(Vector2 position, bool isNetworkPlayer = false) : base(position) public Player(Vector2 position, bool isNetworkPlayer = false) : base(position)
{ {
this.isNetworkPlayer = isNetworkPlayer;
Width = 16; Width = 16;
Height = 32; Height = 32;
@ -47,8 +50,6 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
AppManager.Instance.InputManager.ShootEvent += Shoot; AppManager.Instance.InputManager.ShootEvent += Shoot;
AppManager.Instance.InputManager.MovEventJump += Jump; AppManager.Instance.InputManager.MovEventJump += Jump;
AppManager.Instance.InputManager.MovEventDown += MoveDown; AppManager.Instance.InputManager.MovEventDown += MoveDown;
}
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;
@ -67,10 +68,12 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
}; };
} }
}
public bool IsAlive { get { return isAlive; } } public bool IsAlive { get { return isAlive; } }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft", "playerMoveRight", "DeathFromZombie", "playerRightStay", "playerStayLeft", protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "playerMoveLeft", "playerMoveRight", "DeathFromZombie", "playerRightStay", "playerStayLeft",
"playerJumpRight" , "playerJumpLeft", "playerShootLeft", "playerShootRight", "playerReload"}, "playerReload"); "playerJumpRight" , "playerJumpLeft", "playerShootLeft", "playerShootRight", "playerReload", "smokeAfterShoot", "playerShootUpRight", "playerShootUpLeft"}, "playerReload");
public void Attack() public void Attack()
{ {
@ -100,7 +103,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
isAttacked = true; isAttacked = true;
if (monsterName == "Zombie") if (monsterName == "Zombie")
{ {
DeathRectangle deathRectangle = new DeathRectangle(Pos, "DeathFrom" + monsterName); AnimationRectangle deathRectangle = new AnimationRectangle(Pos, "DeathFrom" + monsterName);
deathRectangle.Gr.actionOfAnimationEnd += (a) => deathRectangle.Gr.actionOfAnimationEnd += (a) =>
{ {
if (a == "DeathFrom" + monsterName) if (a == "DeathFrom" + monsterName)
@ -111,7 +114,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
else if (monsterName == "Spider") else if (monsterName == "Spider")
{ {
DeathRectangle deathRectangle = new DeathRectangle(Pos, "DeathFrom" + monsterName); AnimationRectangle deathRectangle = new AnimationRectangle(Pos, "DeathFrom" + monsterName);
deathRectangle.Gr.actionOfAnimationEnd += (a) => deathRectangle.Gr.actionOfAnimationEnd += (a) =>
{ {
if (a == "DeathFrom" + monsterName) if (a == "DeathFrom" + monsterName)
@ -133,6 +136,8 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public void Shoot() public void Shoot()
{ {
if (bullets > 0) if (bullets > 0)
{
if (!isAttacked)
{ {
if (!isShooting) if (!isShooting)
{ {
@ -140,27 +145,19 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
bullets--; bullets--;
if (isRight) if (isRight)
{ {
if (GraphicsComponent.GetCurrentAnimation != "playerShootRight") StartCicycleAnimation("playerShootRight");
var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), shootLength + 24, 10), typeof(Zombie)).OrderBy(x => (x.Pos - Pos).LengthSquared());
if (targets.Count() > 0)
{ {
GraphicsComponent.StartAnimation("playerShootRight"); Zombie targetZombie = (Zombie)targets.First();
}
var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), 100, 10), typeof(Zombie));
if (targets != null)
{
foreach (var target in targets)
{
Zombie targetZombie = (Zombie)target;
targetZombie.TakeDamage(); targetZombie.TakeDamage();
} }
} SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X + 30, Pos.Y + 7));
} }
else else
{ {
if (GraphicsComponent.GetCurrentAnimation != "playerShootRight") StartCicycleAnimation("playerShootLeft");
{ var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X - shootLength, (int)(Pos.Y - 10f), shootLength, 10), typeof(Zombie));
GraphicsComponent.StartAnimation("playerShootRight");
}
var targets = AppManager.Instance.GameManager.physicsManager.CheckRectangle(new Rectangle((int)Pos.X, (int)(Pos.Y - 10f), -100, 10), typeof(Zombie));
if (targets != null) if (targets != null)
{ {
foreach (var target in targets) foreach (var target in targets)
@ -169,6 +166,8 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
targetZombie.TakeDamage(); targetZombie.TakeDamage();
} }
} }
SmokeAfterShoot smokeAfterShoot = new SmokeAfterShoot(new Vector2(Pos.X - 12, Pos.Y + 7));
}
} }
} }
} }
@ -189,6 +188,8 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
GraphicsComponent.SetCameraPosition(Pos); GraphicsComponent.SetCameraPosition(Pos);
if (!isAttacked || AppManager.Instance.InputManager.InvincibilityCheat) if (!isAttacked || AppManager.Instance.InputManager.InvincibilityCheat)
{
if (!isShooting)
{ {
Move(gameTime); Move(gameTime);
} }
@ -196,6 +197,12 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
{ {
velocity.X = 0; velocity.X = 0;
} }
}
else
{
velocity.X = 0;
}
base.Update(gameTime); base.Update(gameTime);
} }
@ -231,15 +238,35 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
} }
} }
else if (isRight) else if (isRight)
{
if (isUping)
{
if (GraphicsComponent.GetCurrentAnimation != "playerShootUpRight")
{
GraphicsComponent.StartAnimation("playerShootUpRight");
}
}
else
{ {
GraphicsComponent.StartAnimation("playerRightStay"); GraphicsComponent.StartAnimation("playerRightStay");
} }
}
else if (!isRight) else if (!isRight)
{
if (isUping)
{
if (GraphicsComponent.GetCurrentAnimation != "playerShootUpLeft")
{
GraphicsComponent.StartAnimation("playerShootUpLeft");
}
}
else
{ {
GraphicsComponent.StartAnimation("playerStayLeft"); GraphicsComponent.StartAnimation("playerStayLeft");
} }
} }
} }
}
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.SinglePlayer) if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.SinglePlayer)
{ {
NetworkTask task = new NetworkTask(id, Pos); NetworkTask task = new NetworkTask(id, Pos);
@ -252,5 +279,13 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
isOnGround = false; isOnGround = false;
} }
public class Bullet : GameObjects.LivingEntity
{
public Bullet(Vector2 position) : base(position)
{
}
protected override GraphicsComponent GraphicsComponent { get; } = new("ZombieMoveLeft");
}
} }
} }

View file

@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DangerousD.GameCore.GameObjects;
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.PlayerDeath
{
public class SmokeAfterShoot : GameObject
{
public SmokeAfterShoot(Vector2 pos) : base(pos)
{
Height = 6;
Width = 6;
PlaySmoke();
this.GraphicsComponent.actionOfAnimationEnd += (a) =>
{
if (a == "smokeAfterShoot")
{
AppManager.Instance.GameManager.Remove(this);
}
};
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "smokeAfterShoot" },
"smokeAfterShoot");
public GraphicsComponent Gr => GraphicsComponent;
private void PlaySmoke()
{
if (GraphicsComponent.GetCurrentAnimation != "smokeAfterShoot")
{
GraphicsComponent.StartAnimation("smokeAfterShoot");
}
}
}
}

View file

@ -1,4 +1,6 @@
using Microsoft.Xna.Framework; using DangerousD.GameCore.GameObjects.LivingEntities;
using DangerousD.GameCore.Network;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects; namespace DangerousD.GameCore.GameObjects;
@ -15,6 +17,14 @@ public abstract class LivingEntity : Entity
public override void SetPosition(Vector2 position) public override void SetPosition(Vector2 position)
{ {
_pos = position; _pos = position;
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.SinglePlayer)
{
NetworkTask task = new NetworkTask(id, _pos);
if (this is Player || AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
{
AppManager.Instance.NetworkTasks.Add(task);
}
}
} //TODO befrend targetpos and physics engine } //TODO befrend targetpos and physics engine

View file

@ -1,4 +1,7 @@
using DangerousD.GameCore.Managers; using DangerousD.GameCore.GameObjects;
using DangerousD.GameCore.GameObjects.LivingEntities;
using DangerousD.GameCore.Managers;
using DangerousD.GameCore.Network;
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;
@ -18,6 +21,7 @@ namespace DangerousD.GameCore.Graphics
private List<string> texturesNames; private List<string> texturesNames;
private AnimationContainer currentAnimation; private AnimationContainer currentAnimation;
static private int scaling = 4; static private int scaling = 4;
public int parentId;
public AnimationContainer CurrentAnimation public AnimationContainer CurrentAnimation
{ {
get get
@ -105,6 +109,14 @@ namespace DangerousD.GameCore.Graphics
public void StartAnimation(string startedanimationId) public void StartAnimation(string startedanimationId)
{ {
if (AppManager.Instance.multiPlayerStatus != MultiPlayerStatus.SinglePlayer)
{
LivingEntity entity = AppManager.Instance.GameManager.livingEntities.Find(x => x.id == parentId);
if (((entity is Player) || AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host) && startedanimationId != GetCurrentAnimation)
{
AppManager.Instance.NetworkTasks.Add(new NetworkTask(parentId, startedanimationId, Vector2.Zero));
}
}
currentFrame = 0; currentFrame = 0;
currentAnimation = animations.Find(x => x.Id == startedanimationId); currentAnimation = animations.Find(x => x.Id == startedanimationId);

View file

@ -32,6 +32,7 @@ namespace DangerousD.GameCore
public Vector2 VectorMovementDirection { get => vectorMovementDirection; } public Vector2 VectorMovementDirection { get => vectorMovementDirection; }
public ScopeState ScopeState { get => scopeState; } public ScopeState ScopeState { get => scopeState; }
public string currentControlsState;
public InputManager() public InputManager()
{ {
@ -205,7 +206,12 @@ namespace DangerousD.GameCore
{ {
isShoot = false; isShoot = false;
} }
} SetState(ControlsState.Keyboard);
}
}
public void SetState(ControlsState controlsState)
{
currentControlsState = controlsState.ToString();
} }
} }
} }

View file

@ -17,7 +17,7 @@ using System.Threading.Tasks;
namespace DangerousD.GameCore namespace DangerousD.GameCore
{ {
public enum MultiPlayerStatus { SinglePlayer, Host, Client } public enum MultiPlayerStatus { SinglePlayer, Host, Client }
public enum GameState { Menu, Options, Lobby, Game, Login, Death, HUD, public enum GameState { Menu, Options, Lobby, Game, Login, Death,
GameOver GameOver
} }
public class AppManager : Game public class AppManager : Game
@ -28,15 +28,17 @@ namespace DangerousD.GameCore
private SpriteBatch _spriteBatch; private SpriteBatch _spriteBatch;
public GameState gameState { get; private set; } public GameState gameState { get; private set; }
public MultiPlayerStatus multiPlayerStatus { get; private set; } = MultiPlayerStatus.SinglePlayer; public MultiPlayerStatus multiPlayerStatus { get; private set; } = MultiPlayerStatus.SinglePlayer;
public Point resolution = new Point(1920, 1080); public Point resolution;
public Point inGameResolution = new Point(1920, 1080); public Point inGameResolution = new Point(1920, 1080);
public Point inGameHUDHelperResolution = new Point(1920, 1080);
IDrawableObject MenuGUI; IDrawableObject MenuGUI;
IDrawableObject OptionsGUI; IDrawableObject OptionsGUI;
IDrawableObject LoginGUI; IDrawableObject LoginGUI;
IDrawableObject LobbyGUI; IDrawableObject LobbyGUI;
IDrawableObject DeathGUI; IDrawableObject DeathGUI;
IDrawableObject HUD; //IDrawableObject HUD;
public DebugHUD DebugHUD; public DebugHUD DebugHUD;
public HUD HUD;
public List<NetworkTask> NetworkTasks = new List<NetworkTask>(); public List<NetworkTask> NetworkTasks = new List<NetworkTask>();
public GameManager GameManager { get; private set; } = new(); public GameManager GameManager { get; private set; } = new();
@ -61,9 +63,7 @@ namespace DangerousD.GameCore
NetworkManager.GetReceivingMessages += NetworkSync; NetworkManager.GetReceivingMessages += NetworkSync;
resolution = SettingsManager.Resolution; resolution = SettingsManager.Resolution;
_graphics.PreferredBackBufferWidth = resolution.X;
_graphics.PreferredBackBufferHeight = resolution.Y;
_graphics.IsFullScreen = false;
gameState = GameState.Menu; gameState = GameState.Menu;
MenuGUI = new MenuGUI(); MenuGUI = new MenuGUI();
LoginGUI = new LoginGUI(); LoginGUI = new LoginGUI();
@ -72,8 +72,8 @@ namespace DangerousD.GameCore
DeathGUI = new DeathGUI(); DeathGUI = new DeathGUI();
HUD = new HUD(); HUD = new HUD();
DebugHUD = new DebugHUD(); DebugHUD = new DebugHUD();
UIManager.resolution = resolution; UIManager.resolution = new Point(_graphics.PreferredBackBufferWidth, _graphics.PreferredBackBufferHeight);
UIManager.resolutionInGame = inGameResolution; UIManager.resolutionInGame = resolution;
} }
protected override void Initialize() protected override void Initialize()
@ -104,16 +104,15 @@ namespace DangerousD.GameCore
GameObject.debugTexture.SetData<Color>(new Color[] { new Color(1, 0,0,0.25f) }); GameObject.debugTexture.SetData<Color>(new Color[] { new Color(1, 0,0,0.25f) });
SoundManager.LoadSounds(); SoundManager.LoadSounds();
SoundManager.StartAmbientSound("DoomTestSong"); SoundManager.StartAmbientSound("DoomTestSong");
renderTarget = new RenderTarget2D(GraphicsDevice, inGameResolution.X, inGameResolution.Y); renderTarget = new RenderTarget2D(GraphicsDevice, resolution.X, resolution.Y);
} }
protected override void Update(GameTime gameTime) protected override void Update(GameTime gameTime)
{ {
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape)) if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
Exit(); Exit();
if (GameManager.GetPlayer1 != null) if (GameManager.GetPlayer1 != null)
DebugHUD.Set("Objid: ", GameManager.GetPlayer1.id.ToString()); DebugHUD.Set("id: ", GameManager.GetPlayer1.id.ToString());
InputManager.Update(); InputManager.Update();
SoundManager.Update(); SoundManager.Update();
@ -134,10 +133,8 @@ namespace DangerousD.GameCore
case GameState.Death: case GameState.Death:
DeathGUI.Update(gameTime); DeathGUI.Update(gameTime);
break; break;
case GameState.HUD:
HUD.Update(gameTime);
break;
case GameState.Game: case GameState.Game:
HUD.Update(gameTime);
GameManager.Update(gameTime); GameManager.Update(gameTime);
break; break;
default: default:
@ -170,13 +167,11 @@ namespace DangerousD.GameCore
case GameState.Death: case GameState.Death:
DeathGUI.Draw(_spriteBatch); DeathGUI.Draw(_spriteBatch);
break; break;
case GameState.HUD:
HUD.Draw(_spriteBatch);
break;
case GameState.Game: case GameState.Game:
_spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp); _spriteBatch.Begin(SpriteSortMode.Deferred, null, SamplerState.PointClamp);
GameManager.Draw(_spriteBatch); GameManager.Draw(_spriteBatch);
_spriteBatch.End(); _spriteBatch.End();
HUD.Draw(_spriteBatch);
break; break;
default: default:
break; break;
@ -205,8 +200,16 @@ namespace DangerousD.GameCore
case GameState.Lobby: case GameState.Lobby:
break; break;
case GameState.Game: case GameState.Game:
<<<<<<< HEAD
GameManager.mapManager.LoadLevel("map"); GameManager.mapManager.LoadLevel("map");
=======
GameManager.mapManager.LoadLevel("lvl");
>>>>>>> main
GameManager.FindBorders(); GameManager.FindBorders();
break; break;
case GameState.Death: case GameState.Death:
break; break;
@ -232,6 +235,7 @@ namespace DangerousD.GameCore
if (networkTask.objId != GameManager.GetPlayer1.id ) if (networkTask.objId != GameManager.GetPlayer1.id )
{ {
LivingEntity entity = GameManager.livingEntities.Find(x => x.id == networkTask.objId); LivingEntity entity = GameManager.livingEntities.Find(x => x.id == networkTask.objId);
if (entity != null)
entity.SetPosition(networkTask.position); entity.SetPosition(networkTask.position);
if (multiPlayerStatus == MultiPlayerStatus.Host) if (multiPlayerStatus == MultiPlayerStatus.Host)
{ {
@ -240,6 +244,15 @@ namespace DangerousD.GameCore
} }
break; break;
case NetworkTaskOperationEnum.ChangeState: case NetworkTaskOperationEnum.ChangeState:
if (networkTask.objId != GameManager.GetPlayer1.id)
{
LivingEntity entity = GameManager.livingEntities.Find(x => x.id == networkTask.objId);
if (entity != null)
{
GraphicsComponent gc = entity.GetGraphicsComponent();
gc.StartAnimation(networkTask.name);
}
}
break; break;
case NetworkTaskOperationEnum.ConnectToHost: case NetworkTaskOperationEnum.ConnectToHost:
Player connectedPlayer = new Player(Vector2.Zero, true); Player connectedPlayer = new Player(Vector2.Zero, true);
@ -257,13 +270,15 @@ namespace DangerousD.GameCore
if (!GameManager.GetPlayer1.isIdFromHost) if (!GameManager.GetPlayer1.isIdFromHost)
{ {
GameManager.GetPlayer1.id = networkTask.objId; GameManager.GetPlayer1.id = networkTask.objId;
GraphicsComponent gcsd = GameManager.GetPlayer1.GetGraphicsComponent();
gcsd.parentId = networkTask.objId;
GameManager.GetPlayer1.isIdFromHost = true; GameManager.GetPlayer1.isIdFromHost = true;
} }
break; break;
case NetworkTaskOperationEnum.AddConnectedPlayer: case NetworkTaskOperationEnum.AddConnectedPlayer:
Player remoteConnectedPlayer = new Player(networkTask.position, true); Player remoteConnectedPlayer = new Player(networkTask.position, true);
remoteConnectedPlayer.id = networkTask.objId; remoteConnectedPlayer.id = networkTask.objId;
remoteConnectedPlayer.GetGraphicsComponent().parentId = networkTask.objId;
break; break;
default: default:
break; break;
@ -274,5 +289,24 @@ namespace DangerousD.GameCore
{ {
this.multiPlayerStatus = multiPlayerStatus; this.multiPlayerStatus = multiPlayerStatus;
} }
public void SetIsFullScreen(bool fullscrin)
{
DebugHUD?.Set("resX:", SettingsManager.Resolution.X.ToString());
DebugHUD?.Set("resY:", SettingsManager.Resolution.Y.ToString());
DebugHUD?.Set("FullScreen:", _graphics.IsFullScreen.ToString());
if (fullscrin)
{
_graphics.PreferredBackBufferWidth = 1920;
_graphics.PreferredBackBufferHeight = 1080;
}
else
{
_graphics.PreferredBackBufferWidth = SettingsManager.Resolution.X;
_graphics.PreferredBackBufferHeight = SettingsManager.Resolution.Y;
}
UIManager.resolution = new Point(_graphics.PreferredBackBufferWidth, _graphics.PreferredBackBufferHeight);
_graphics.IsFullScreen = fullscrin;
_graphics.ApplyChanges();
}
} }
} }

View file

@ -149,17 +149,24 @@ namespace DangerousD.GameCore
} }
} }
else else
{ {
for (int i = 0; i < livingEntitiesWithoutPlayers.Count; i++) for (int i = 0; i < livingEntitiesWithoutPlayers.Count; i++)
{ {
livingEntitiesWithoutPlayers[i].PlayAnimation(); livingEntitiesWithoutPlayers[i].PlayAnimation();
} }
} }
foreach (Player player in players)
{
if (player.id != GetPlayer1.id)
{
player.PlayAnimation();
}
}
GetPlayer1.Update(gameTime); GetPlayer1.Update(gameTime);
foreach (var item in otherObjects) for(int i = 0; i < otherObjects.Count; i++)
item.Update(gameTime); {
otherObjects[i].Update(gameTime);
}
physicsManager.UpdateCollisions(entities, livingEntities, mapObjects, players, gameTime); physicsManager.UpdateCollisions(entities, livingEntities, mapObjects, players, gameTime);
} }

View file

@ -9,14 +9,17 @@ using Microsoft.Xna.Framework.Graphics;
using System.Xml.Serialization; using System.Xml.Serialization;
using DangerousD.GameCore.GameObjects; using DangerousD.GameCore.GameObjects;
using System.Globalization; using System.Globalization;
using System.IO;
using DangerousD.GameCore.GameObjects.Entities;
using DangerousD.GameCore.GameObjects.LivingEntities; using DangerousD.GameCore.GameObjects.LivingEntities;
namespace DangerousD.GameCore.Managers namespace DangerousD.GameCore.Managers
{ {
public class MapManager public class MapManager
{ {
private int _columns;
private int _scale; private int _scale;
private int _columns;
public MapManager(int scale) public MapManager(int scale)
{ {
@ -78,6 +81,7 @@ namespace DangerousD.GameCore.Managers
private void LoadTilesData() private void LoadTilesData()
{ {
XmlDocument xml = new(); XmlDocument xml = new();
xml.Load($"../../../Content/map.tsx"); xml.Load($"../../../Content/map.tsx");
XmlNode root = xml.DocumentElement; XmlNode root = xml.DocumentElement;
@ -102,6 +106,11 @@ namespace DangerousD.GameCore.Managers
{ {
inst = (Entity)Activator.CreateInstance(type, pos, false); inst = (Entity)Activator.CreateInstance(type, pos, false);
} }
else if (type.Equals(typeof(Door)))
{
int gid = entity.Attributes["gid"] is not null ? int.Parse(entity.Attributes["gid"].Value) : 0;
inst = (Entity)Activator.CreateInstance(type, pos, new Vector2(32, 48), new Rectangle((gid - 872)*32, 0, 32, 48));
}
else else
{ {
inst = (Entity)Activator.CreateInstance(type, pos); inst = (Entity)Activator.CreateInstance(type, pos);

View file

@ -142,14 +142,18 @@ namespace DangerousD.GameCore.Managers
} }
private void CheckCollisionsE_LE(List<Entity> entities, List<LivingEntity> livingEntities) private void CheckCollisionsE_LE(List<Entity> entities, List<LivingEntity> livingEntities)
{ {
foreach (var entity in entities) for (int i = 0; i < entities.Count; i++)
{ {
foreach (var livingEntity in livingEntities)
for (int j = 0; j < livingEntities.Count; j++)
{ {
if (livingEntity.Rectangle.Intersects(entity.Rectangle))
if (livingEntities[j].Rectangle.Intersects(entities[i].Rectangle))
{ {
livingEntity.OnCollision(entity); livingEntities[j].OnCollision(entities[i]);
entity.OnCollision(livingEntity); entities[i].OnCollision(livingEntities[j]);
} }
} }
} }
@ -273,6 +277,21 @@ namespace DangerousD.GameCore.Managers
} }
return intersected; return intersected;
} }
public List<GameObject> CheckRectangle(Rectangle rectangle, bool player)
{
var gameObjects = AppManager.Instance.GameManager.GetPlayer1;
List<GameObject> intersected = new List<GameObject>();
if (gameObjects.Rectangle.Intersects(rectangle))
{
intersected.Add(gameObjects);
}
return intersected;
}
public List<GameObject> CheckRectangle(Rectangle rectangle) public List<GameObject> CheckRectangle(Rectangle rectangle)
{ {
var gameObjects = AppManager.Instance.GameManager.mapObjects; var gameObjects = AppManager.Instance.GameManager.mapObjects;

View file

@ -27,22 +27,26 @@ namespace DangerousD.GameCore.Managers
public void SetMainVolume(float volume) public void SetMainVolume(float volume)
{ {
settingsContainer.MainVolume = MainVolume; settingsContainer.MainVolume = MainVolume;
///AppManager.Instance.SoundManager. //AppManager.Instance.SoundManager.
} }
public void SetMusicVolume(float volume) public void SetMusicVolume(float volume)
{ {
settingsContainer.MusicVolume = MainVolume; settingsContainer.MusicVolume = MainVolume;
SaveSettings();
} }
public void SetSoundEffectsVolume(float volume) public void SetSoundEffectsVolume(float volume)
{ {
settingsContainer.SoundEffectsVolume = MainVolume; settingsContainer.SoundEffectsVolume = MainVolume;
SaveSettings();
} }
public void SetIsFullScreen(bool isFullScreen) public void SetIsFullScreen(bool isFullScreen)
{ {
settingsContainer.IsFullScreen = isFullScreen; settingsContainer.IsFullScreen = isFullScreen;
AppManager.Instance.SetIsFullScreen(isFullScreen);
SaveSettings();
} }
public void LoadSettings() public void LoadSettings()
{ {

View file

@ -19,7 +19,7 @@ namespace DangerousD.GameCore
public void LoadSounds() // метод для загрузки звуков из папки public void LoadSounds() // метод для загрузки звуков из папки
{ {
var k = Directory.GetFiles("../../..//Content").Where(x => x.EndsWith("mp3")); var k = Directory.GetFiles("../../..//Content//sounds").Where(x => x.EndsWith("mp3"));
if (k.Count() > 0) if (k.Count() > 0)
{ {
@ -27,7 +27,7 @@ namespace DangerousD.GameCore
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".mp3", "")).ToArray();// папка со звуками там где exe string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".mp3", "")).ToArray();// папка со звуками там где exe
foreach (var soundFile in soundFiles) foreach (var soundFile in soundFiles)
{ {
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>(soundFile).CreateInstance()); Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds//" + soundFile).CreateInstance());
} }
} }
@ -53,7 +53,7 @@ namespace DangerousD.GameCore
{ {
var sound = new Sound(Sounds[soundName], soundPos); var sound = new Sound(Sounds[soundName], soundPos);
sound.SoundEffect.IsLooped = false; sound.SoundEffect.IsLooped = false;
sound.SoundEffect.Volume = (float)sound.GetDistance(playerPos) / MaxSoundDistance; sound.SoundEffect.Volume = (float)(MaxSoundDistance-sound.GetDistance(playerPos)) / MaxSoundDistance;
sound.SoundEffect.Play(); sound.SoundEffect.Play();
PlayingSounds.Add(sound); PlayingSounds.Add(sound);
if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host) if (AppManager.Instance.multiPlayerStatus == MultiPlayerStatus.Host)
@ -79,7 +79,7 @@ namespace DangerousD.GameCore
for (int i = 0; i < PlayingSounds.Count; i++) for (int i = 0; i < PlayingSounds.Count; i++)
{ {
if (!PlayingSounds[i].isAmbient) if (!PlayingSounds[i].isAmbient)
PlayingSounds[i].SoundEffect.Volume = (float)PlayingSounds[i].GetDistance(player.Pos) / MaxSoundDistance; PlayingSounds[i].SoundEffect.Volume = (float)(MaxSoundDistance - PlayingSounds[i].GetDistance(player.Pos)) / MaxSoundDistance;
if (PlayingSounds[i].SoundEffect.State == SoundState.Stopped) if (PlayingSounds[i].SoundEffect.State == SoundState.Stopped)
PlayingSounds.Remove(PlayingSounds[i]); PlayingSounds.Remove(PlayingSounds[i]);
} }

View file

@ -16,7 +16,7 @@ namespace MonogameLibrary.UI.Elements
public delegate void OnButtonPressed(); public delegate void OnButtonPressed();
public event OnButtonPressed? RightButtonPressed; public event OnButtonPressed? RightButtonPressed;
public event OnButtonPressed? LeftButtonPressed; public event OnButtonPressed? LeftButtonPressed;
protected HoverState hoverState = HoverState.None; public HoverState hoverState = HoverState.None;
public Button(UIManager manager, int layerIndex = 0) : base(manager, layerIndex) public Button(UIManager manager, int layerIndex = 0) : base(manager, layerIndex)
{ {
@ -40,7 +40,7 @@ namespace MonogameLibrary.UI.Elements
if (mouseState.LeftButton != prevmouseState.LeftButton) if (mouseState.LeftButton != prevmouseState.LeftButton)
{ {
hoverState = HoverState.Pressing; hoverState = HoverState.Pressing;
LeftButtonPressed?.Invoke(); CallLeftBtnEvent();
return true; return true;
} }
} }
@ -77,5 +77,9 @@ namespace MonogameLibrary.UI.Elements
DrawText(_spriteBatch); DrawText(_spriteBatch);
} }
public void CallLeftBtnEvent()
{
LeftButtonPressed?.Invoke();
}
} }
} }

View file

@ -26,9 +26,13 @@ namespace MonogameLibrary.UI.Elements
public event OnTextChange? StopChanging; public event OnTextChange? StopChanging;
public event OnTextChange? OnEnter; public event OnTextChange? OnEnter;
protected HoverState hoverState = HoverState.None; public HoverState hoverState = HoverState.None;
protected IsSelected isSelected = IsSelected.NotSelected; protected IsSelected isSelected = IsSelected.NotSelected;
public bool shouldEndOnEnter; public bool shouldEndOnEnter;
public void SelectIt()
{
isSelected = IsSelected.Selected;
}
public virtual bool InteractUpdate(MouseState mouseState, MouseState prevmouseState) public virtual bool InteractUpdate(MouseState mouseState, MouseState prevmouseState)
{ {