Merge branch 'FixingDevelopment' into GUI
BIN
.$architecture.drawio.png.bkp
Normal file
After Width: | Height: | Size: 1,019 KiB |
635
.$architecture.drawio.png.dtmp
Normal file
|
@ -0,0 +1,635 @@
|
||||||
|
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.5 Chrome/126.0.6478.183 Electron/31.3.0 Safari/537.36" scale="1" border="0" version="24.7.5">
|
||||||
|
<diagram name="Page-1" id="vN-Mjpsko5mhnfbVd4ZQ">
|
||||||
|
<mxGraphModel dx="4050" dy="3084" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="0" />
|
||||||
|
<mxCell id="1" parent="0" />
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-120" value="" style="group;strokeColor=#996185;dashed=1;dashPattern=12 12;rounded=1;fillColor=#e6d0de;gradientColor=#d5739d;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="380" y="-1350" width="1160" height="1110" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-88" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-87" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-89" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-86" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="153" y="30" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-100" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-99" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-105" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-102" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="323" y="30" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-106" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-103" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-107" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-104" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-109" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-108" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-111" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-110" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-199" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-85" target="lzB2u7mNdVftqM7OZ14K-198" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-85" value="AbstractGUI<div><br><div>Update()</div><div>Draw()</div></div>" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-86" value="MainMenuGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="90" y="150" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-87" value="BaseGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="175.5" y="230" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-99" value="GameEndedGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="840" y="180" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-159" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;curved=1;dashed=1;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-103" target="lzB2u7mNdVftqM7OZ14K-158" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="343" y="430" />
|
||||||
|
<mxPoint x="343" y="730" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-102" value="SelectModeMenu" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="282.5" y="320" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-161" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;curved=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;dashed=1;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-103" target="lzB2u7mNdVftqM7OZ14K-160" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="443" y="850" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-103" value="SelectingServerGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="382.5" y="400" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-104" value="WaitingForPlayersGUI<div><br></div><div>Host can start game here</div><div><br></div><div>У хоста здесь будет кнопка старта игры, у других - нет</div>" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="481.25" y="480" width="132.5" height="180" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-108" value="InventoryGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="740" y="270" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-110" value="HUD" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="605" y="400" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-158" value="<div>MultiPlayerStartHosting</div><div><br></div><div>Server.CreateRoom();</div><div>Client.JoinRoom(127.0.0.1);</div>" style="ellipse;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="5.5" y="670" width="170" height="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-138" value="SinglePlayerSelected<div><br><div>Server.CreatedRoom();</div><div>Client.JoinRoom(127.0.0.1);</div><div>Server.StartGame();</div></div>" style="ellipse;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="5.5" y="540" width="170" height="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-157" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=default;curved=1;dashed=1;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-102" target="lzB2u7mNdVftqM7OZ14K-138" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-160" value="<div><span style="background-color: initial;">Join Room</span></div><div><span style="background-color: initial;"><br></span></div><div><span style="background-color: initial;">Client.JoinRoom(ip);</span><br></div>" style="ellipse;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="10" y="800" width="170" height="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-163" value="<div><span style="background-color: initial;">Start Game</span></div><div><span style="background-color: initial;"><br></span></div><div><span style="background-color: initial;">Server.StartGame();</span><br></div>" style="ellipse;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="10" y="930" width="170" height="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-164" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;curved=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="lzB2u7mNdVftqM7OZ14K-120" source="lzB2u7mNdVftqM7OZ14K-104" target="lzB2u7mNdVftqM7OZ14K-163" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-184" value="Обращается к игроку и выводит/ изменяет его данные на экране" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="760" y="300" width="160" height="120" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-198" value="OptionsGUI" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-120" vertex="1">
|
||||||
|
<mxGeometry x="980" y="120" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-36" value="" style="group;strokeColor=#b85450;dashed=1;rounded=1;glass=1;fillColor=#f8cecc;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-200" y="-220" width="490" height="630" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-10" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="TA6NM5vga4TUYUKUYXcC-36" source="lzB2u7mNdVftqM7OZ14K-1" target="lzB2u7mNdVftqM7OZ14K-8" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="300" y="445" />
|
||||||
|
<mxPoint x="300" y="605" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-94" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="TA6NM5vga4TUYUKUYXcC-36" source="lzB2u7mNdVftqM7OZ14K-1" target="lzB2u7mNdVftqM7OZ14K-93" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="300" y="445" />
|
||||||
|
<mxPoint x="300" y="536" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-1" value="Server<div>- Логика игры</div><div>- Апдейт монсты</div><div>Работает на тиках</div><div><br></div><div>States:</div><div><span style="white-space: pre;">	</span>Waiting for Players<br></div><div>InGame</div><div><br></div><div><br></div><div>CreatedRoom(); - начинает слушать и ожидать новых подключений</div><div><br></div><div>StartGame();&nbsp;<span style="background-color: initial;">- Уведомляет о начале игры, перестает ждать новых подключений</span></div><div><span style="background-color: initial;"><br></span></div><div>EndGame();&nbsp;<span style="background-color: initial;">- Уведомляет о конце игры, все прослушки отключаются</span></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-36" vertex="1">
|
||||||
|
<mxGeometry y="40" width="220" height="290" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-8" value="Лист Entity" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" parent="TA6NM5vga4TUYUKUYXcC-36" vertex="1">
|
||||||
|
<mxGeometry x="350" y="580" width="110" height="50" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-60" value="Сервер загрузился и все зарегистрировал<div><br></div><div>каждый тик апдейт и отправка данных клиенту</div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-36" vertex="1">
|
||||||
|
<mxGeometry x="240" width="250" height="160" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-93" value="Лист GameObjects" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" parent="TA6NM5vga4TUYUKUYXcC-36" vertex="1">
|
||||||
|
<mxGeometry x="350" y="510" width="110" height="52.5" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-47" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-1" target="lzB2u7mNdVftqM7OZ14K-46" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-320" y="225" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-139" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-1" target="lzB2u7mNdVftqM7OZ14K-6" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="290" y="-35" />
|
||||||
|
<mxPoint x="290" y="218" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-140" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-1" target="lzB2u7mNdVftqM7OZ14K-12" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="393" y="-35" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-135" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="lzB2u7mNdVftqM7OZ14K-1" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-136" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="lzB2u7mNdVftqM7OZ14K-4" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-90" y="-795" />
|
||||||
|
<mxPoint x="-90" y="-273" />
|
||||||
|
<mxPoint x="-538" y="-273" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-137" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="lzB2u7mNdVftqM7OZ14K-85" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-90" y="-795" />
|
||||||
|
<mxPoint x="-90" y="-930" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-168" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="lzB2u7mNdVftqM7OZ14K-90" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-850" y="-795" />
|
||||||
|
<mxPoint x="-850" y="-1080" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-173" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="lzB2u7mNdVftqM7OZ14K-172" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-850" y="-795" />
|
||||||
|
<mxPoint x="-850" y="-905" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-5" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-2" target="TA6NM5vga4TUYUKUYXcC-1" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-420" y="-1430" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-65" value="Adds Data to send if position has changed" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;curved=1;dashed=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-6" target="lzB2u7mNdVftqM7OZ14K-46" edge="1">
|
||||||
|
<mxGeometry x="0.5191" relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-30" y="270" />
|
||||||
|
<mxPoint x="-30" y="470" />
|
||||||
|
<mxPoint x="-345" y="320" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint as="offset" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-58" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-8" target="lzB2u7mNdVftqM7OZ14K-25" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-12" value="MapManager<div>Система карты<div>- загружает карту (из заранее сделанных)</div></div>" style="rhombus;whiteSpace=wrap;html=1;fillColor=#6d8764;fontColor=#ffffff;strokeColor=#3A5431;" parent="1" vertex="1">
|
||||||
|
<mxGeometry x="542.5" y="-110" width="230" height="150" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-57" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=link;" parent="1" source="lzB2u7mNdVftqM7OZ14K-49" target="lzB2u7mNdVftqM7OZ14K-50" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-350" y="640" />
|
||||||
|
<mxPoint x="-1466" y="640" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-90" value="PlayerData<div>Dictionary&lt;string, int&gt; resources</div>" style="rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" parent="1" vertex="1">
|
||||||
|
<mxGeometry x="-1090" y="-1110" width="170" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-95" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="lzB2u7mNdVftqM7OZ14K-93" target="lzB2u7mNdVftqM7OZ14K-39" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-127" value="" style="group;dashed=1;dashPattern=8 8;rounded=1;strokeColor=#d79b00;expand=1;autosize=1;fillColor=#ffe6cc;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-1960" y="820" width="1899.62" height="270" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-123" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-83" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="227.15189873417714" y="30" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-124" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-66" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-125" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-54" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-180" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-177" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-193" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-192" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-12" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="TA6NM5vga4TUYUKUYXcC-10" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-13" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="TA6NM5vga4TUYUKUYXcC-11" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-50" value="IUpdateData<div>id объекта</div><div>updatetype</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry width="147.3417721518987" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-54" value="UpdateAnimation<div><div>хранит новую анимации</div></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="589.37" y="170" width="130.63" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-66" value="UpdateGameObjectCreated<div>Хранит объект, который только отправили</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="356.0759493670885" y="170" width="208.73417721518982" height="92.5" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-83" value="UpdateGameEnded<div>Хранит полученный лут и уведомляет о конце игры</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="122.78481012658223" y="170" width="208.73417721518982" height="92.5" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-177" value="UpdatePosition<div>Хранит новую позицию</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="740" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-52" value="UpdateInput<div>Хранит новую позицию</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1580" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-126" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="lzB2u7mNdVftqM7OZ14K-52" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-182" value="ClientToServer<div>id - это id игрока</div>" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1510" y="40" width="130" height="80" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-183" value="ServerToClient" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1209.62" y="40" width="120" height="80" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-192" value="<div>Update<span style="background-color: initial;">Loot</span></div><div>Хранит лут</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="880" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-10" value="UpdatePlayerParametrs<div>Хранит хп, радиацию</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1020" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-11" value="UpdateEntityHealth<div>хранит новое хп entity</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1160" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-6" value="UpdatePlayerExit<div>Пользователь ушел и сообщил</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-127" vertex="1">
|
||||||
|
<mxGeometry x="1720" y="172.5" width="129.62" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-7" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-127" source="lzB2u7mNdVftqM7OZ14K-50" target="TA6NM5vga4TUYUKUYXcC-6" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-134" value="" style="group;strokeColor=#82b366;dashed=1;rounded=1;dashPattern=8 8;fillColor=#d5e8d4;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-100" y="1070" width="1020" height="1110" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-43" value="StopObject" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="890" y="570" width="90" height="20" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-72" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-7" target="lzB2u7mNdVftqM7OZ14K-71" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-73" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-7" target="lzB2u7mNdVftqM7OZ14K-70" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="60" y="740" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-7" value="<div>LivingEntity</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="280" y="700" width="185" height="80" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-19" value="Tile" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="780" y="570" width="90" height="20" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-76" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-20" target="lzB2u7mNdVftqM7OZ14K-74" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="770" y="740" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-77" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-20" target="lzB2u7mNdVftqM7OZ14K-75" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="890" y="740" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-20" value="<div>Collectable</div><div><br></div><div>Прописать условия вызова OnInteract</div><div>подписывается на OnTriggerZone</div><div>OnInteract()</div><div><br></div><div>Это лут</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="480" y="700" width="185" height="160" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-34" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-25" target="lzB2u7mNdVftqM7OZ14K-7" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="533" y="530" />
|
||||||
|
<mxPoint x="390" y="530" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-38" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-25" target="lzB2u7mNdVftqM7OZ14K-20" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="533" y="530" />
|
||||||
|
<mxPoint x="573" y="530" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-25" value="Entity<div>id<br><div><div>CollisionComponent</div><div>AnimationComponent<br><div>UpdateLogic()</div><div><div><div>- в апдейте может заявляет изменения позиции</div></div></div></div></div></div><div><br></div><div>Методы для клиента</div><div><div>UpdateAnimation()</div><div>Draw()</div></div><div><br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="428" y="140" width="210" height="230" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-32" value="Все Entity будут передаваться клиенту" style="rounded=1;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="567.5" y="340" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-40" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-39" target="lzB2u7mNdVftqM7OZ14K-25" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-42" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-39" target="lzB2u7mNdVftqM7OZ14K-19" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-44" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-39" target="lzB2u7mNdVftqM7OZ14K-43" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-39" value="<div>GameObject</div><div>Штуки с отрисовкой, их мы отправлять будем</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="440.5" width="185" height="80" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-70" value="Player<div><br></div><div>bool isTryingToInteract</div>" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry y="920" width="140" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-71" value="Enemy" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="150" y="920" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-74" value="Wood" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="710" y="920" width="100" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-75" value="Ammo" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="840" y="920" width="100" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-24" value="Projectile<div>Vector2 velocity</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="312.5" y="900" width="167.5" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-25" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="lzB2u7mNdVftqM7OZ14K-7" target="TA6NM5vga4TUYUKUYXcC-24" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="396" y="820" />
|
||||||
|
<mxPoint x="396" y="820" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-27" value="Bullet" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="270" y="1050" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-28" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="TA6NM5vga4TUYUKUYXcC-24" target="TA6NM5vga4TUYUKUYXcC-27" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-26" value="Rock" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-134" vertex="1">
|
||||||
|
<mxGeometry x="420" y="1050" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-29" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="lzB2u7mNdVftqM7OZ14K-134" source="TA6NM5vga4TUYUKUYXcC-24" target="TA6NM5vga4TUYUKUYXcC-26" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-146" value="" style="group;strokeColor=#d6b656;dashed=1;dashPattern=8 8;rounded=1;fillColor=#fff2cc;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-1490" y="-100" width="656.25" height="561.35" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-69" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-146" source="lzB2u7mNdVftqM7OZ14K-4" target="lzB2u7mNdVftqM7OZ14K-68" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-142" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-146" source="lzB2u7mNdVftqM7OZ14K-4" target="lzB2u7mNdVftqM7OZ14K-61" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-4" value="Client<br>- Получает данные игры<div>- отправляет инпут игрока</div><div>- Рисует все</div><div>- всегда сетевой</div><div><br></div><div>JoinRoom(string ip) - попытка подключиться к комнате<br></div><div><br></div><div>OnUpdate(<span style="background-color: initial;">IUpdateData</span><span style="background-color: initial;">)</span></div><div><br></div><div>GameEndedUnexpectedly() - хост пропал, игра закончилась</div>" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-146" vertex="1">
|
||||||
|
<mxGeometry x="380" width="276.25" height="249.77" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-61" value="<div>ClientNetworkManager</div><div><br></div><div>StartListening()</div><div>SendData() - отправка инпута игрока</div>" style="rounded=0;whiteSpace=wrap;html=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-146" vertex="1">
|
||||||
|
<mxGeometry x="436.8800000000001" y="442.2660305343511" width="162.5" height="119.08396946564885" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-68" value="Листы<div>Tiles - только отрисовка<br><div>Walls - только отрисовка, но поверх тайлов</div><div>Entities - у них обнова аниматора</div></div>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;strokeColor=default;" parent="lzB2u7mNdVftqM7OZ14K-146" vertex="1">
|
||||||
|
<mxGeometry y="49.76709923664123" width="150" height="148.85496183206106" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-150" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-25" target="lzB2u7mNdVftqM7OZ14K-148" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="-1150" y="1430" as="targetPoint" />
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-720" y="1334" />
|
||||||
|
<mxPoint x="-720" y="1475" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-155" value="" style="group;rounded=1;strokeColor=#b85450;dashed=1;dashPattern=8 8;fillColor=#f8cecc;gradientColor=#ea6b66;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-1670" y="1210" width="630" height="370" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-147" value="AnimationContainer" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-155" vertex="1">
|
||||||
|
<mxGeometry x="410" y="20" width="220" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-152" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=1;entryDx=0;entryDy=0;shape=link;" parent="lzB2u7mNdVftqM7OZ14K-155" source="lzB2u7mNdVftqM7OZ14K-148" target="lzB2u7mNdVftqM7OZ14K-149" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-148" value="GraphicsComponent<div><br></div><div>StartAnimation()<span style="color: rgba(0, 0, 0, 0); font-family: monospace; font-size: 0px; text-align: start; text-wrap: nowrap; background-color: initial;">%3CmxGraphModel%3E%3Croot%3E%3CmxCell%20id%3D%220%22%2F%3E%3CmxCell%20id%3D%221%22%20parent%3D%220%22%2F%3E%3CmxCell%20id%3D%222%22%20value%3D%22AnimationContainer%22%20style%3D%22rounded%3D0%3BwhiteSpace%3Dwrap%3Bhtml%3D1%3B%22%20vertex%3D%221%22%20parent%3D%221%22%3E%3CmxGeometry%20x%3D%221210%22%20y%3D%221280%22%20width%3D%22220%22%20height%3D%22130%22%20as%3D%22geometry%22%2F%3E%3C%2FmxCell%3E%3C%2Froot%3E%3C%2FmxGraphModel%3E</span></div><div>UpdateAnimation()</div><div><br></div><div>TODO перенести кусочек про зацикливание кода</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-155" vertex="1">
|
||||||
|
<mxGeometry x="70" y="240" width="220" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-153" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;shape=link;" parent="lzB2u7mNdVftqM7OZ14K-155" source="lzB2u7mNdVftqM7OZ14K-149" target="lzB2u7mNdVftqM7OZ14K-147" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-149" value="AnimationBuilder<div><br></div><div>В начале загружает анимации, а затем распределяет анимации по контейнерам</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-155" vertex="1">
|
||||||
|
<mxGeometry width="360" height="170" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-154" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.637;entryY=1.017;entryDx=0;entryDy=0;entryPerimeter=0;" parent="lzB2u7mNdVftqM7OZ14K-155" source="lzB2u7mNdVftqM7OZ14K-148" target="lzB2u7mNdVftqM7OZ14K-147" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="550" y="300" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-169" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;dashed=1;dashPattern=8 8;curved=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-4" target="lzB2u7mNdVftqM7OZ14K-90" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-170" value="Game Over<div>PlayerData.AddLoot()</div>" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];" parent="lzB2u7mNdVftqM7OZ14K-169" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-0.0087" y="2" relative="1" as="geometry">
|
||||||
|
<mxPoint as="offset" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-172" value="InputManager<div><br></div><div>Здесь эвенты нажатий, на которые можно подписываться тем, кому надо</div>" style="rhombus;whiteSpace=wrap;html=1;fillColor=#6d8764;fontColor=#ffffff;strokeColor=#3A5431;" parent="1" vertex="1">
|
||||||
|
<mxGeometry x="-1560" y="-1030" width="260" height="250" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-196" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=link;dashed=1;dashPattern=1 4;fillColor=#fff2cc;strokeColor=#d6b656;strokeWidth=8;" parent="1" source="lzB2u7mNdVftqM7OZ14K-61" target="lzB2u7mNdVftqM7OZ14K-46" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-30" value="" style="group;rounded=1;dashed=1;dashPattern=8 8;strokeColor=#6c8ebf;fillColor=#dae8fc;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-1150" y="-1530" width="370" height="410" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-3" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="TA6NM5vga4TUYUKUYXcC-30" source="TA6NM5vga4TUYUKUYXcC-1" target="TA6NM5vga4TUYUKUYXcC-2" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-1" value="ItemManager<div><br></div><div>Dictionary&lt;string, ItemInfo&gt; tagItemPairs - когда нужно получить инфу о текстуре, зная её таг, ищется это тут</div><div><br></div><div>ItemInfo GetItemInfo(string tag)</div><div><br><div>LoadResourcesTextures()</div></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-30" vertex="1">
|
||||||
|
<mxGeometry width="369" height="150" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-15" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="TA6NM5vga4TUYUKUYXcC-30" source="TA6NM5vga4TUYUKUYXcC-2" target="TA6NM5vga4TUYUKUYXcC-14" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-2" value="<div>ItemInfo</div><div><br></div><div>string tag</div><div>string TextureName</div><div>Texture2D Itemtexture</div><div>bool isCraftable</div><div>Dictionary&lt;string, int&gt; resourcesNeededToCraft()</div><div>LoadTexture()</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-30" vertex="1">
|
||||||
|
<mxGeometry y="170" width="370" height="150" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-14" value="<div>WeaponItemInfo</div><div>float damage</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-30" vertex="1">
|
||||||
|
<mxGeometry y="370" width="370" height="40" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-31" value="" style="group;strokeColor=#82b366;rounded=1;dashed=1;fillColor=#d5e8d4;gradientColor=#97d077;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-560" y="1750" width="380" height="670" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-187" value="LootData<div>Контейнер Лута для удобства использования</div><div><br></div><div><div>AddLoot(object lootObject, int quantity)&nbsp;</div></div><div>Dictionary&lt;string, int&gt; loots</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-31" vertex="1">
|
||||||
|
<mxGeometry x="120" width="180" height="130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-20" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="TA6NM5vga4TUYUKUYXcC-31" source="TA6NM5vga4TUYUKUYXcC-16" target="TA6NM5vga4TUYUKUYXcC-18" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-21" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="TA6NM5vga4TUYUKUYXcC-31" source="TA6NM5vga4TUYUKUYXcC-16" target="TA6NM5vga4TUYUKUYXcC-17" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="190.25" y="500" />
|
||||||
|
<mxPoint x="70.25" y="500" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-22" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=flexArrow;" parent="TA6NM5vga4TUYUKUYXcC-31" source="TA6NM5vga4TUYUKUYXcC-16" target="TA6NM5vga4TUYUKUYXcC-19" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="190.25" y="500" />
|
||||||
|
<mxPoint x="330.25" y="500" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-16" value="IPlayerWeapon<div>Attack()</div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-31" vertex="1">
|
||||||
|
<mxGeometry x="130" y="400" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-17" value="HandAttack" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-31" vertex="1">
|
||||||
|
<mxGeometry y="610" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-18" value="SwordAttack" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-31" vertex="1">
|
||||||
|
<mxGeometry x="129.62" y="610" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-19" value="GunAttack" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-31" vertex="1">
|
||||||
|
<mxGeometry x="260" y="610" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-188" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-70" target="lzB2u7mNdVftqM7OZ14K-187" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-70" target="TA6NM5vga4TUYUKUYXcC-16" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-60" y="2105" />
|
||||||
|
<mxPoint x="-61" y="2180" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-32" value="" style="group;strokeColor=#6c8ebf;rounded=1;fillColor=#dae8fc;gradientColor=#7ea6e0;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="540" y="130" width="640" height="800" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-23" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="TA6NM5vga4TUYUKUYXcC-32" source="lzB2u7mNdVftqM7OZ14K-6" target="lzB2u7mNdVftqM7OZ14K-16" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-30" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;" parent="TA6NM5vga4TUYUKUYXcC-32" source="lzB2u7mNdVftqM7OZ14K-6" target="lzB2u7mNdVftqM7OZ14K-27" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<mxPoint x="230" y="87.5" as="sourcePoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-6" value="<div>CollisionManager</div>Система физики<div>- апедейт позиций, проверив на коллизии</div><div>UpdatePositions()</div><div>GetObjectsInArea(Rectangle area)</div>" style="rhombus;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry width="230" height="175" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-15" value="<div><span style="background-color: initial;">ColliderComponent</span><br></div><div><span style="background-color: initial;">Entity myEntity</span></div><div><span style="background-color: initial;">- подключается к объекту</span><br></div><div>- регистрирует себя в CollisionManager</div><div>- Rectangle, который не дает на себя пройти</div><div><br></div><div>bool doesStop - является этот колайдера<br></div><div>Rectangle stopRectangle</div><div><br></div><div><br></div><div><div>bool isTrigger</div><div>Rectangle triggerRectangle</div><div><br></div><div>OnTriggerEnter&nbsp;<span style="background-color: initial;">- игрок вошел в область взаимодействия объекта</span></div><div>OnTriggerZone - вызывается пока игрок в области триггера</div><div>OnTriggerExit -<span style="background-color: initial;">&nbsp;игрок вышел из области взаимодействия объекта</span></div></div><div><span style="background-color: initial;"><br></span></div><div>На эти эвенты подписываются в вещах, типо лута и дверей. Человек пишет код этих вещей и что происходит, когда к ним кто-то подходит</div><div><br></div><div><br></div><div><br></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry x="270" y="352.5" width="280" height="437.5" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-175" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=link;" parent="TA6NM5vga4TUYUKUYXcC-32" source="lzB2u7mNdVftqM7OZ14K-16" target="lzB2u7mNdVftqM7OZ14K-15" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="340" y="330" />
|
||||||
|
<mxPoint x="340" y="330" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-16" value="Лист&nbsp;<div><span style="background-color: initial;">CollisionComponent</span></div>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry x="260" y="168.75" width="160" height="35" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-24" value="Это подключается в<div>игроке, на стенах</div><div>на врагах</div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry x="490" y="740" width="120" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-176" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;shape=link;" parent="TA6NM5vga4TUYUKUYXcC-32" source="lzB2u7mNdVftqM7OZ14K-27" target="lzB2u7mNdVftqM7OZ14K-15" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="525" y="310" />
|
||||||
|
<mxPoint x="525" y="310" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-27" value="Лист&nbsp;<div><span style="background-color: initial;">TriggerComponent</span></div>" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry x="450" y="168.75" width="140" height="35" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-174" value="Разнести на два компонента?" style="ellipse;shape=cloud;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-32" vertex="1">
|
||||||
|
<mxGeometry x="500" y="310" width="140" height="90" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-34" value="" style="group;fillColor=#ffcccc;strokeColor=#36393d;rounded=1;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-620" y="-950" width="380" height="510" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-2" value="App manager<div><br><div>- большая стейт машина, каждый стейт - экран (менюшки+игра)</div><div><br></div><div><br></div><div>AbstractGUI currentGUI - текущий гуи, который мы рисуем</div><div><br></div><div>ChangeGUI()</div><div><br></div><div>Update() - Обновлять по стейту</div><div><span style="background-color: initial;">currentGUI</span><span style="background-color: initial;">.Update()</span></div><div>GameEnded(Loot)</div></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-34" vertex="1">
|
||||||
|
<mxGeometry width="380" height="310" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-119" value="" style="group;strokeColor=default;dashed=1;dashPattern=8 8;rounded=1;" parent="TA6NM5vga4TUYUKUYXcC-34" vertex="1" connectable="0">
|
||||||
|
<mxGeometry y="340" width="380" height="170" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-114" value="Наша Стейт Машина<div>NotPlaying<div>HostPlaying</div><div>ClientPlaying</div></div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-119" vertex="1">
|
||||||
|
<mxGeometry x="129.99999999999994" width="119.99999999999996" height="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-115" value="NotPlaying<div>GUI.update()</div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-119" vertex="1">
|
||||||
|
<mxGeometry y="110" width="119.99999999999996" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-116" value="HostPlaying<div>GUI.update()</div><div>Server.update()<br></div><div>client.update()<br></div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-119" vertex="1">
|
||||||
|
<mxGeometry x="129.99999999999994" y="110" width="119.99999999999996" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-117" value="<br><div><div>ClientPlaying</div><div>GUI.update()</div><div>client.update()</div></div>" style="rounded=1;whiteSpace=wrap;html=1;" parent="lzB2u7mNdVftqM7OZ14K-119" vertex="1">
|
||||||
|
<mxGeometry x="259.9999999999999" y="110" width="119.99999999999996" height="60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="TA6NM5vga4TUYUKUYXcC-35" value="" style="group;fillColor=#fff2cc;strokeColor=#d6b656;rounded=1;dashed=1;" parent="1" vertex="1" connectable="0">
|
||||||
|
<mxGeometry x="-440" y="240" width="190" height="323" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-51" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="TA6NM5vga4TUYUKUYXcC-35" source="lzB2u7mNdVftqM7OZ14K-46" target="lzB2u7mNdVftqM7OZ14K-49" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="95" y="311" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-46" value="<div>ServerNetworkManager</div><div>StartWaitingForPlayers() - Слушает игроков, которые хотят подключиться</div><div><br></div><div>StartListening() - начать слушать клиентов в самой игре</div><div><br></div><div>SendData() - каждый тик</div><div>AddData(<span style="background-color: initial;">IUpdateData</span><span style="background-color: initial;">)</span></div>" style="rounded=0;whiteSpace=wrap;html=1;" parent="TA6NM5vga4TUYUKUYXcC-35" vertex="1">
|
||||||
|
<mxGeometry width="190" height="170" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-49" value="Лист Updates" style="shape=process;whiteSpace=wrap;html=1;backgroundOutline=1;" parent="TA6NM5vga4TUYUKUYXcC-35" vertex="1">
|
||||||
|
<mxGeometry x="55" y="298" width="80" height="25" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="lzB2u7mNdVftqM7OZ14K-79" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;" parent="1" source="lzB2u7mNdVftqM7OZ14K-25" target="lzB2u7mNdVftqM7OZ14K-15" edge="1">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
20
.run/ZoFo.run.xml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="ZoFo" type="DotNetProject" factoryName=".NET Project">
|
||||||
|
<option name="EXE_PATH" value="$PROJECT_DIR$/ZoFo/bin/Debug/net8.0/ZoFo" />
|
||||||
|
<option name="PROGRAM_PARAMETERS" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/ZoFo/bin/Debug/net8.0" />
|
||||||
|
<option name="PASS_PARENT_ENVS" value="1" />
|
||||||
|
<option name="USE_EXTERNAL_CONSOLE" value="0" />
|
||||||
|
<option name="USE_MONO" value="0" />
|
||||||
|
<option name="RUNTIME_ARGUMENTS" value="" />
|
||||||
|
<option name="PROJECT_PATH" value="$PROJECT_DIR$/ZoFo/ZoFo.csproj" />
|
||||||
|
<option name="PROJECT_EXE_PATH_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_ARGUMENTS_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_WORKING_DIRECTORY_TRACKING" value="1" />
|
||||||
|
<option name="PROJECT_KIND" value="DotNetCore" />
|
||||||
|
<option name="PROJECT_TFM" value="net8.0" />
|
||||||
|
<method v="2">
|
||||||
|
<option name="Build" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -1,13 +1,11 @@
|
||||||
using DangerousD.GameCore.Graphics;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using NativeFileDialogSharp;
|
using NativeFileDialogSharp;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
using Zofo.GameCore.ZoFo_grafics;
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace AnimationsFileCreator
|
namespace AnimationsFileCreator
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
|
@ -22,7 +20,8 @@ namespace AnimationsFileCreator
|
||||||
{
|
{
|
||||||
|
|
||||||
DialogResult result = Dialog.FileOpen();
|
DialogResult result = Dialog.FileOpen();
|
||||||
textureName = result.Path.Split('\\').Last();
|
var temp = result.Path.Split('\\');
|
||||||
|
textureName = temp[temp.Length-2] + "/"+temp[temp.Length - 1];
|
||||||
textureName = textureName.Split('.')[0];
|
textureName = textureName.Split('.')[0];
|
||||||
}
|
}
|
||||||
Console.WriteLine("Введите количество кадров анимации: ");
|
Console.WriteLine("Введите количество кадров анимации: ");
|
||||||
|
@ -60,11 +59,11 @@ namespace AnimationsFileCreator
|
||||||
container.FrameTime = new System.Collections.Generic.List<Tuple<int, int>>();
|
container.FrameTime = new System.Collections.Generic.List<Tuple<int, int>>();
|
||||||
container.FrameTime.Add(new Tuple<int, int>(0, interval));
|
container.FrameTime.Add(new Tuple<int, int>(0, interval));
|
||||||
container.StartSpriteRectangle = rectangle;
|
container.StartSpriteRectangle = rectangle;
|
||||||
container.TextureName = textureName;
|
container.TextureName = "Textures/AnimationTextures/"+textureName;
|
||||||
container.TextureFrameInterval = 1;
|
container.TextureFrameInterval = 0;
|
||||||
container.Id = id;
|
container.Id = id;
|
||||||
string json = JsonConvert.SerializeObject(container);
|
string json = JsonConvert.SerializeObject(container);
|
||||||
StreamWriter writer = new StreamWriter("../../../../ZoFo/Content/animations/"+id);
|
StreamWriter writer = new StreamWriter("../../../../ZoFo/Content/Textures/Animations/"+id+ ".animation");
|
||||||
writer.WriteLine(json);
|
writer.WriteLine(json);
|
||||||
writer.Close();
|
writer.Close();
|
||||||
}
|
}
|
||||||
|
|
1
GameSettings.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{"IsFullScreen":false,"MainVolume":1.0,"MusicVolume":1.0,"SoundEffectsVolume":1.0,"Resolution":{"X":1440,"Y":900}}
|
|
@ -53,9 +53,9 @@ namespace MonogameLibrary.UI.Elements
|
||||||
|
|
||||||
public override void LoadTexture(ContentManager content)
|
public override void LoadTexture(ContentManager content)
|
||||||
{
|
{
|
||||||
texture1 = content.Load<Texture2D>("Textures\\GUI\\checkboxs_off");
|
texture1 = content.Load<Texture2D>("Textures/GUI/checkboxs_off");
|
||||||
texture2 = content.Load<Texture2D>("Textures\\GUI\\checkboxs_off-on");
|
texture2 = content.Load<Texture2D>("Textures/GUI/checkboxs_off-on");
|
||||||
texture3 = content.Load<Texture2D>("Textures\\GUI\\checkboxs_on");
|
texture3 = content.Load<Texture2D>("Textures/GUI/checkboxs_on");
|
||||||
base.LoadTexture(content);
|
base.LoadTexture(content);
|
||||||
}
|
}
|
||||||
public override void Draw(SpriteBatch _spriteBatch)
|
public override void Draw(SpriteBatch _spriteBatch)
|
||||||
|
|
|
@ -59,7 +59,7 @@ namespace MonogameLibrary.UI.Elements
|
||||||
|
|
||||||
public override void LoadTexture(ContentManager content)
|
public override void LoadTexture(ContentManager content)
|
||||||
{
|
{
|
||||||
texture2 = content.Load<Texture2D>("Textures\\GUI\\switch");
|
texture2 = content.Load<Texture2D>("Textures/GUI/switch");
|
||||||
base.LoadTexture(content);
|
base.LoadTexture(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@
|
||||||
#begin MapData/TileMaps/main.tmx
|
#begin MapData/TileMaps/main.tmx
|
||||||
/copy:MapData/TileMaps/main.tmx
|
/copy:MapData/TileMaps/main.tmx
|
||||||
|
|
||||||
#begin MapData/TileSets/TileSet 1.tsj
|
#begin MapData/TileSets/CollisionTileSet.tsj
|
||||||
/copy:MapData/TileSets/TileSet 1.tsj
|
/copy:MapData/TileSets/CollisionTileSet.tsj
|
||||||
|
|
||||||
#begin sounds/Loot.wav
|
#begin sounds/Loot.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
|
@ -73,12 +73,6 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Tabletki 2.wav
|
/build:sounds/Tabletki 2.wav
|
||||||
|
|
||||||
#begin sounds/Tabletki.mp3
|
|
||||||
/importer:Mp3Importer
|
|
||||||
/processor:SongProcessor
|
|
||||||
/processorParam:Quality=Best
|
|
||||||
/build:sounds/Tabletki.mp3
|
|
||||||
|
|
||||||
#begin sounds/Zombi napal.wav
|
#begin sounds/Zombi napal.wav
|
||||||
/importer:WavImporter
|
/importer:WavImporter
|
||||||
/processor:SoundEffectProcessor
|
/processor:SoundEffectProcessor
|
||||||
|
@ -91,6 +85,105 @@
|
||||||
/processorParam:Quality=Best
|
/processorParam:Quality=Best
|
||||||
/build:sounds/Zombi stoit.wav
|
/build:sounds/Zombi stoit.wav
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_idle_top_noweapon.animation
|
||||||
|
/copy:Textures/Animations/player_idle_top_noweapon.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_idle_top-right_noweapon.animation
|
||||||
|
/copy:Textures/Animations/player_idle_top-right_noweapon.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/player_running_top_rotate.animation
|
||||||
|
/copy:Textures/Animations/player_running_top_rotate.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/running_top.animation
|
||||||
|
/copy:Textures/Animations/running_top.animation
|
||||||
|
|
||||||
|
#begin Textures/Animations/testAnimationExample.animation
|
||||||
|
/copy:Textures/Animations/testAnimationExample.animation
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_idle_gun.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:Textures/AnimationTextures/Character/hr-level1_idle_gun.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_idle.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:Textures/AnimationTextures/Character/hr-level1_idle.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-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:Textures/AnimationTextures/Character/hr-level1_mining_tool-1.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_mining_tool-2.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:Textures/AnimationTextures/Character/hr-level1_mining_tool-2.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_running_gun.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:Textures/AnimationTextures/Character/hr-level1_running_gun.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/Character/hr-level1_running.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:Textures/AnimationTextures/Character/hr-level1_running.png
|
||||||
|
|
||||||
|
#begin Textures/AnimationTextures/unicorn.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:Textures/AnimationTextures/unicorn.png
|
||||||
|
|
||||||
#begin Textures/GUI/background/base.png
|
#begin Textures/GUI/background/base.png
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
|
@ -269,6 +362,7 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
|
|
||||||
/build:Textures/Test/pickaxe.webp
|
/build:Textures/Test/pickaxe.webp
|
||||||
|
|
||||||
#begin Textures/Test/rock.jpg
|
#begin Textures/Test/rock.jpg
|
||||||
|
@ -281,9 +375,11 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
|
|
||||||
/build:Textures/Test/rock.jpg
|
/build:Textures/Test/rock.jpg
|
||||||
|
|
||||||
#begin Textures/Test/steel.png
|
#begin Textures/Test/steel.png
|
||||||
|
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
@ -293,9 +389,11 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
|
|
||||||
/build:Textures/Test/steel.png
|
/build:Textures/Test/steel.png
|
||||||
|
|
||||||
#begin Textures/Test/wood.jpg
|
#begin Textures/Test/wood.jpg
|
||||||
|
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
@ -305,9 +403,11 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
|
|
||||||
/build:Textures/Test/wood.jpg
|
/build:Textures/Test/wood.jpg
|
||||||
|
|
||||||
#begin Textures/TileSets/TilesetFloor.png
|
#begin Textures/TileSets/TilesetFloor.png
|
||||||
|
|
||||||
/importer:TextureImporter
|
/importer:TextureImporter
|
||||||
/processor:TextureProcessor
|
/processor:TextureProcessor
|
||||||
/processorParam:ColorKeyColor=255,0,255,255
|
/processorParam:ColorKeyColor=255,0,255,255
|
||||||
|
@ -317,5 +417,7 @@
|
||||||
/processorParam:ResizeToPowerOfTwo=False
|
/processorParam:ResizeToPowerOfTwo=False
|
||||||
/processorParam:MakeSquare=False
|
/processorParam:MakeSquare=False
|
||||||
/processorParam:TextureFormat=Color
|
/processorParam:TextureFormat=Color
|
||||||
|
|
||||||
/build:Textures/TileSets/TilesetFloor.png
|
/build:Textures/TileSets/TilesetFloor.png
|
||||||
|
|
||||||
|
|
||||||
|
|
14
ZoFo/Content/MapData/MapSession.tiled-project
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"automappingRulesFile": "",
|
||||||
|
"commands": [
|
||||||
|
],
|
||||||
|
"compatibilityVersion": 1100,
|
||||||
|
"extensionsPath": "extensions",
|
||||||
|
"folders": [
|
||||||
|
"."
|
||||||
|
],
|
||||||
|
"properties": [
|
||||||
|
],
|
||||||
|
"propertyTypes": [
|
||||||
|
]
|
||||||
|
}
|
57
ZoFo/Content/MapData/MapSession.tiled-session
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
"Map/SizeTest": {
|
||||||
|
"height": 4300,
|
||||||
|
"width": 2
|
||||||
|
},
|
||||||
|
"activeFile": "TileMaps/main.tmj",
|
||||||
|
"expandedProjectPaths": [
|
||||||
|
".",
|
||||||
|
"TileSets",
|
||||||
|
"TileMaps"
|
||||||
|
],
|
||||||
|
"fileStates": {
|
||||||
|
"TileMaps/TileSets/TileSet 1.tsj": {
|
||||||
|
"scaleInDock": 1
|
||||||
|
},
|
||||||
|
"TileMaps/main.tmj": {
|
||||||
|
"scale": 0.75,
|
||||||
|
"selectedLayer": 0,
|
||||||
|
"viewCenter": {
|
||||||
|
"x": 578,
|
||||||
|
"y": 482.66666666666674
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"TileSets/CollisionTileSet.tsj": {
|
||||||
|
"scaleInDock": 0.75,
|
||||||
|
"scaleInEditor": 1
|
||||||
|
},
|
||||||
|
"TileSets/TileSet 1.tsj": {
|
||||||
|
"scaleInDock": 1,
|
||||||
|
"scaleInEditor": 1.5
|
||||||
|
},
|
||||||
|
"TileSets/WallSet.tsj": {
|
||||||
|
"scaleInDock": 1,
|
||||||
|
"scaleInEditor": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"last.imagePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/Textures/TileSetImages",
|
||||||
|
"openFiles": [
|
||||||
|
"TileSets/TileSet 1.tsj",
|
||||||
|
"TileMaps/main.tmj",
|
||||||
|
"TileSets/CollisionTileSet.tsj"
|
||||||
|
],
|
||||||
|
"project": "MapSession.tiled-project",
|
||||||
|
"recentFiles": [
|
||||||
|
"TileMaps/main.tmj",
|
||||||
|
"TileSets/TileSet 1.tsj",
|
||||||
|
"TileSets/CollisionTileSet.tsj",
|
||||||
|
"TileSets/WallSet.tsj"
|
||||||
|
],
|
||||||
|
"tileset.lastUsedFormat": "json",
|
||||||
|
"tileset.margin": 2,
|
||||||
|
"tileset.spacing": 2,
|
||||||
|
"tileset.tileSize": {
|
||||||
|
"height": 128,
|
||||||
|
"width": 128
|
||||||
|
}
|
||||||
|
}
|
435
ZoFo/Content/MapData/TileSets/CollisionTileSet.tsj
Normal file
|
@ -0,0 +1,435 @@
|
||||||
|
{ "columns":5,
|
||||||
|
"image":"..\/..\/Textures\/TileSetImages\/Tilelist2.png",
|
||||||
|
"imageheight":1302,
|
||||||
|
"imagewidth":652,
|
||||||
|
"margin":2,
|
||||||
|
"name":"CollisionTileSet",
|
||||||
|
"spacing":2,
|
||||||
|
"tilecount":50,
|
||||||
|
"tiledversion":"1.10.2",
|
||||||
|
"tileheight":128,
|
||||||
|
"tiles":[
|
||||||
|
{
|
||||||
|
"id":0,
|
||||||
|
"type":"Tiles"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":1,
|
||||||
|
"type":"Tiles"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":2,
|
||||||
|
"type":"Tiles"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":3,
|
||||||
|
"type":"Tiles"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":4,
|
||||||
|
"type":"Tiles"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":5,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":128,
|
||||||
|
"id":1,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":37,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height":36.3333333333333,
|
||||||
|
"id":2,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":127.333333333333,
|
||||||
|
"x":0.666666666666671,
|
||||||
|
"y":0
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":6,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":128.333333333333,
|
||||||
|
"id":4,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":35.6666666666667,
|
||||||
|
"x":0.666666666666667,
|
||||||
|
"y":0
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":7,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":128,
|
||||||
|
"id":1,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":36,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height":36.6666666666667,
|
||||||
|
"id":2,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":128.666666666667,
|
||||||
|
"x":0,
|
||||||
|
"y":91.3333333333333
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":8,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":36,
|
||||||
|
"id":1,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":127.666666666667,
|
||||||
|
"x":0,
|
||||||
|
"y":91.6666666666667
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":9,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":36,
|
||||||
|
"id":1,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":127.666666666667,
|
||||||
|
"x":0,
|
||||||
|
"y":0.333333333333333
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":10,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":36.6666666666667,
|
||||||
|
"id":2,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":128.333333333333,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height":127.666666666667,
|
||||||
|
"id":3,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":36.6666666666667,
|
||||||
|
"x":91.6666666666667,
|
||||||
|
"y":0.333333333333329
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":11,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":127.666666666667,
|
||||||
|
"id":1,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":37,
|
||||||
|
"x":91,
|
||||||
|
"y":0.333333333333333
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":12,
|
||||||
|
"objectgroup":
|
||||||
|
{
|
||||||
|
"draworder":"index",
|
||||||
|
"name":"",
|
||||||
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":128,
|
||||||
|
"id":4,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":37,
|
||||||
|
"x":91,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"height":36.6666666666667,
|
||||||
|
"id":5,
|
||||||
|
"name":"",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"",
|
||||||
|
"visible":true,
|
||||||
|
"width":128,
|
||||||
|
"x":0,
|
||||||
|
"y":91.3333333333333
|
||||||
|
}],
|
||||||
|
"opacity":1,
|
||||||
|
"type":"objectgroup",
|
||||||
|
"visible":true,
|
||||||
|
"x":0,
|
||||||
|
"y":0
|
||||||
|
},
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":13,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":14,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":15,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":16,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":17,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":18,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":19,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":20,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":21,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":22,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":23,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":24,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":25,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":26,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":27,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":28,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":29,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":30,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":31,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":32,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":33,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":34,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":35,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":36,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":37,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":38,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":39,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":40,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":41,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":42,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":43,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":44,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":45,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":46,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":47,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":48,
|
||||||
|
"type":"StopObject"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":49,
|
||||||
|
"type":"StopObject"
|
||||||
|
}],
|
||||||
|
"tilewidth":128,
|
||||||
|
"type":"tileset",
|
||||||
|
"version":"1.10"
|
||||||
|
}
|
After Width: | Height: | Size: 1 MiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 1 MiB |
After Width: | Height: | Size: 1 MiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 3 MiB |
BIN
ZoFo/Content/Textures/AnimationTextures/unicorn.png
Normal file
After Width: | Height: | Size: 34 KiB |
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"id": "player_idle_top-right_noweapon",
|
||||||
|
"textureName": "Textures/AnimationTextures/Character/hr-level1_idle",
|
||||||
|
"startSpriteRectangle": {
|
||||||
|
"X": 0,
|
||||||
|
"Y": 116,
|
||||||
|
"Width": 92,
|
||||||
|
"Height": 116
|
||||||
|
},
|
||||||
|
"frameSecond": [
|
||||||
|
{
|
||||||
|
"Item1": 0,
|
||||||
|
"Item2": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"textureFrameInterval": 0,
|
||||||
|
"framesCount": 22,
|
||||||
|
"isCycle": true,
|
||||||
|
"offset": "0, 0"
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"id": "player_idle_top_noweapon",
|
||||||
|
"textureName": "Textures/AnimationTextures/Character/hr-level1_idle",
|
||||||
|
"startSpriteRectangle": {
|
||||||
|
"X": 0,
|
||||||
|
"Y": 0,
|
||||||
|
"Width": 92,
|
||||||
|
"Height": 116
|
||||||
|
},
|
||||||
|
"frameSecond": [
|
||||||
|
{
|
||||||
|
"Item1": 0,
|
||||||
|
"Item2": 5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"textureFrameInterval": 0,
|
||||||
|
"framesCount": 22,
|
||||||
|
"isCycle": true,
|
||||||
|
"offset": "0, 0"
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"id":"player_running_top_rotate","textureName":"Textures/AnimationTextures/Character/hr-level1_idle","startSpriteRectangle":{"X":0,"Y":0,"Width":92,"Height":116},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":22,"isCycle":true,"offset":"0, 0"}
|
20
ZoFo/Content/Textures/Animations/running_top.animation
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"id": "running_top",
|
||||||
|
"textureName": "unicorn",
|
||||||
|
"startSpriteRectangle": {
|
||||||
|
"X": 0,
|
||||||
|
"Y": 30,
|
||||||
|
"Width": 30,
|
||||||
|
"Height": 60
|
||||||
|
},
|
||||||
|
"frameSecond": [
|
||||||
|
{
|
||||||
|
"Item1": 0,
|
||||||
|
"Item2": 2
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"textureFrameInterval": 1,
|
||||||
|
"framesCount": 22,
|
||||||
|
"isCycle": true,
|
||||||
|
"offset": "0, 0"
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{"id":"testAnimationExample","textureName":"Textures/AnimationTextures/unicorn","startSpriteRectangle":{"X":0,"Y":0,"Width":400,"Height":400},"frameSecond":[{"Item1":0,"Item2":1}],"textureFrameInterval":1,"framesCount":1,"isCycle":true,"offset":"0, 0"}
|
BIN
ZoFo/Content/Textures/TileSetImages/Tilelist1.png
Normal file
After Width: | Height: | Size: 769 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/Tilelist2.png
Normal file
After Width: | Height: | Size: 578 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/Tilelist3.png
Normal file
After Width: | Height: | Size: 2.1 MiB |
BIN
ZoFo/Content/Textures/TileSetImages/Tilelist4.png
Normal file
After Width: | Height: | Size: 120 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetFloor.png
Normal file
After Width: | Height: | Size: 399 KiB |
Before Width: | Height: | Size: 29 KiB |
BIN
ZoFo/Content/Textures/icons/12.png
Normal file
After Width: | Height: | Size: 224 KiB |
BIN
ZoFo/Content/Textures/icons/13.png
Normal file
After Width: | Height: | Size: 176 KiB |
BIN
ZoFo/Content/Textures/icons/14.png
Normal file
After Width: | Height: | Size: 227 KiB |
BIN
ZoFo/Content/Textures/icons/21.png
Normal file
After Width: | Height: | Size: 178 KiB |
BIN
ZoFo/Content/Textures/icons/22.png
Normal file
After Width: | Height: | Size: 141 KiB |
BIN
ZoFo/Content/Textures/icons/5.png
Normal file
After Width: | Height: | Size: 181 KiB |
BIN
ZoFo/Content/Textures/icons/6.png
Normal file
After Width: | Height: | Size: 216 KiB |
BIN
ZoFo/Content/Textures/icons/7.png
Normal file
After Width: | Height: | Size: 188 KiB |
BIN
ZoFo/Content/Textures/icons/8.png
Normal file
After Width: | Height: | Size: 204 KiB |
BIN
ZoFo/Content/Textures/icons/9.png
Normal file
After Width: | Height: | Size: 86 KiB |
|
@ -10,53 +10,78 @@ using System;
|
||||||
using ZoFo.GameCore.GameObjects;
|
using ZoFo.GameCore.GameObjects;
|
||||||
using ZoFo.GameCore.GameObjects.MapObjects;
|
using ZoFo.GameCore.GameObjects.MapObjects;
|
||||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
using ZoFo.GameCore.GameObjects.MapObjects.Tiles;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Reflection;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
using System.Net;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using ZoFo.GameCore.GUI;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
||||||
|
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||||
namespace ZoFo.GameCore
|
namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
public class Client
|
public class Client
|
||||||
{
|
{
|
||||||
|
#region Network part
|
||||||
|
|
||||||
ClientNetworkManager networkManager;
|
ClientNetworkManager networkManager;
|
||||||
|
|
||||||
public bool IsConnected { get { return networkManager.IsConnected; } }
|
public bool IsConnected { get { return networkManager.IsConnected; } }
|
||||||
|
public IPEndPoint InfoConnect => networkManager.InfoConnect;
|
||||||
|
|
||||||
public Client()
|
public Client()
|
||||||
{
|
{
|
||||||
networkManager = new ClientNetworkManager();
|
networkManager = new ClientNetworkManager();
|
||||||
networkManager.GetDataSent += OnDataSend;
|
networkManager.GetDataSent += OnDataSend;
|
||||||
|
|
||||||
|
// Подписка на действия инпутменеджера.
|
||||||
|
// Отправляются данные апдейтса с обновлением инпута
|
||||||
|
AppManager.Instance.InputManager.ActionEvent += () => networkManager.AddData(new UpdateInput(){
|
||||||
|
InputMovementDirection = AppManager.Instance.InputManager.InputMovementDirection,
|
||||||
|
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnDataSend(string data)
|
public void OnDataSend(string data)
|
||||||
{
|
{
|
||||||
List<UpdateData> updateDatas = JsonSerializer.Deserialize<List<UpdateData>>(data);
|
List<UpdateData> updateDatas = JsonSerializer.Deserialize<List<UpdateData>>(data);
|
||||||
// тут будет switch
|
// тут будет switch
|
||||||
|
AppManager.Instance.debugHud.Log(data);
|
||||||
foreach (var item in updateDatas)
|
foreach (var item in updateDatas)
|
||||||
{
|
{
|
||||||
/* switch (item.UpdateType) Здесь нужно отлавливать и регистрировать
|
GotData(item);
|
||||||
{
|
|
||||||
case "Tile":
|
|
||||||
MapObject map = new MapObject();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
public void GameEndedUnexpectedly() { }
|
public void GameEndedUnexpectedly() { }
|
||||||
public void JoinRoom(string ip)
|
|
||||||
{
|
|
||||||
networkManager.JoinRoom(ip);
|
|
||||||
}
|
|
||||||
public void JoinYourself() { networkManager.JoinYourself(); }
|
|
||||||
|
|
||||||
|
public void JoinRoom(string ip, int port)
|
||||||
|
{
|
||||||
|
networkManager.JoinRoom(ip, port);
|
||||||
|
}
|
||||||
|
public void JoinYourself(int port) { networkManager.JoinYourself(port); }
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
List<MapObject> mapObjects = new List<MapObject>();
|
List<MapObject> mapObjects = new List<MapObject>();
|
||||||
|
List<GameObject> gameObjects = new List<GameObject>();
|
||||||
|
List<StopObject> stopObjects = new List<StopObject>();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Клиент должен обнговлять игру анимаций
|
/// Клиент должен обнговлять игру анимаций
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="gameTime"></param>
|
/// <param name="gameTime"></param>
|
||||||
internal void Update(GameTime gameTime)
|
internal void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
|
for (int i = 0; i < gameObjects.Count; i++)
|
||||||
|
{
|
||||||
|
AppManager.Instance.debugHud.Set("GameTime", gameTime.TotalGameTime.ToString());
|
||||||
|
gameObjects[i].UpdateAnimations();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
internal void Draw(SpriteBatch spriteBatch)
|
internal void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
|
@ -64,6 +89,14 @@ namespace ZoFo.GameCore
|
||||||
{
|
{
|
||||||
mapObjects[i].Draw(spriteBatch);
|
mapObjects[i].Draw(spriteBatch);
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < stopObjects.Count; i++)
|
||||||
|
{
|
||||||
|
stopObjects[i].Draw(spriteBatch);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < gameObjects.Count; i++)
|
||||||
|
{
|
||||||
|
gameObjects[i].Draw(spriteBatch);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void GotData(UpdateData update)
|
internal void GotData(UpdateData update)
|
||||||
|
@ -78,6 +111,58 @@ namespace ZoFo.GameCore
|
||||||
(update as UpdateTileCreated).tileSetName
|
(update as UpdateTileCreated).tileSetName
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
else if (update is UpdateStopObjectCreated)
|
||||||
|
{
|
||||||
|
stopObjects.Add(
|
||||||
|
new StopObject(
|
||||||
|
(update as UpdateStopObjectCreated).Position,
|
||||||
|
(update as UpdateStopObjectCreated).Size.ToVector2(),
|
||||||
|
(update as UpdateStopObjectCreated).sourceRectangle,
|
||||||
|
(update as UpdateStopObjectCreated).tileSetName,
|
||||||
|
(update as UpdateStopObjectCreated).collisions
|
||||||
|
));
|
||||||
|
}
|
||||||
|
else if (update is UpdateGameObjectCreated)
|
||||||
|
{
|
||||||
|
if ((update as UpdateGameObjectCreated).GameObjectType == "EntittyForAnimationTests")
|
||||||
|
gameObjects.Add(new EntittyForAnimationTests((update as UpdateGameObjectCreated).position));
|
||||||
|
if ((update as UpdateGameObjectCreated).GameObjectType == "Player")
|
||||||
|
gameObjects.Add(new Player((update as UpdateGameObjectCreated).position));
|
||||||
|
if ((update as UpdateGameObjectCreated).GameObjectType == "Ammo")
|
||||||
|
gameObjects.Add(new Ammo((update as UpdateGameObjectCreated).position));
|
||||||
|
|
||||||
|
(gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
|
||||||
|
//var a = Assembly.GetAssembly(typeof(GameObject));
|
||||||
|
//gameObjects.Add( TODO reflection
|
||||||
|
//Activator.CreateInstance(Type.GetType("ZoFo.GameCore.GameObjects.Entities.EntittyForAnimationTests")
|
||||||
|
///*(update as UpdateGameObjectCreated).GameObjectType*/, new []{ new Vector2(100, 100) })
|
||||||
|
//as GameObject
|
||||||
|
//);
|
||||||
|
}
|
||||||
|
else if (update is UpdatePosition)
|
||||||
|
{
|
||||||
|
var ent = FindEntityById(update.IdEntity);
|
||||||
|
|
||||||
|
ent.position = (update as UpdatePosition).NewPosition;
|
||||||
|
DebugHUD.Instance.Log("newPosition " + ent.position);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public Entity FindEntityById(int id)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < gameObjects.Count; i++)
|
||||||
|
{
|
||||||
|
if (gameObjects[i] is Entity)
|
||||||
|
{
|
||||||
|
if ((gameObjects[i] as Entity).Id == id)
|
||||||
|
{
|
||||||
|
return gameObjects[i] as Entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -39,7 +39,7 @@ public abstract class AbstractGUI
|
||||||
public virtual void LoadContent()
|
public virtual void LoadContent()
|
||||||
{
|
{
|
||||||
Manager.LoadContent(AppManager.Instance.Content, "Font");
|
Manager.LoadContent(AppManager.Instance.Content, "Font");
|
||||||
mouse = AppManager.Instance.Content.Load<Texture2D>("Textures\\GUI\\mouse");
|
mouse = AppManager.Instance.Content.Load<Texture2D>("Textures/GUI/mouse");
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void Update(GameTime gameTime)
|
public virtual void Update(GameTime gameTime)
|
||||||
|
|
|
@ -13,14 +13,16 @@ public class DebugHUD
|
||||||
private SpriteFont _spriteFont;
|
private SpriteFont _spriteFont;
|
||||||
private Dictionary<string, string> _text = new();
|
private Dictionary<string, string> _text = new();
|
||||||
private List<string> _log = new();
|
private List<string> _log = new();
|
||||||
|
public static DebugHUD Instance { get; private set; }
|
||||||
|
|
||||||
public void Initialize()
|
public void Initialize()
|
||||||
{
|
{
|
||||||
|
Instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadContent()
|
public void LoadContent()
|
||||||
{
|
{
|
||||||
_spriteFont = AppManager.Instance.Content.Load<SpriteFont>("Fonts\\Font2");
|
_spriteFont = AppManager.Instance.Content.Load<SpriteFont>("Fonts/Font2");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
|
|
|
@ -22,11 +22,11 @@ public class MainMenuGUI : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\mainMenu" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/mainMenu" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
|
|
||||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 5, (int)(width / 4), (int)(height / 20)), text = "ZoFo", fontColor = Color.Black, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"});
|
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 5, (int)(width / 4), (int)(height / 20)), text = "ZoFo", fontColor = Color.Black, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font"});
|
||||||
|
|
||||||
|
|
||||||
Button playButton = new Button(Manager)
|
Button playButton = new Button(Manager)
|
||||||
|
@ -36,10 +36,11 @@ public class MainMenuGUI : AbstractGUI
|
||||||
scale = 0.2f,
|
scale = 0.2f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
playButton.LeftButtonPressed += () =>
|
playButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SoundManager.StartAmbientSound("Loot");
|
||||||
AppManager.Instance.SetGUI(new SelectModeMenu());
|
AppManager.Instance.SetGUI(new SelectModeMenu());
|
||||||
};
|
};
|
||||||
Elements.Add(playButton);
|
Elements.Add(playButton);
|
||||||
|
@ -64,10 +65,11 @@ public class MainMenuGUI : AbstractGUI
|
||||||
scale = 0.2f,
|
scale = 0.2f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
optionButton.LeftButtonPressed += () =>
|
optionButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
AppManager.Instance.SoundManager.StartAmbientSound("Loot");
|
||||||
AppManager.Instance.SetGUI(new OptionsGUI());
|
AppManager.Instance.SetGUI(new OptionsGUI());
|
||||||
};
|
};
|
||||||
Elements.Add(optionButton);
|
Elements.Add(optionButton);
|
||||||
|
@ -78,7 +80,7 @@ public class MainMenuGUI : AbstractGUI
|
||||||
scale = 0.2f,
|
scale = 0.2f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
exitButton.LeftButtonPressed += () =>
|
exitButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,24 +21,24 @@ public class OptionsGUI : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\options" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/options" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
|
|
||||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 5, (int)(width / 4), (int)(height / 20)), text = "Options", fontColor = Color.Black, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"});
|
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 5, (int)(width / 4), (int)(height / 20)), text = "Options", fontColor = Color.Black, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font"});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Label label_OverallVolume = new Label(Manager)
|
Label label_OverallVolume = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font", scale = 0.2f, text = "All Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font", scale = 0.2f, text = "All Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_OverallVolume);
|
Elements.Add(label_OverallVolume);
|
||||||
|
|
||||||
Label label_OverallVolume_Percent = new Label(Manager)
|
Label label_OverallVolume_Percent = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_OverallVolume_Percent);
|
Elements.Add(label_OverallVolume_Percent);
|
||||||
|
|
||||||
var slider_OverallVolume = new Slider(Manager)
|
var slider_OverallVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3, width / 10, height / 20), indentation = 7, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3, width / 10, height / 20), indentation = 7, textureName = "Textures/GUI/Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
slider_OverallVolume.SetValue(AppManager.Instance.SettingsManager.MainVolume);
|
slider_OverallVolume.SetValue(AppManager.Instance.SettingsManager.MainVolume);
|
||||||
label_OverallVolume_Percent.text = Math.Round(slider_OverallVolume.GetSliderValue * 100) + "%";
|
label_OverallVolume_Percent.text = Math.Round(slider_OverallVolume.GetSliderValue * 100) + "%";
|
||||||
slider_OverallVolume.SliderChanged += (newVal) =>
|
slider_OverallVolume.SliderChanged += (newVal) =>
|
||||||
|
@ -51,15 +51,15 @@ public class OptionsGUI : AbstractGUI
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
Label label_MusicVolume = new Label(Manager)
|
Label label_MusicVolume = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font", scale = 0.2f, text = "Music Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 1, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font", scale = 0.2f, text = "Music Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 1, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_MusicVolume);
|
Elements.Add(label_MusicVolume);
|
||||||
|
|
||||||
Label label_MusicVolume_Percent = new Label(Manager)
|
Label label_MusicVolume_Percent = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3 + (height / 20 + height / 40) * 1, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3 + (height / 20 + height / 40) * 1, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_MusicVolume_Percent);
|
Elements.Add(label_MusicVolume_Percent);
|
||||||
|
|
||||||
var slider_MusicVolume = new Slider(Manager)
|
var slider_MusicVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 1, width / 10, height / 20), indentation = 7, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 1, width / 10, height / 20), indentation = 7, textureName = "Textures/GUI/Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
slider_MusicVolume.SetValue(AppManager.Instance.SettingsManager.MusicVolume);
|
slider_MusicVolume.SetValue(AppManager.Instance.SettingsManager.MusicVolume);
|
||||||
label_MusicVolume_Percent.text = Math.Round(slider_MusicVolume.GetSliderValue * 100) + "%";
|
label_MusicVolume_Percent.text = Math.Round(slider_MusicVolume.GetSliderValue * 100) + "%";
|
||||||
slider_MusicVolume.SliderChanged += (newVal) =>
|
slider_MusicVolume.SliderChanged += (newVal) =>
|
||||||
|
@ -72,15 +72,15 @@ public class OptionsGUI : AbstractGUI
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
Label label_EffectsVolume = new Label(Manager)
|
Label label_EffectsVolume = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font", scale = 0.2f, text = "Effects Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 2, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font", scale = 0.2f, text = "Effects Volume", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 2, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_EffectsVolume);
|
Elements.Add(label_EffectsVolume);
|
||||||
|
|
||||||
Label label_EffectsVolume_Percent = new Label(Manager)
|
Label label_EffectsVolume_Percent = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3 + (height / 20 + height / 40) * 2, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "", fontColor = Color.Black, rectangle = new Rectangle(width / 2 + width / 10, height / 3 + (height / 20 + height / 40) * 2, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_EffectsVolume_Percent);
|
Elements.Add(label_EffectsVolume_Percent);
|
||||||
|
|
||||||
var slider_EffectsVolume = new Slider(Manager)
|
var slider_EffectsVolume = new Slider(Manager)
|
||||||
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 2, width / 10, height / 20), indentation = 7, textureName = "Textures\\GUI\\Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
{ rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 2, width / 10, height / 20), indentation = 7, textureName = "Textures/GUI/Switch_backgrownd", MinValue = 0, MaxValue = 1 };
|
||||||
slider_EffectsVolume.SetValue(AppManager.Instance.SettingsManager.SoundEffectsVolume);
|
slider_EffectsVolume.SetValue(AppManager.Instance.SettingsManager.SoundEffectsVolume);
|
||||||
label_EffectsVolume_Percent.text = Math.Round(slider_EffectsVolume.GetSliderValue * 100) + "%";
|
label_EffectsVolume_Percent.text = Math.Round(slider_EffectsVolume.GetSliderValue * 100) + "%";
|
||||||
slider_EffectsVolume.SliderChanged += (newVal) =>
|
slider_EffectsVolume.SliderChanged += (newVal) =>
|
||||||
|
@ -93,7 +93,7 @@ public class OptionsGUI : AbstractGUI
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
Label lblSwitchMode = new Label(Manager)
|
Label lblSwitchMode = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font", scale = 0.2f, text = "Resolution set", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font", scale = 0.2f, text = "Resolution set", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 3, width / 40, height / 20), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(lblSwitchMode);
|
Elements.Add(lblSwitchMode);
|
||||||
|
|
||||||
//var button_left_right_mode = new CheckBox(Manager) { rectangle = new Rectangle(rightBorder - checkboxlength, lblSwitchMode.rectangle.Y - 12, checkboxlength, checkboxlength) };
|
//var button_left_right_mode = new CheckBox(Manager) { rectangle = new Rectangle(rightBorder - checkboxlength, lblSwitchMode.rectangle.Y - 12, checkboxlength, checkboxlength) };
|
||||||
|
@ -102,7 +102,7 @@ public class OptionsGUI : AbstractGUI
|
||||||
|
|
||||||
|
|
||||||
Label label_IsFullScreen = new Label(Manager)
|
Label label_IsFullScreen = new Label(Manager)
|
||||||
{ fontName = "Fonts\\Font", scale = 0.2f, text = "Full Screen", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
{ fontName = "Fonts/Font", scale = 0.2f, text = "Full Screen", fontColor = Color.Black, rectangle = new Rectangle(width / 3, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40), mainColor = Color.Transparent, textAligment = MonogameLibrary.UI.Enums.TextAligment.Left };
|
||||||
Elements.Add(label_IsFullScreen);
|
Elements.Add(label_IsFullScreen);
|
||||||
|
|
||||||
var button_FullScreen = new CheckBox(Manager) { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40) };
|
var button_FullScreen = new CheckBox(Manager) { rectangle = new Rectangle(width / 2, height / 3 + (height / 20 + height / 40) * 4, width / 40, width / 40) };
|
||||||
|
@ -116,7 +116,7 @@ public class OptionsGUI : AbstractGUI
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
||||||
Button bTExit = new Button(Manager)
|
Button bTExit = new Button(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"};
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"};
|
||||||
Elements.Add(bTExit);
|
Elements.Add(bTExit);
|
||||||
bTExit.LeftButtonPressed += () =>
|
bTExit.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,11 +21,11 @@ public class SelectModeMenu : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\selectMode" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/selectMode" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
|
|
||||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 6, (int)(width / 4), (int)(height / 20)), text = "Select mode", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"});
|
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 6, (int)(width / 4), (int)(height / 20)), text = "Select mode", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font"});
|
||||||
|
|
||||||
Button singleButton = new Button(Manager)
|
Button singleButton = new Button(Manager)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ public class SelectModeMenu : AbstractGUI
|
||||||
scale = 0.3f,
|
scale = 0.3f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
singleButton.LeftButtonPressed += () =>
|
singleButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
@ -42,8 +42,7 @@ public class SelectModeMenu : AbstractGUI
|
||||||
Server server = new Server();
|
Server server = new Server();
|
||||||
Client client = new Client();
|
Client client = new Client();
|
||||||
server.CreateRoom(1);
|
server.CreateRoom(1);
|
||||||
client.JoinYourself();
|
client.JoinYourself(server.MyIp.Port);
|
||||||
|
|
||||||
AppManager.Instance.SetServer(server);
|
AppManager.Instance.SetServer(server);
|
||||||
AppManager.Instance.SetClient(client);
|
AppManager.Instance.SetClient(client);
|
||||||
AppManager.Instance.ChangeState(GameState.HostPlaying);
|
AppManager.Instance.ChangeState(GameState.HostPlaying);
|
||||||
|
@ -65,26 +64,19 @@ public class SelectModeMenu : AbstractGUI
|
||||||
scale = 0.3f,
|
scale = 0.3f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
optionButton.LeftButtonPressed += () =>
|
optionButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
AppManager.Instance.SetGUI(new SelectingServerGUI());
|
AppManager.Instance.SetGUI(new SelectingServerGUI());
|
||||||
// multi
|
// multi
|
||||||
Server server = new Server(); //Server Logic MultiPlayer
|
|
||||||
Client client = new Client();
|
|
||||||
server.CreateRoom(5);
|
|
||||||
client.JoinRoom("127.0.0.1"); //указать айпишник
|
|
||||||
AppManager.Instance.SetServer(server);
|
|
||||||
AppManager.Instance.SetClient(client);
|
|
||||||
string key = client.IsConnected.ToString();
|
|
||||||
AppManager.Instance.debugHud.Set(key, "MultiPlayer");
|
|
||||||
// ваш код здесь
|
// ваш код здесь
|
||||||
};
|
};
|
||||||
Elements.Add(optionButton);
|
Elements.Add(optionButton);
|
||||||
|
|
||||||
Button bTExit = new Button(Manager)
|
Button bTExit = new Button(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"};
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"};
|
||||||
Elements.Add(bTExit);
|
Elements.Add(bTExit);
|
||||||
bTExit.LeftButtonPressed += () =>
|
bTExit.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Content;
|
using Microsoft.Xna.Framework.Content;
|
||||||
|
@ -21,29 +22,31 @@ public class SelectingServerGUI : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\join" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/join" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
|
|
||||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = "Select server", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"});
|
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = "Select server", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font" });
|
||||||
|
|
||||||
TextBox ipBox = new TextBox(Manager)
|
TextBox ipBox = new TextBox(Manager)
|
||||||
{
|
{
|
||||||
rectangle = new Rectangle(width / 4 - (width / 4) / 2, height / 4, (int)(width / 4), (int)(height / 20)),
|
rectangle = new Rectangle(width / 4 - (width / 4) / 2, height / 4, (int)(width / 4), (int)(height / 20)),
|
||||||
text = "ip",
|
text = "ip",
|
||||||
scale = 0.2f,
|
scale = 0.5f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
textAligment = MonogameLibrary.UI.Enums.TextAligment.Left,
|
textAligment = MonogameLibrary.UI.Enums.TextAligment.Left,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font3"
|
||||||
};
|
};
|
||||||
ipBox.TextChanged += input => {
|
ipBox.TextChanged += input =>
|
||||||
|
{
|
||||||
if (input == "ip")
|
if (input == "ip")
|
||||||
{
|
{
|
||||||
ipBox.text = ""; ipBox.fontColor = Color.White;
|
ipBox.text = ""; ipBox.fontColor = Color.White;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
ipBox.StopChanging += input => {
|
ipBox.StopChanging += input =>
|
||||||
|
{
|
||||||
if (input.Length == 0)
|
if (input.Length == 0)
|
||||||
{
|
{
|
||||||
ipBox.fontColor = Color.White;
|
ipBox.fontColor = Color.White;
|
||||||
|
@ -58,12 +61,29 @@ public class SelectingServerGUI : AbstractGUI
|
||||||
scale = 0.3f,
|
scale = 0.3f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
joinButton.LeftButtonPressed += () =>
|
joinButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
AppManager.Instance.SetGUI(new WaitingForPlayersGUI(false));
|
|
||||||
// join
|
// join
|
||||||
|
Client client = new Client();
|
||||||
|
var endpoint = ipBox.text.Split(':');
|
||||||
|
int port;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (int.TryParse(endpoint[1], out port))
|
||||||
|
{
|
||||||
|
client.JoinRoom(endpoint[0], port);
|
||||||
|
AppManager.Instance.SetClient(client);
|
||||||
|
AppManager.Instance.SetGUI(new WaitingForPlayersGUI(false));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
// throw;
|
||||||
|
}
|
||||||
|
|
||||||
// ваш код здесь
|
// ваш код здесь
|
||||||
};
|
};
|
||||||
|
@ -75,19 +95,27 @@ public class SelectingServerGUI : AbstractGUI
|
||||||
scale = 0.3f,
|
scale = 0.3f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
hostButton.LeftButtonPressed += () =>
|
hostButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
AppManager.Instance.SetGUI(new WaitingForPlayersGUI(true));
|
|
||||||
// host
|
|
||||||
|
|
||||||
|
// host
|
||||||
|
Server server = new Server(); //Server Logic MultiPlayer
|
||||||
|
Client client = new Client();
|
||||||
|
server.CreateRoom(2);
|
||||||
|
client.JoinYourself(server.MyIp.Port);
|
||||||
|
AppManager.Instance.SetServer(server);
|
||||||
|
AppManager.Instance.SetClient(client);
|
||||||
|
string key = server.MyIp.ToString();
|
||||||
|
AppManager.Instance.debugHud.Set(key, "MultiPlayer");
|
||||||
// ваш код здесь
|
// ваш код здесь
|
||||||
|
AppManager.Instance.SetGUI(new WaitingForPlayersGUI(true));
|
||||||
};
|
};
|
||||||
Elements.Add(hostButton);
|
Elements.Add(hostButton);
|
||||||
|
|
||||||
Button bTExit = new Button(Manager)
|
Button bTExit = new Button(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"};
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off" };
|
||||||
Elements.Add(bTExit);
|
Elements.Add(bTExit);
|
||||||
bTExit.LeftButtonPressed += () =>
|
bTExit.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,7 @@ public class WaitingForPlayersGUI : AbstractGUI
|
||||||
{
|
{
|
||||||
private DrawableUIElement menuBackground;
|
private DrawableUIElement menuBackground;
|
||||||
private bool isHost;
|
private bool isHost;
|
||||||
|
private Label ip;
|
||||||
|
|
||||||
public WaitingForPlayersGUI(bool isHost)
|
public WaitingForPlayersGUI(bool isHost)
|
||||||
{
|
{
|
||||||
|
@ -27,14 +28,18 @@ public class WaitingForPlayersGUI : AbstractGUI
|
||||||
int width = AppManager.Instance.CurentScreenResolution.X;
|
int width = AppManager.Instance.CurentScreenResolution.X;
|
||||||
int height = AppManager.Instance.CurentScreenResolution.Y;
|
int height = AppManager.Instance.CurentScreenResolution.Y;
|
||||||
|
|
||||||
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures\\GUI\\background\\Waiting" };
|
menuBackground = new DrawableUIElement(Manager) { rectangle = new Rectangle(0, 0, width, height), mainColor = Color.White, textureName = "Textures/GUI/background/Waiting" };
|
||||||
Elements.Add(menuBackground);
|
Elements.Add(menuBackground);
|
||||||
menuBackground.LoadTexture(AppManager.Instance.Content);
|
menuBackground.LoadTexture(AppManager.Instance.Content);
|
||||||
|
// string pcIp =
|
||||||
|
|
||||||
Elements.Add(new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = "Waiting", fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font"});
|
// string pcIp =
|
||||||
|
ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.server.MyIp.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts/Font3" };
|
||||||
|
Elements.Add(ip);
|
||||||
if (isHost)
|
if (isHost)
|
||||||
{
|
{
|
||||||
|
ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.server.MyIp.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font3" };
|
||||||
|
Elements.Add(ip);
|
||||||
Button startButton = new Button(Manager)
|
Button startButton = new Button(Manager)
|
||||||
{
|
{
|
||||||
rectangle = new Rectangle(width / 2 - (width / 15) / 2, height / 2 + height / 4, (int)(width / 15), (int)(height / 20)),
|
rectangle = new Rectangle(width / 2 - (width / 15) / 2, height / 2 + height / 4, (int)(width / 15), (int)(height / 20)),
|
||||||
|
@ -42,19 +47,39 @@ public class WaitingForPlayersGUI : AbstractGUI
|
||||||
scale = 0.3f,
|
scale = 0.3f,
|
||||||
fontColor = Color.White,
|
fontColor = Color.White,
|
||||||
mainColor = Color.Gray,
|
mainColor = Color.Gray,
|
||||||
fontName = "Fonts\\Font"
|
fontName = "Fonts/Font"
|
||||||
};
|
};
|
||||||
startButton.LeftButtonPressed += () =>
|
startButton.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
// start
|
// start
|
||||||
|
AppManager.Instance.ChangeState(GameState.HostPlaying);
|
||||||
// ваш код здесь
|
// ваш код здесь
|
||||||
};
|
};
|
||||||
Elements.Add(startButton);
|
Elements.Add(startButton);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
ip = new Label(Manager) { rectangle = new Rectangle(width / 2 - (int)(width / 8), height / 7, (int)(width / 4), (int)(height / 20)), text = AppManager.Instance.client.InfoConnect.ToString(), fontColor = Color.White, mainColor = Color.Transparent, scale = 0.9f, fontName = "Fonts\\Font3" };
|
||||||
|
Elements.Add(ip);
|
||||||
|
Button waitButton = new Button(Manager)
|
||||||
|
{
|
||||||
|
rectangle = new Rectangle(width / 2 - (width / 15) / 2, height / 2 + height / 4, (int)(width / 15), (int)(height / 20)),
|
||||||
|
text = "WAITING",
|
||||||
|
scale = 0.3f,
|
||||||
|
fontColor = Color.White,
|
||||||
|
mainColor = Color.Gray,
|
||||||
|
fontName = "Fonts/Font"
|
||||||
|
};
|
||||||
|
waitButton.LeftButtonPressed += () =>
|
||||||
|
{
|
||||||
|
// start
|
||||||
|
AppManager.Instance.ChangeState(GameState.ClientPlaying);
|
||||||
|
// ваш код здесь
|
||||||
|
};
|
||||||
|
Elements.Add(waitButton);
|
||||||
|
}
|
||||||
|
|
||||||
Button bTExit = new Button(Manager)
|
Button bTExit = new Button(Manager)
|
||||||
{ fontName = "Fonts\\Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures\\GUI\\checkboxs_off"};
|
{ fontName = "Fonts/Font3", scale = 0.4f, text = "<-", fontColor = Color.Black, mainColor = Color.Transparent, rectangle = new Rectangle(width / 30, height / 30, width / 40, width / 40), textureName = "Textures/GUI/checkboxs_off"};
|
||||||
Elements.Add(bTExit);
|
Elements.Add(bTExit);
|
||||||
bTExit.LeftButtonPressed += () =>
|
bTExit.LeftButtonPressed += () =>
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ using System.Linq;
|
||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using DangerousD.GameCore.Graphics;
|
using ZoFo.GameCore.Graphics;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
@ -12,6 +12,7 @@ using ZoFo.GameCore.GameManagers.ItemManager;
|
||||||
using ZoFo.GameCore.GUI;
|
using ZoFo.GameCore.GUI;
|
||||||
using static System.Collections.Specialized.BitVector32;
|
using static System.Collections.Specialized.BitVector32;
|
||||||
using MonogameLibrary.UI.Base;
|
using MonogameLibrary.UI.Base;
|
||||||
|
using ZoFo.GameCore.GameObjects;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers
|
namespace ZoFo.GameCore.GameManagers
|
||||||
{
|
{
|
||||||
|
@ -74,6 +75,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
{
|
{
|
||||||
currentGUI.Initialize();
|
currentGUI.Initialize();
|
||||||
|
|
||||||
debugHud.Initialize();
|
debugHud.Initialize();
|
||||||
ItemManager.Initialize();
|
ItemManager.Initialize();
|
||||||
|
|
||||||
|
@ -90,15 +92,19 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
animationBuilder = new AnimationBuilder();
|
||||||
|
animationBuilder.LoadAnimations();
|
||||||
|
GameObject.debugTexture = new Texture2D(GraphicsDevice, 1, 1);
|
||||||
|
GameObject.debugTexture.SetData(new Color[] { Color.White });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update(GameTime gameTime)
|
protected override void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
|
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
|
||||||
Keyboard.GetState().IsKeyDown(Keys.Escape))
|
Keyboard.GetState().IsKeyDown(Keys.Escape)) { server.CloseConnection(); Exit(); }
|
||||||
Exit();
|
|
||||||
|
|
||||||
debugHud.Set("key", "value");
|
|
||||||
|
// debugHud.Set("key", "value");
|
||||||
|
|
||||||
InputManager.Update();
|
InputManager.Update();
|
||||||
currentGUI.Update(gameTime);
|
currentGUI.Update(gameTime);
|
||||||
|
@ -111,7 +117,7 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
client.Update(gameTime);
|
client.Update(gameTime);
|
||||||
break;
|
break;
|
||||||
case GameState.ClientPlaying:
|
case GameState.ClientPlaying:
|
||||||
server.Update(gameTime);
|
client.Update(gameTime);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -124,7 +130,9 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
{
|
{
|
||||||
GraphicsDevice.Clear(Color.CornflowerBlue);
|
GraphicsDevice.Clear(Color.CornflowerBlue);
|
||||||
|
|
||||||
_spriteBatch.Begin();
|
|
||||||
|
// Pointwrap
|
||||||
|
_spriteBatch.Begin(samplerState: SamplerState.PointWrap);
|
||||||
switch (gamestate)
|
switch (gamestate)
|
||||||
{
|
{
|
||||||
case GameState.ClientPlaying:
|
case GameState.ClientPlaying:
|
||||||
|
@ -135,8 +143,8 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
_spriteBatch.End();
|
|
||||||
|
|
||||||
|
_spriteBatch.End();
|
||||||
currentGUI.Draw(_spriteBatch);
|
currentGUI.Draw(_spriteBatch);
|
||||||
debugHud.Draw(_spriteBatch);
|
debugHud.Draw(_spriteBatch);
|
||||||
|
|
||||||
|
|
|
@ -1,57 +1,69 @@
|
||||||
using System;
|
using Microsoft.Win32;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection.Metadata;
|
using System.Reflection.Metadata;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameObjects;
|
||||||
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.CollisionManager
|
namespace ZoFo.GameCore.GameManagers.CollisionManager
|
||||||
{
|
{
|
||||||
public class CollisionComponent
|
public class CollisionComponent
|
||||||
{
|
{
|
||||||
//поля
|
//==КОНСТРУКТОР==
|
||||||
public Rectangle Bounds { get; set; }
|
public CollisionComponent(GameObject gameObject)
|
||||||
|
{
|
||||||
|
|
||||||
|
this.gameObject = gameObject;
|
||||||
|
hasCollision = false;
|
||||||
|
this.isTrigger = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CollisionComponent(GameObject gameObject, bool hasCollision = false, Rectangle? collisionRectangle = null, bool isTrigger = false, Rectangle? triggerRectangle = null)
|
||||||
|
{
|
||||||
|
this.gameObject = gameObject;
|
||||||
|
|
||||||
|
this.hasCollision = hasCollision;
|
||||||
|
this.isTrigger = isTrigger;
|
||||||
|
if (hasCollision)
|
||||||
|
this.stopRectangle = collisionRectangle.Value;
|
||||||
|
if (isTrigger)
|
||||||
|
this.triggerRectangle = triggerRectangle.Value;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//==ПОЛЯ==
|
||||||
|
|
||||||
|
public GameObject gameObject { get; set; }
|
||||||
|
|
||||||
|
|
||||||
//остановлен ли перс
|
|
||||||
bool doesStop;
|
bool doesStop;
|
||||||
Rectangle stopRectangle;
|
bool hasCollision;
|
||||||
|
public Rectangle stopRectangle;
|
||||||
|
|
||||||
// triggers for rectangle
|
// triggers for rectangle
|
||||||
bool isTrigger;
|
bool isTrigger;
|
||||||
Rectangle triggerRectangle;
|
public Rectangle triggerRectangle;
|
||||||
|
|
||||||
//delegate
|
//delegate
|
||||||
public delegate void EventHandler(object sender, EventArgs e);
|
public delegate void EventHandler(object sender, EventArgs e);
|
||||||
|
|
||||||
public CollisionComponent(int x, int y, int width, int height)
|
|
||||||
{
|
|
||||||
Bounds = new Rectangle(x, y, width, height);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//events
|
|
||||||
|
//events DoorInteraction
|
||||||
public event EventHandler<CollisionComponent> OnTriggerEnter;
|
public event EventHandler<CollisionComponent> OnTriggerEnter;
|
||||||
public event EventHandler<CollisionComponent> OnTriggerZone;
|
public event EventHandler<CollisionComponent> OnTriggerZone;
|
||||||
public event EventHandler<CollisionComponent> OnTriggerExit;
|
public event EventHandler<CollisionComponent> OnTriggerExit;
|
||||||
|
|
||||||
// methods-event
|
public event EventHandler<CollisionComponent> OnCollision;
|
||||||
public void TriggerEnter(object component, Player player,
|
|
||||||
EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public void TriggerZone(object component,Player player,
|
|
||||||
EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
public void TriggerExit(object component,Player player,
|
|
||||||
EventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
using Microsoft.VisualBasic;
|
using Microsoft.VisualBasic;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -9,49 +8,146 @@ using ZoFo.GameCore.GameObjects;
|
||||||
using ZoFo.GameCore.GameManagers.CollisionManager;
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.CollisionManager
|
namespace ZoFo.GameCore.GameManagers.CollisionManager
|
||||||
{
|
{
|
||||||
public class CollisionManager
|
public class CollisionManager
|
||||||
{
|
{
|
||||||
public List<CollisionComponent> CollisionComponent;
|
//листики
|
||||||
public List<CollisionComponent> TriggerComponent;
|
|
||||||
|
public List<CollisionComponent> ObjectsWithCollisions;
|
||||||
|
public List<CollisionComponent> EntitiesWithMovements;
|
||||||
|
public List<CollisionComponent> ObjectsWithTriggers;
|
||||||
|
|
||||||
|
|
||||||
|
//чекаем коллизии в листе
|
||||||
|
public void CheckComponentCollision(CollisionComponent componentOfEntity)
|
||||||
|
{
|
||||||
|
var entity = componentOfEntity.gameObject as LivingEntity;
|
||||||
|
//for (int i = 0; i < ObjectsWithCollisions.Count; i++)
|
||||||
|
//{
|
||||||
|
var currentRect = entity.collisionComponent.stopRectangle;//задаём РЕК
|
||||||
|
currentRect.X+=(int)entity.position.X;
|
||||||
|
currentRect.Y+=(int)entity.position.Y;
|
||||||
|
|
||||||
public static bool CheckComponentCollision(List<CollisionComponent> collisionComponents, CollisionComponent component)
|
var newRect = currentRect; // задаём значение старого РЕК новому РЕК
|
||||||
|
|
||||||
|
|
||||||
|
var collidedX = false; // соприкосновение
|
||||||
|
var tryingRectX = currentRect;//переменная для попытки перемещения по X
|
||||||
|
|
||||||
|
tryingRectX.Offset((int)(entity.velocity.X), 0);//задаём значения для tryingRectX по X и по Y
|
||||||
|
|
||||||
|
foreach (var item in ObjectsWithCollisions)//фильтрация
|
||||||
{
|
{
|
||||||
foreach (var collisionComponent in collisionComponents)
|
if (item == componentOfEntity) continue;
|
||||||
|
|
||||||
|
Rectangle rectChecking = item.stopRectangle.SetOrigin(item.gameObject.position);
|
||||||
|
if (Math.Abs(item.gameObject.position.X - componentOfEntity.gameObject.position.X) < 550
|
||||||
|
&& Math.Abs(item.gameObject.position.Y - componentOfEntity.gameObject.position.Y) < 550
|
||||||
|
&& tryingRectX.Intersects(rectChecking))
|
||||||
|
|
||||||
{
|
{
|
||||||
if (component.Bounds.IntersectsWith(collisionComponent.Bounds))
|
collidedX = true;// меняем значение соприкосновения на true
|
||||||
{
|
entity.OnCollision(item);//подписываем entity на ивент коллизии
|
||||||
return true;
|
|
||||||
|
break;// выход
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
if (collidedX)// срабатывает, если перемещение блокируется
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateComponentCollision(List<CollisionComponent> collisionComponents)
|
|
||||||
{
|
{
|
||||||
|
entity.velocity.X = 0;// задаём значение смещения entity на 0
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entity.position.X += entity.velocity.X; //update player position
|
||||||
|
newRect.X = tryingRectX.X;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
|
||||||
|
}
|
||||||
|
|
||||||
|
//==ПОВТОРЯЕМ ТОЖЕ САМОЕ ДЛЯ Y==
|
||||||
|
|
||||||
|
var collidedY = false; // соприкосновение
|
||||||
|
var tryingRectY = currentRect;//переменная для попытки перемещения по X
|
||||||
|
|
||||||
|
tryingRectY.Offset(new Point(0, (int)entity.velocity.Y));//задаём значения для tryingRectX по X и по Y
|
||||||
|
|
||||||
|
foreach (var item in ObjectsWithCollisions)//фильтрация
|
||||||
|
{
|
||||||
|
if (item == componentOfEntity) continue;
|
||||||
|
Rectangle rectChecking = item.stopRectangle.SetOrigin(item.gameObject.position);
|
||||||
|
if (Math.Abs(item.gameObject.position.X - componentOfEntity.gameObject.position.X) < 550
|
||||||
|
&& Math.Abs(item.gameObject.position.Y - componentOfEntity.gameObject.position.Y) < 550
|
||||||
|
&& tryingRectY.Intersects(rectChecking))
|
||||||
|
|
||||||
|
{
|
||||||
|
collidedY = true;// меняем значение соприкосновения на true
|
||||||
|
entity.OnCollision(item);//подписываем entity на ивент коллизии
|
||||||
|
|
||||||
|
break;// выход
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (collidedY)// срабатывает, если перемещение блокируется
|
||||||
|
{
|
||||||
|
entity.velocity.Y = 0;// задаём значение смещения entity на 0
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entity.position.Y += entity.velocity.Y;
|
||||||
|
newRect.Y = tryingRectY.Y;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.graphicsComponent.ObjectDrawRectangle.X = (int)entity.position.X;
|
||||||
|
entity.graphicsComponent.ObjectDrawRectangle.Y = (int)entity.position.Y;
|
||||||
|
AppManager.Instance.server.AddData(new UpdatePosition() { NewPosition = entity.position, IdEntity = entity.Id });
|
||||||
|
AppManager.Instance.debugHud.Set("testPos", entity.position.ToString()); //TODO remove
|
||||||
|
entity.velocity = Vector2.Zero;
|
||||||
|
}
|
||||||
|
|
||||||
|
//обновление позиции объекта
|
||||||
|
|
||||||
public void UpdatePositions()
|
public void UpdatePositions()
|
||||||
{
|
{
|
||||||
|
foreach (var item in EntitiesWithMovements)
|
||||||
|
{
|
||||||
|
CheckComponentCollision(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//public void GetObjectInArea(Rectangle area)
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
public CollisionManager()
|
||||||
|
{
|
||||||
|
//graphicsComponent
|
||||||
|
//.ObjectDrawRectangle = new Rectangle(0, 0, 16 * 12, 16 * 16);
|
||||||
|
EntitiesWithMovements = new List<CollisionComponent>();
|
||||||
|
ObjectsWithCollisions = new List<CollisionComponent>();
|
||||||
|
}
|
||||||
|
//регистрация компонента(его коллизии)
|
||||||
|
public void Register(CollisionComponent component)
|
||||||
|
{
|
||||||
|
ObjectsWithCollisions.Add(component);
|
||||||
|
if (component.gameObject is LivingEntity)
|
||||||
|
{
|
||||||
|
EntitiesWithMovements.Add(component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//public void Register(Rectangle rectangle)
|
|
||||||
//{
|
|
||||||
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public static class ExtentionClass
|
||||||
|
{
|
||||||
|
public static Rectangle SetOrigin(this Rectangle rectangle, Vector2 origin)
|
||||||
|
{
|
||||||
|
rectangle.X = (int)origin.X;
|
||||||
|
rectangle.Y = (int)origin.Y;
|
||||||
|
return rectangle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,37 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics.PackedVector;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Formats.Tar;
|
using System.Formats.Tar;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection.Metadata.Ecma335;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers
|
namespace ZoFo.GameCore.GameManagers
|
||||||
{
|
{
|
||||||
public enum ScopeState { Left, Right, Straight, Back, StraightLeft, StraightRight, BackLeft, BackRight }
|
public enum ScopeState { Idle, Left, Right, Straight, Back, StraightLeft, StraightRight, BackLeft, BackRight }
|
||||||
|
|
||||||
public class InputManager
|
public class InputManager
|
||||||
{
|
{
|
||||||
public delegate void Delegat();
|
public event Action ShootEvent; // событие удара(когда нажат X, событие срабатывает)
|
||||||
public event Delegat ShootEvent; // событие удара(когда нажат X, событие срабатывает)
|
|
||||||
|
|
||||||
public event Delegat OnInteract; // событие взаимодействия с collectable(например, лутом)
|
public event Action OnInteract; // событие взаимодействия с collectable(например, лутом)
|
||||||
//с помощью кнопки E.
|
//с помощью кнопки E.
|
||||||
|
|
||||||
public event Delegat TalkEvent;
|
public event Action ActionEvent;
|
||||||
|
public Vector2 InputMovementDirection;
|
||||||
|
private Vector2 prevInputMovementDirection;
|
||||||
|
public Vector2 InputAttackDirection;
|
||||||
|
private Vector2 prevInputAttackDirection;
|
||||||
|
|
||||||
Vector2 vectorMovementDirection;
|
public event Action TalkEvent;
|
||||||
ScopeState currentScopeState; // Положение оружия. Left, Right, Straight, Back, StraightLeft, StraightRight, BackLeft, BackRight.
|
|
||||||
|
public ScopeState currentScopeState; // Положение оружия. Left, Right, Straight, Back, StraightLeft, StraightRight, BackLeft, BackRight.
|
||||||
|
private ScopeState prevCurrentScopeState;
|
||||||
private bool _cheatsEnabled = false;
|
private bool _cheatsEnabled = false;
|
||||||
public bool InvincibilityCheat { get; private set; } = false;
|
public bool InvincibilityCheat { get; private set; } = false;
|
||||||
public bool CollisionsCheat { get; private set; } = false;
|
public bool CollisionsCheat { get; private set; } = false;
|
||||||
|
@ -34,18 +42,16 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
private KeyboardState lastKeyboardState;
|
private KeyboardState lastKeyboardState;
|
||||||
private GamePadState lastGamePadState;
|
private GamePadState lastGamePadState;
|
||||||
|
|
||||||
|
|
||||||
public Vector2 VectorMovementDirection { get => vectorMovementDirection; }
|
|
||||||
public ScopeState ScopeState { get => currentScopeState; }
|
public ScopeState ScopeState { get => currentScopeState; }
|
||||||
public string currentControlsState;
|
public string currentControlsState;
|
||||||
public ScopeState CurrentScopeState { get => currentScopeState; } // получить текущее состояние
|
public ScopeState CurrentScopeState { get => currentScopeState; } // получить текущее состояние
|
||||||
|
|
||||||
public InputManager()
|
public InputManager()
|
||||||
{
|
{
|
||||||
|
InputMovementDirection = new Vector2(0, 0);
|
||||||
|
InputAttackDirection = new Vector2(0, 0);
|
||||||
this.isShoot = false;
|
this.isShoot = false;
|
||||||
currentScopeState = ScopeState.Straight;
|
currentScopeState = ScopeState.Idle;
|
||||||
vectorMovementDirection = new Vector2(0, 0);
|
|
||||||
}
|
}
|
||||||
public void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
|
@ -59,7 +65,8 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
#region Работа с GamePad
|
#region Работа с GamePad
|
||||||
#region Обработка гейм-пада. Задает Vector2 vectorMovementDirection являющийся вектором отклонения левого стика.
|
#region Обработка гейм-пада. Задает Vector2 vectorMovementDirection являющийся вектором отклонения левого стика.
|
||||||
GamePadState gamePadState = GamePad.GetState(0);
|
GamePadState gamePadState = GamePad.GetState(0);
|
||||||
vectorMovementDirection = gamePadState.ThumbSticks.Left;
|
InputMovementDirection = gamePadState.ThumbSticks.Left;
|
||||||
|
InputAttackDirection = gamePadState.ThumbSticks.Right;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region читы
|
#region читы
|
||||||
|
@ -75,39 +82,38 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
}
|
}
|
||||||
#endregion // Cheats
|
#endregion // Cheats
|
||||||
|
|
||||||
#region Обработка положения оружия. Задает значение полю scopeState.
|
#region set ScopeState
|
||||||
if (vectorMovementDirection.Y >= 0.6)
|
int currentSection = (int)Math.Ceiling(Math.Atan2(InputMovementDirection.Y,
|
||||||
{
|
InputMovementDirection.X) * 180 / Math.PI * 16 / 360);
|
||||||
currentScopeState = ScopeState.Straight;
|
switch(currentSection){
|
||||||
}
|
case 1 or 0 or 16:
|
||||||
else if(vectorMovementDirection.Y <= 0.6)
|
|
||||||
{
|
|
||||||
currentScopeState = ScopeState.Back;
|
|
||||||
}
|
|
||||||
else if(vectorMovementDirection.X >= 0.6)
|
|
||||||
{
|
|
||||||
currentScopeState = ScopeState.Right;
|
currentScopeState = ScopeState.Right;
|
||||||
}
|
break;
|
||||||
else if(vectorMovementDirection.X <= 0.6)
|
case 2 or 3:
|
||||||
{
|
|
||||||
currentScopeState = ScopeState.Left;
|
|
||||||
}
|
|
||||||
else if(vectorMovementDirection.Y >= 0.6 && vectorMovementDirection.X >= 0.6)
|
|
||||||
{
|
|
||||||
currentScopeState = ScopeState.StraightRight;
|
currentScopeState = ScopeState.StraightRight;
|
||||||
}
|
break;
|
||||||
else if(vectorMovementDirection.Y >= 0.6 && vectorMovementDirection.X <= 0.6)
|
case 4 or 5:
|
||||||
{
|
currentScopeState = ScopeState.Straight;
|
||||||
|
break;
|
||||||
|
case 6 or 7:
|
||||||
currentScopeState = ScopeState.StraightLeft;
|
currentScopeState = ScopeState.StraightLeft;
|
||||||
}
|
break;
|
||||||
else if(vectorMovementDirection.Y <= 0.6 && vectorMovementDirection.X >= 0.6)
|
case 8 or 9:
|
||||||
{
|
currentScopeState = ScopeState.Left;
|
||||||
currentScopeState = ScopeState.BackRight;
|
break;
|
||||||
}
|
case 10 or 11:
|
||||||
else if(vectorMovementDirection.Y <= 0.6 && vectorMovementDirection.X <= 0.6)
|
|
||||||
{
|
|
||||||
currentScopeState = ScopeState.BackLeft;
|
currentScopeState = ScopeState.BackLeft;
|
||||||
|
break;
|
||||||
|
case 12 or 13:
|
||||||
|
currentScopeState = ScopeState.Back;
|
||||||
|
break;
|
||||||
|
case 14 or 15:
|
||||||
|
currentScopeState = ScopeState.BackRight;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Обработка нажатия выстрела. Вызывает событие ShootEvent
|
#region Обработка нажатия выстрела. Вызывает событие ShootEvent
|
||||||
|
@ -126,6 +132,17 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
lastGamePadState = gamePadState;
|
lastGamePadState = gamePadState;
|
||||||
#endregion
|
#endregion
|
||||||
#region Работа с KeyBoard
|
#region Работа с KeyBoard
|
||||||
|
|
||||||
|
#region InputAttack with mouse
|
||||||
|
MouseState mouseState = Mouse.GetState();
|
||||||
|
AppManager.Instance.debugHud.Set("mouse position", $"({mouseState.X}, {mouseState.Y}");
|
||||||
|
// TODO: CurentScreenResolution
|
||||||
|
Vector2 a = (AppManager.Instance.CurentScreenResolution / new Point(2, 2)).ToVector2();
|
||||||
|
|
||||||
|
InputAttackDirection = Vector2.Normalize(new Vector2(mouseState.X - a.X, mouseState.Y - a.Y));
|
||||||
|
AppManager.Instance.debugHud.Set("AttackDir(normalize)", $"({a.X}, {a.Y})");
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Состояние клавиатуры
|
#region Состояние клавиатуры
|
||||||
KeyboardState keyBoardState = Keyboard.GetState(); // Состояние клавиатуры
|
KeyboardState keyBoardState = Keyboard.GetState(); // Состояние клавиатуры
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -219,6 +236,17 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
lastKeyboardState = keyBoardState;
|
lastKeyboardState = keyBoardState;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
#region ActionEvent
|
||||||
|
if(InputMovementDirection != prevInputMovementDirection ||
|
||||||
|
InputAttackDirection != prevInputAttackDirection ||
|
||||||
|
currentScopeState != prevCurrentScopeState)
|
||||||
|
{
|
||||||
|
ActionEvent?.Invoke();
|
||||||
|
}
|
||||||
|
prevInputMovementDirection = InputMovementDirection;
|
||||||
|
prevInputAttackDirection = InputAttackDirection;
|
||||||
|
prevCurrentScopeState = currentScopeState;
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
16
ZoFo/GameCore/GameManagers/MapManager/MapElements/Object.cs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
{
|
||||||
|
public class Object
|
||||||
|
{
|
||||||
|
public double Height { get; set; }
|
||||||
|
public double Width { get; set; }
|
||||||
|
public double X { get; set; }
|
||||||
|
public double Y { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
{
|
||||||
|
public class ObjectGroup
|
||||||
|
{
|
||||||
|
public string Name { get; set; }
|
||||||
|
public List<Object> Objects { get; set; }
|
||||||
|
}
|
||||||
|
}
|
15
ZoFo/GameCore/GameManagers/MapManager/MapElements/Tile.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
|
{
|
||||||
|
public class Tile
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public string Type { get; set; }
|
||||||
|
public ObjectGroup Objectgroup { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -20,5 +20,6 @@ namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
||||||
public int TileWidth { get; set; }
|
public int TileWidth { get; set; }
|
||||||
public int Columns { get; set; }
|
public int Columns { get; set; }
|
||||||
public int FirstGid { get; set; }
|
public int FirstGid { get; set; }
|
||||||
|
public List<Tile> Tiles { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography;
|
using System.Security.Cryptography;
|
||||||
|
@ -10,15 +11,14 @@ using System.Threading.Tasks;
|
||||||
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
using ZoFo.GameCore.GameManagers.MapManager.MapElements;
|
||||||
using ZoFo.GameCore.GameObjects.MapObjects;
|
using ZoFo.GameCore.GameObjects.MapObjects;
|
||||||
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||||
using ZoFo.GameCore.GameObjects.MapObjects.Tiles;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.MapManager
|
namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
{
|
{
|
||||||
public class MapManager
|
public class MapManager
|
||||||
{
|
{
|
||||||
|
|
||||||
private static readonly string _templatePath = "Content/MapData/TileMaps/{0}.tmj";
|
private static readonly string _templatePath = "Content/MapData/TileMaps/{0}.tmj";
|
||||||
private static readonly float _scale = 1.0f;
|
|
||||||
|
//private static readonly float _scale = 1.0f;
|
||||||
private List<TileSet> _tileSets = new List<TileSet>();
|
private List<TileSet> _tileSets = new List<TileSet>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -32,16 +32,18 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
{
|
{
|
||||||
PropertyNameCaseInsensitive = true
|
PropertyNameCaseInsensitive = true
|
||||||
};
|
};
|
||||||
TileMap tileMap = JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)), options);
|
TileMap tileMap =
|
||||||
|
JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)), options);
|
||||||
|
|
||||||
// Загрузка TileSet-ов по TileSetInfo
|
// Загрузка TileSet-ов по TileSetInfo
|
||||||
List<TileSet> tileSets = new List<TileSet>();
|
List<TileSet> tileSets = new List<TileSet>();
|
||||||
foreach (TileSetInfo tileSetInfo in tileMap.TileSets)
|
foreach (TileSetInfo tileSetInfo in tileMap.TileSets)
|
||||||
{
|
{
|
||||||
TileSet tileSet = LoadTileSet("Content/MapData/"+tileSetInfo.Source);
|
TileSet tileSet = LoadTileSet(Path.Combine("Content", "MapData", "TileMaps", tileSetInfo.Source));
|
||||||
tileSet.FirstGid = tileSetInfo.FirstGid;
|
tileSet.FirstGid = tileSetInfo.FirstGid;
|
||||||
tileSets.Add(tileSet);
|
tileSets.Add(tileSet);
|
||||||
}
|
}
|
||||||
|
tileSets.Reverse();
|
||||||
|
|
||||||
foreach (var layer in tileMap.Layers)
|
foreach (var layer in tileMap.Layers)
|
||||||
{
|
{
|
||||||
|
@ -51,30 +53,45 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
{
|
{
|
||||||
foreach (var tileSet in tileSets)
|
foreach (var tileSet in tileSets)
|
||||||
{
|
{
|
||||||
if (tileSet.FirstGid - chunk.Data[i] < 0)
|
if (tileSet.FirstGid <= chunk.Data[i])
|
||||||
{
|
{
|
||||||
int number = chunk.Data[i] - tileSet.FirstGid;
|
int number = chunk.Data[i] - tileSet.FirstGid;
|
||||||
|
|
||||||
int relativeColumn = (number % tileSet.Columns) * tileSet.TileWidth;
|
int relativeColumn = number % tileSet.Columns;
|
||||||
int relativeRow = (number / tileSet.Columns) * tileSet.TileHeight;
|
int relativeRow = number / tileSet.Columns; // относительно левого угла чанка
|
||||||
|
|
||||||
Rectangle sourceRectangle = new Rectangle(relativeColumn * tileSet.TileWidth, relativeRow * tileSet.TileHeight,
|
Rectangle sourceRectangle = new Rectangle(relativeColumn * tileSet.TileWidth,
|
||||||
/* relativeColumn * tileSet.TileWidth +*/ tileSet.TileWidth, /*relativeRow * tileSet.TileHeight +*/ tileSet.TileHeight);
|
relativeRow * tileSet.TileHeight,
|
||||||
|
tileSet.TileWidth, tileSet.TileHeight);
|
||||||
|
|
||||||
Vector2 position = new Vector2((i % chunk.Width) * tileSet.TileWidth + chunk.X * chunk.Width, (i / chunk.Height)*tileSet.TileHeight + chunk.Y * chunk.Height) ;
|
Vector2 position = new Vector2(
|
||||||
|
(i % chunk.Width) * tileSet.TileWidth + chunk.X * tileSet.TileWidth,
|
||||||
|
(i / chunk.Height) * tileSet.TileHeight + chunk.Y * tileSet.TileHeight);
|
||||||
|
|
||||||
switch (layer.Class)
|
Tile tile = tileSet.Tiles[number]; // По факту может быть StopObjectom, но на уровне Tiled это все в первую очередь Tile
|
||||||
|
|
||||||
|
switch (tile.Type)
|
||||||
{
|
{
|
||||||
case "Tile":
|
case "Tile":
|
||||||
AppManager.Instance.server.RegisterGameObject(new MapObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, "Textures\\TileSets\\"+tileSet.Name)); //fix naming
|
AppManager.Instance.server.RegisterGameObject(new MapObject(position,
|
||||||
|
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||||
|
sourceRectangle,
|
||||||
|
"Textures/TileSetImages/" +
|
||||||
|
Path.GetFileName(tileSet.Image).Replace(".png", "")));
|
||||||
break;
|
break;
|
||||||
case "StopObject":
|
case "StopObject":
|
||||||
// new StopObject(position, new Vector2(tileSet.TileWidth * _scale, tileSet.TileHeight * _scale), sourceRectangle, tileSet.Name);
|
var collisionRectangles = LoadRectangles(tile); // Грузит коллизии обьектов
|
||||||
|
AppManager.Instance.server.RegisterGameObject(new StopObject(position/4,//TODO
|
||||||
|
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||||
|
sourceRectangle,
|
||||||
|
"Textures/TileSetImages/" +
|
||||||
|
Path.GetFileName(tileSet.Image).Replace(".png", ""),
|
||||||
|
collisionRectangles.ToArray()));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,5 +116,26 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
||||||
return JsonSerializer.Deserialize<TileSet>(data, options);
|
return JsonSerializer.Deserialize<TileSet>(data, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Загружает все квадраты коллизии тайла.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="tile"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private List<Rectangle> LoadRectangles(Tile tile)
|
||||||
|
{
|
||||||
|
if (tile.Objectgroup == null)
|
||||||
|
{
|
||||||
|
return new List<Rectangle>();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Rectangle> collisionRectangles = new List<Rectangle>();
|
||||||
|
foreach (var obj in tile.Objectgroup.Objects)
|
||||||
|
{
|
||||||
|
collisionRectangles.Add(new Rectangle((int)obj.X, (int)obj.Y, (int)obj.Width, (int)obj.Height));
|
||||||
|
}
|
||||||
|
|
||||||
|
return collisionRectangles;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,167 +0,0 @@
|
||||||
{ "compressionlevel":-1,
|
|
||||||
"height":20,
|
|
||||||
"infinite":true,
|
|
||||||
"layers":[
|
|
||||||
{
|
|
||||||
"chunks":[
|
|
||||||
{
|
|
||||||
"data":[24, 24, 24, 28, 29, 24, 24, 24, 28, 46, 29, 24, 25, 115, 45, 46,
|
|
||||||
24, 24, 24, 25, 23, 24, 24, 24, 50, 2, 51, 24, 50, 2, 2, 2,
|
|
||||||
24, 24, 24, 50, 32, 29, 24, 24, 24, 24, 24, 24, 24, 24, 24, 28,
|
|
||||||
28, 29, 24, 28, 10, 32, 29, 24, 24, 28, 46, 29, 24, 24, 24, 50,
|
|
||||||
47, 23, 24, 50, 32, 10, 32, 46, 29, 50, 2, 51, 24, 24, 24, 24,
|
|
||||||
1, 32, 29, 90, 25, 23, 50, 2, 32, 29, 24, 90, 28, 29, 24, 24,
|
|
||||||
51, 50, 32, 29, 50, 51, 90, 24, 25, 45, 46, 29, 25, 23, 24, 90,
|
|
||||||
24, 24, 50, 32, 46, 29, 24, 28, 10, 2, 2, 51, 50, 51, 24, 90,
|
|
||||||
24, 24, 24, 50, 2, 32, 46, 10, 32, 29, 24, 90, 24, 24, 24, 90,
|
|
||||||
29, 24, 89, 24, 24, 50, 3, 23, 50, 32, 46, 46, 46, 46, 29, 24,
|
|
||||||
51, 24, 24, 28, 29, 24, 25, 23, 24, 25, 1, 2, 3, 111, 45, 29,
|
|
||||||
24, 90, 24, 50, 51, 24, 25, 23, 28, 47, 23, 89, 50, 3, 115, 23,
|
|
||||||
24, 24, 24, 24, 24, 89, 50, 32, 47, 1, 51, 24, 24, 50, 2, 51,
|
|
||||||
28, 29, 24, 24, 24, 24, 28, 10, 2, 51, 24, 24, 24, 24, 24, 28,
|
|
||||||
10, 32, 29, 24, 24, 24, 25, 23, 28, 29, 90, 24, 24, 90, 24, 50,
|
|
||||||
32, 10, 51, 24, 24, 24, 50, 32, 10, 32, 29, 24, 90, 28, 29, 24],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":-16,
|
|
||||||
"y":-16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data":[10, 51, 24, 90, 24, 25, 23, 28, 29, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
51, 24, 28, 29, 24, 50, 32, 10, 51, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
29, 28, 10, 32, 46, 29, 50, 32, 29, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
51, 25, 23, 50, 2, 32, 29, 25, 23, 24, 24, 28, 29, 24, 90, 24,
|
|
||||||
24, 25, 23, 24, 24, 25, 23, 50, 51, 24, 24, 50, 32, 29, 24, 90,
|
|
||||||
24, 50, 32, 29, 90, 25, 45, 29, 24, 24, 24, 24, 50, 51, 24, 89,
|
|
||||||
24, 89, 50, 51, 24, 25, 114, 23, 24, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
24, 24, 28, 29, 24, 50, 2, 51, 24, 24, 90, 28, 29, 24, 24, 28,
|
|
||||||
24, 24, 25, 23, 89, 24, 24, 24, 28, 46, 29, 25, 23, 24, 24, 50,
|
|
||||||
28, 46, 10, 51, 24, 28, 46, 29, 25, 111, 45, 10, 51, 28, 29, 24,
|
|
||||||
50, 2, 51, 24, 24, 25, 115, 45, 10, 3, 1, 51, 24, 25, 23, 24,
|
|
||||||
24, 24, 24, 24, 24, 50, 2, 2, 32, 10, 51, 24, 90, 25, 23, 24,
|
|
||||||
24, 24, 24, 24, 24, 24, 24, 24, 50, 51, 24, 24, 24, 25, 23, 24,
|
|
||||||
46, 29, 24, 24, 24, 24, 24, 89, 24, 24, 24, 28, 46, 47, 23, 90,
|
|
||||||
2, 32, 29, 24, 24, 28, 46, 46, 29, 24, 24, 25, 1, 3, 23, 89,
|
|
||||||
24, 50, 32, 29, 24, 25, 1, 3, 23, 24, 89, 50, 32, 10, 51, 24],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":0,
|
|
||||||
"y":-16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data":[24, 24, 24, 24, 90, 24, 89, 24, 89, 24, 50, 51, 89, 24, 24, 24,
|
|
||||||
24, 28, 29, 28, 29, 24, 24, 24, 24, 28, 29, 24, 24, 24, 28, 29,
|
|
||||||
24, 25, 23, 50, 51, 24, 24, 28, 29, 50, 51, 24, 24, 24, 25, 45,
|
|
||||||
90, 50, 51, 28, 29, 24, 24, 25, 23, 24, 24, 28, 29, 24, 50, 3,
|
|
||||||
24, 24, 28, 10, 51, 90, 90, 50, 51, 24, 24, 50, 51, 24, 24, 50,
|
|
||||||
24, 24, 25, 45, 29, 24, 28, 29, 24, 24, 24, 24, 24, 28, 29, 24,
|
|
||||||
90, 24, 50, 2, 51, 28, 10, 51, 90, 24, 28, 29, 24, 25, 45, 46,
|
|
||||||
29, 90, 24, 24, 24, 50, 51, 24, 24, 28, 10, 32, 46, 10, 3, 1,
|
|
||||||
32, 29, 24, 90, 24, 24, 24, 24, 28, 47, 23, 50, 2, 51, 50, 51,
|
|
||||||
25, 23, 24, 24, 28, 46, 46, 46, 47, 114, 45, 29, 24, 24, 24, 24,
|
|
||||||
50, 32, 29, 24, 50, 3, 111, 111, 115, 111, 1, 32, 29, 24, 24, 24,
|
|
||||||
24, 50, 51, 24, 28, 10, 2, 2, 2, 2, 32, 10, 51, 24, 24, 89,
|
|
||||||
24, 24, 89, 90, 25, 23, 24, 24, 24, 24, 50, 32, 46, 46, 29, 89,
|
|
||||||
24, 24, 24, 90, 25, 23, 89, 24, 28, 29, 90, 50, 2, 2, 51, 24,
|
|
||||||
24, 24, 24, 28, 10, 51, 24, 28, 47, 45, 29, 24, 24, 24, 24, 24,
|
|
||||||
24, 24, 24, 25, 23, 24, 90, 50, 2, 2, 32, 46, 46, 46, 46, 46],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":16,
|
|
||||||
"y":-16
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data":[10, 32, 46, 29, 24, 24, 24, 25, 23, 50, 32, 29, 24, 50, 32, 46,
|
|
||||||
51, 50, 2, 32, 29, 24, 24, 25, 45, 29, 25, 23, 24, 24, 25, 1,
|
|
||||||
24, 24, 24, 25, 23, 28, 46, 10, 2, 51, 50, 51, 24, 24, 50, 51,
|
|
||||||
90, 89, 90, 50, 51, 50, 2, 51, 24, 24, 28, 29, 90, 24, 24, 24,
|
|
||||||
90, 28, 46, 29, 90, 24, 24, 24, 90, 24, 50, 51, 90, 24, 90, 28,
|
|
||||||
29, 50, 2, 51, 24, 24, 24, 89, 24, 24, 24, 24, 24, 89, 24, 50,
|
|
||||||
23, 24, 24, 28, 46, 29, 90, 90, 24, 89, 24, 28, 29, 24, 24, 24,
|
|
||||||
32, 46, 29, 25, 115, 45, 29, 24, 90, 24, 24, 25, 23, 24, 24, 28,
|
|
||||||
10, 2, 32, 47, 115, 1, 51, 24, 24, 24, 24, 25, 23, 24, 28, 10,
|
|
||||||
32, 29, 50, 2, 2, 51, 24, 24, 24, 24, 24, 25, 23, 28, 10, 51,
|
|
||||||
50, 51, 89, 24, 24, 89, 24, 28, 29, 24, 24, 50, 32, 10, 32, 46,
|
|
||||||
24, 24, 90, 90, 28, 46, 29, 50, 51, 24, 24, 24, 25, 23, 25, 115,
|
|
||||||
24, 90, 24, 24, 50, 2, 32, 29, 24, 24, 90, 24, 25, 45, 10, 2,
|
|
||||||
24, 24, 24, 24, 24, 24, 50, 32, 29, 24, 24, 28, 10, 3, 23, 24,
|
|
||||||
90, 24, 24, 24, 24, 89, 90, 50, 32, 29, 90, 50, 51, 50, 32, 46,
|
|
||||||
46, 29, 24, 90, 24, 24, 24, 24, 50, 51, 28, 29, 24, 24, 50, 2],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":-16,
|
|
||||||
"y":0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data":[46, 46, 10, 32, 46, 47, 23, 25, 23, 89, 24, 24, 25, 23, 90, 24,
|
|
||||||
2, 2, 32, 47, 1, 2, 51, 25, 23, 24, 28, 29, 50, 32, 29, 24,
|
|
||||||
24, 90, 50, 3, 23, 24, 28, 10, 51, 28, 47, 45, 29, 25, 23, 28,
|
|
||||||
24, 24, 24, 50, 51, 28, 47, 23, 24, 50, 3, 114, 45, 10, 51, 50,
|
|
||||||
29, 24, 24, 89, 24, 25, 114, 45, 46, 46, 10, 2, 2, 32, 29, 89,
|
|
||||||
51, 24, 24, 24, 24, 50, 3, 111, 115, 115, 23, 24, 24, 50, 32, 29,
|
|
||||||
24, 28, 29, 24, 24, 24, 25, 1, 2, 2, 51, 90, 24, 90, 50, 51,
|
|
||||||
29, 50, 32, 29, 28, 29, 25, 23, 24, 24, 89, 28, 29, 24, 24, 24,
|
|
||||||
51, 24, 50, 51, 50, 32, 10, 32, 46, 29, 24, 50, 51, 24, 90, 24,
|
|
||||||
24, 24, 24, 24, 89, 50, 32, 10, 2, 32, 46, 29, 89, 28, 29, 24,
|
|
||||||
29, 90, 24, 24, 24, 24, 50, 51, 28, 10, 3, 23, 28, 10, 51, 24,
|
|
||||||
23, 89, 24, 24, 90, 24, 24, 24, 50, 32, 10, 51, 50, 51, 24, 24,
|
|
||||||
51, 24, 24, 24, 24, 24, 24, 24, 24, 50, 32, 46, 46, 29, 28, 46,
|
|
||||||
24, 24, 24, 90, 24, 24, 24, 24, 24, 24, 50, 3, 1, 32, 47, 115,
|
|
||||||
46, 29, 24, 89, 24, 24, 24, 89, 24, 24, 24, 25, 45, 10, 3, 111,
|
|
||||||
2, 51, 28, 29, 28, 29, 24, 28, 46, 46, 46, 10, 2, 51, 50, 2],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":0,
|
|
||||||
"y":0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"data":[28, 29, 28, 10, 32, 46, 29, 24, 24, 28, 10, 2, 2, 2, 2, 2,
|
|
||||||
50, 51, 50, 51, 25, 115, 45, 46, 29, 50, 51, 24, 24, 24, 24, 24,
|
|
||||||
29, 24, 89, 24, 50, 3, 115, 114, 23, 24, 24, 24, 24, 24, 24, 24,
|
|
||||||
51, 90, 24, 89, 24, 50, 2, 2, 51, 24, 89, 24, 24, 28, 46, 29,
|
|
||||||
24, 90, 24, 24, 89, 24, 90, 28, 29, 24, 24, 24, 28, 10, 2, 51,
|
|
||||||
24, 24, 24, 24, 28, 29, 90, 50, 51, 28, 29, 24, 25, 23, 24, 24,
|
|
||||||
28, 29, 24, 24, 50, 32, 29, 28, 29, 50, 51, 89, 50, 32, 29, 24,
|
|
||||||
50, 51, 24, 24, 24, 50, 32, 10, 51, 24, 89, 24, 24, 25, 23, 24,
|
|
||||||
24, 24, 24, 24, 24, 24, 50, 32, 29, 24, 24, 24, 24, 50, 51, 24,
|
|
||||||
90, 24, 24, 24, 24, 24, 24, 25, 45, 29, 24, 24, 24, 89, 28, 29,
|
|
||||||
24, 24, 24, 24, 28, 29, 24, 25, 1, 51, 24, 24, 24, 24, 50, 32,
|
|
||||||
28, 29, 28, 29, 50, 32, 46, 10, 51, 28, 29, 24, 24, 24, 24, 50,
|
|
||||||
47, 45, 10, 51, 24, 50, 2, 32, 46, 47, 23, 24, 89, 90, 24, 24,
|
|
||||||
111, 115, 23, 24, 24, 90, 24, 50, 2, 2, 32, 29, 24, 89, 28, 46,
|
|
||||||
1, 2, 51, 28, 46, 46, 29, 24, 28, 29, 50, 32, 29, 28, 47, 111,
|
|
||||||
51, 24, 24, 50, 3, 114, 23, 24, 50, 32, 46, 47, 23, 25, 111, 111],
|
|
||||||
"height":16,
|
|
||||||
"width":16,
|
|
||||||
"x":16,
|
|
||||||
"y":0
|
|
||||||
}],
|
|
||||||
"class":"Tile",
|
|
||||||
"height":48,
|
|
||||||
"id":1,
|
|
||||||
"name":"\u0421\u043b\u043e\u0439 \u0442\u0430\u0439\u043b\u043e\u0432 1",
|
|
||||||
"opacity":1,
|
|
||||||
"startx":-16,
|
|
||||||
"starty":-32,
|
|
||||||
"type":"tilelayer",
|
|
||||||
"visible":true,
|
|
||||||
"width":48,
|
|
||||||
"x":0,
|
|
||||||
"y":0
|
|
||||||
}],
|
|
||||||
"nextlayerid":2,
|
|
||||||
"nextobjectid":1,
|
|
||||||
"orientation":"orthogonal",
|
|
||||||
"renderorder":"right-down",
|
|
||||||
"tiledversion":"1.10.2",
|
|
||||||
"tileheight":16,
|
|
||||||
"tilesets":[
|
|
||||||
{
|
|
||||||
"firstgid":1,
|
|
||||||
"source":"..\/TileSets\/TileSet 1.tsj"
|
|
||||||
}],
|
|
||||||
"tilewidth":16,
|
|
||||||
"type":"map",
|
|
||||||
"version":"1.10",
|
|
||||||
"width":30
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="30" height="20" tilewidth="16" tileheight="16" infinite="1" nextlayerid="2" nextobjectid="1">
|
|
||||||
<tileset firstgid="1" source="../TileSets/TileSet 1.tsj"/>
|
|
||||||
<layer id="1" name="Слой тайлов 1" width="30" height="20">
|
|
||||||
<data encoding="csv">
|
|
||||||
<chunk x="-16" y="-16" width="16" height="16">
|
|
||||||
24,24,24,28,29,24,24,24,28,46,29,24,25,115,45,46,
|
|
||||||
24,24,24,25,23,24,24,24,50,2,51,24,50,2,2,2,
|
|
||||||
24,24,24,50,32,29,24,24,24,24,24,24,24,24,24,28,
|
|
||||||
28,29,24,28,10,32,29,24,24,28,46,29,24,24,24,50,
|
|
||||||
47,23,24,50,32,10,32,46,29,50,2,51,24,24,24,24,
|
|
||||||
1,32,29,90,25,23,50,2,32,29,24,90,28,29,24,24,
|
|
||||||
51,50,32,29,50,51,90,24,25,45,46,29,25,23,24,90,
|
|
||||||
24,24,50,32,46,29,24,28,10,2,2,51,50,51,24,90,
|
|
||||||
24,24,24,50,2,32,46,10,32,29,24,90,24,24,24,90,
|
|
||||||
29,24,89,24,24,50,3,23,50,32,46,46,46,46,29,24,
|
|
||||||
51,24,24,28,29,24,25,23,24,25,1,2,3,111,45,29,
|
|
||||||
24,90,24,50,51,24,25,23,28,47,23,89,50,3,115,23,
|
|
||||||
24,24,24,24,24,89,50,32,47,1,51,24,24,50,2,51,
|
|
||||||
28,29,24,24,24,24,28,10,2,51,24,24,24,24,24,28,
|
|
||||||
10,32,29,24,24,24,25,23,28,29,90,24,24,90,24,50,
|
|
||||||
32,10,51,24,24,24,50,32,10,32,29,24,90,28,29,24
|
|
||||||
</chunk>
|
|
||||||
<chunk x="0" y="-16" width="16" height="16">
|
|
||||||
10,51,24,90,24,25,23,28,29,24,24,24,24,24,24,24,
|
|
||||||
51,24,28,29,24,50,32,10,51,24,24,24,24,24,24,24,
|
|
||||||
29,28,10,32,46,29,50,32,29,24,24,24,24,24,24,24,
|
|
||||||
51,25,23,50,2,32,29,25,23,24,24,28,29,24,90,24,
|
|
||||||
24,25,23,24,24,25,23,50,51,24,24,50,32,29,24,90,
|
|
||||||
24,50,32,29,90,25,45,29,24,24,24,24,50,51,24,89,
|
|
||||||
24,89,50,51,24,25,114,23,24,24,24,24,24,24,24,24,
|
|
||||||
24,24,28,29,24,50,2,51,24,24,90,28,29,24,24,28,
|
|
||||||
24,24,25,23,89,24,24,24,28,46,29,25,23,24,24,50,
|
|
||||||
28,46,10,51,24,28,46,29,25,111,45,10,51,28,29,24,
|
|
||||||
50,2,51,24,24,25,115,45,10,3,1,51,24,25,23,24,
|
|
||||||
24,24,24,24,24,50,2,2,32,10,51,24,90,25,23,24,
|
|
||||||
24,24,24,24,24,24,24,24,50,51,24,24,24,25,23,24,
|
|
||||||
46,29,24,24,24,24,24,89,24,24,24,28,46,47,23,90,
|
|
||||||
2,32,29,24,24,28,46,46,29,24,24,25,1,3,23,89,
|
|
||||||
24,50,32,29,24,25,1,3,23,24,89,50,32,10,51,24
|
|
||||||
</chunk>
|
|
||||||
<chunk x="16" y="-16" width="16" height="16">
|
|
||||||
24,24,24,24,90,24,89,24,89,24,50,51,89,24,24,24,
|
|
||||||
24,28,29,28,29,24,24,24,24,28,29,24,24,24,28,29,
|
|
||||||
24,25,23,50,51,24,24,28,29,50,51,24,24,24,25,45,
|
|
||||||
90,50,51,28,29,24,24,25,23,24,24,28,29,24,50,3,
|
|
||||||
24,24,28,10,51,90,90,50,51,24,24,50,51,24,24,50,
|
|
||||||
24,24,25,45,29,24,28,29,24,24,24,24,24,28,29,24,
|
|
||||||
90,24,50,2,51,28,10,51,90,24,28,29,24,25,45,46,
|
|
||||||
29,90,24,24,24,50,51,24,24,28,10,32,46,10,3,1,
|
|
||||||
32,29,24,90,24,24,24,24,28,47,23,50,2,51,50,51,
|
|
||||||
25,23,24,24,28,46,46,46,47,114,45,29,24,24,24,24,
|
|
||||||
50,32,29,24,50,3,111,111,115,111,1,32,29,24,24,24,
|
|
||||||
24,50,51,24,28,10,2,2,2,2,32,10,51,24,24,89,
|
|
||||||
24,24,89,90,25,23,24,24,24,24,50,32,46,46,29,89,
|
|
||||||
24,24,24,90,25,23,89,24,28,29,90,50,2,2,51,24,
|
|
||||||
24,24,24,28,10,51,24,28,47,45,29,24,24,24,24,24,
|
|
||||||
24,24,24,25,23,24,90,50,2,2,32,46,46,46,46,46
|
|
||||||
</chunk>
|
|
||||||
<chunk x="-16" y="0" width="16" height="16">
|
|
||||||
10,32,46,29,24,24,24,25,23,50,32,29,24,50,32,46,
|
|
||||||
51,50,2,32,29,24,24,25,45,29,25,23,24,24,25,1,
|
|
||||||
24,24,24,25,23,28,46,10,2,51,50,51,24,24,50,51,
|
|
||||||
90,89,90,50,51,50,2,51,24,24,28,29,90,24,24,24,
|
|
||||||
90,28,46,29,90,24,24,24,90,24,50,51,90,24,90,28,
|
|
||||||
29,50,2,51,24,24,24,89,24,24,24,24,24,89,24,50,
|
|
||||||
23,24,24,28,46,29,90,90,24,89,24,28,29,24,24,24,
|
|
||||||
32,46,29,25,115,45,29,24,90,24,24,25,23,24,24,28,
|
|
||||||
10,2,32,47,115,1,51,24,24,24,24,25,23,24,28,10,
|
|
||||||
32,29,50,2,2,51,24,24,24,24,24,25,23,28,10,51,
|
|
||||||
50,51,89,24,24,89,24,28,29,24,24,50,32,10,32,46,
|
|
||||||
24,24,90,90,28,46,29,50,51,24,24,24,25,23,25,115,
|
|
||||||
24,90,24,24,50,2,32,29,24,24,90,24,25,45,10,2,
|
|
||||||
24,24,24,24,24,24,50,32,29,24,24,28,10,3,23,24,
|
|
||||||
90,24,24,24,24,89,90,50,32,29,90,50,51,50,32,46,
|
|
||||||
46,29,24,90,24,24,24,24,50,51,28,29,24,24,50,2
|
|
||||||
</chunk>
|
|
||||||
<chunk x="0" y="0" width="16" height="16">
|
|
||||||
46,46,10,32,46,47,23,25,23,89,24,24,25,23,90,24,
|
|
||||||
2,2,32,47,1,2,51,25,23,24,28,29,50,32,29,24,
|
|
||||||
24,90,50,3,23,24,28,10,51,28,47,45,29,25,23,28,
|
|
||||||
24,24,24,50,51,28,47,23,24,50,3,114,45,10,51,50,
|
|
||||||
29,24,24,89,24,25,114,45,46,46,10,2,2,32,29,89,
|
|
||||||
51,24,24,24,24,50,3,111,115,115,23,24,24,50,32,29,
|
|
||||||
24,28,29,24,24,24,25,1,2,2,51,90,24,90,50,51,
|
|
||||||
29,50,32,29,28,29,25,23,24,24,89,28,29,24,24,24,
|
|
||||||
51,24,50,51,50,32,10,32,46,29,24,50,51,24,90,24,
|
|
||||||
24,24,24,24,89,50,32,10,2,32,46,29,89,28,29,24,
|
|
||||||
29,90,24,24,24,24,50,51,28,10,3,23,28,10,51,24,
|
|
||||||
23,89,24,24,90,24,24,24,50,32,10,51,50,51,24,24,
|
|
||||||
51,24,24,24,24,24,24,24,24,50,32,46,46,29,28,46,
|
|
||||||
24,24,24,90,24,24,24,24,24,24,50,3,1,32,47,115,
|
|
||||||
46,29,24,89,24,24,24,89,24,24,24,25,45,10,3,111,
|
|
||||||
2,51,28,29,28,29,24,28,46,46,46,10,2,51,50,2
|
|
||||||
</chunk>
|
|
||||||
<chunk x="16" y="0" width="16" height="16">
|
|
||||||
28,29,28,10,32,46,29,24,24,28,10,2,2,2,2,2,
|
|
||||||
50,51,50,51,25,115,45,46,29,50,51,24,24,24,24,24,
|
|
||||||
29,24,89,24,50,3,115,114,23,24,24,24,24,24,24,24,
|
|
||||||
51,90,24,89,24,50,2,2,51,24,89,24,24,28,46,29,
|
|
||||||
24,90,24,24,89,24,90,28,29,24,24,24,28,10,2,51,
|
|
||||||
24,24,24,24,28,29,90,50,51,28,29,24,25,23,24,24,
|
|
||||||
28,29,24,24,50,32,29,28,29,50,51,89,50,32,29,24,
|
|
||||||
50,51,24,24,24,50,32,10,51,24,89,24,24,25,23,24,
|
|
||||||
24,24,24,24,24,24,50,32,29,24,24,24,24,50,51,24,
|
|
||||||
90,24,24,24,24,24,24,25,45,29,24,24,24,89,28,29,
|
|
||||||
24,24,24,24,28,29,24,25,1,51,24,24,24,24,50,32,
|
|
||||||
28,29,28,29,50,32,46,10,51,28,29,24,24,24,24,50,
|
|
||||||
47,45,10,51,24,50,2,32,46,47,23,24,89,90,24,24,
|
|
||||||
111,115,23,24,24,90,24,50,2,2,32,29,24,89,28,46,
|
|
||||||
1,2,51,28,46,46,29,24,28,29,50,32,29,28,47,111,
|
|
||||||
51,24,24,50,3,114,23,24,50,32,46,47,23,25,111,111
|
|
||||||
</chunk>
|
|
||||||
</data>
|
|
||||||
</layer>
|
|
||||||
</map>
|
|
|
@ -1,166 +0,0 @@
|
||||||
{ "class":"Tile",
|
|
||||||
"columns":22,
|
|
||||||
"grid":
|
|
||||||
{
|
|
||||||
"height":24,
|
|
||||||
"orientation":"orthogonal",
|
|
||||||
"width":24
|
|
||||||
},
|
|
||||||
"image":"..\/..\/..\/..\/Content\/Textures\/Background\/TilesetFloor.png",
|
|
||||||
"imageheight":417,
|
|
||||||
"imagewidth":352,
|
|
||||||
"margin":0,
|
|
||||||
"name":"TileSet 1",
|
|
||||||
"spacing":0,
|
|
||||||
"tilecount":572,
|
|
||||||
"tiledversion":"1.10.2",
|
|
||||||
"tileheight":16,
|
|
||||||
"tiles":[
|
|
||||||
{
|
|
||||||
"id":27,
|
|
||||||
"probability":0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":28,
|
|
||||||
"probability":0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":49,
|
|
||||||
"probability":0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":50,
|
|
||||||
"probability":0.5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":88,
|
|
||||||
"probability":0.100000001490116
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":89,
|
|
||||||
"probability":0.100000001490116
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":110,
|
|
||||||
"probability":2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":111,
|
|
||||||
"probability":0.100000001490116
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":112,
|
|
||||||
"probability":0.100000001490116
|
|
||||||
}],
|
|
||||||
"tilewidth":16,
|
|
||||||
"type":"tileset",
|
|
||||||
"version":"1.10",
|
|
||||||
"wangsets":[
|
|
||||||
{
|
|
||||||
"colors":[
|
|
||||||
{
|
|
||||||
"color":"#ff0000",
|
|
||||||
"name":"Sand",
|
|
||||||
"probability":1,
|
|
||||||
"tile":23
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color":"#00ff00",
|
|
||||||
"name":"SandStone",
|
|
||||||
"probability":0.3,
|
|
||||||
"tile":110
|
|
||||||
}],
|
|
||||||
"name":"\u041f\u0435\u0441\u0447\u0430\u043d\u044b\u0439",
|
|
||||||
"tile":-1,
|
|
||||||
"type":"corner",
|
|
||||||
"wangtiles":[
|
|
||||||
{
|
|
||||||
"tileid":0,
|
|
||||||
"wangid":[0, 2, 0, 1, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":1,
|
|
||||||
"wangid":[0, 2, 0, 1, 0, 1, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":2,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 1, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":9,
|
|
||||||
"wangid":[0, 2, 0, 1, 0, 2, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":22,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":23,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":24,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":27,
|
|
||||||
"wangid":[0, 1, 0, 2, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":28,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 2, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":31,
|
|
||||||
"wangid":[0, 1, 0, 2, 0, 1, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":44,
|
|
||||||
"wangid":[0, 1, 0, 2, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":45,
|
|
||||||
"wangid":[0, 1, 0, 2, 0, 2, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":46,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":49,
|
|
||||||
"wangid":[0, 2, 0, 1, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":50,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":88,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":89,
|
|
||||||
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":110,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":111,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":112,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":113,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"tileid":114,
|
|
||||||
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
}
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data.SqlTypes;
|
using System.Data.SqlTypes;
|
||||||
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using System.Security.Cryptography.X509Certificates;
|
||||||
|
@ -15,13 +16,14 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
{
|
{
|
||||||
public class ClientNetworkManager
|
public class ClientNetworkManager
|
||||||
{
|
{
|
||||||
private int port = 7632;
|
private int port = 0;
|
||||||
private EndPoint endPoint;
|
private IPEndPoint endPoint;
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
List<UpdateData> updates = new List<UpdateData>();
|
List<UpdateData> updates = new List<UpdateData>();
|
||||||
public delegate void OnDataSent(string Data);
|
public delegate void OnDataSent(string Data);
|
||||||
public event OnDataSent GetDataSent; // event
|
public event OnDataSent GetDataSent; // event
|
||||||
public bool IsConnected { get { return socket.Connected; } }
|
public bool IsConnected { get { return socket.Connected; } }
|
||||||
|
public IPEndPoint InfoConnect => (IPEndPoint)socket.LocalEndPoint ?? endPoint;
|
||||||
|
|
||||||
public ClientNetworkManager()
|
public ClientNetworkManager()
|
||||||
{
|
{
|
||||||
|
@ -60,35 +62,55 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="ip"></param>
|
/// <param name="ip"></param>
|
||||||
/// <param name="port"></param>
|
/// <param name="port"></param>
|
||||||
public void JoinRoom(string ip) // multyplayer
|
public void JoinRoom(string ip, int port) // multyplayer
|
||||||
{
|
{
|
||||||
|
|
||||||
endPoint = new IPEndPoint(IPAddress.Parse(ip), port);
|
endPoint = new IPEndPoint(IPAddress.Parse(ip), port);
|
||||||
socket.Connect(endPoint);
|
socket.Connect(endPoint);
|
||||||
SendData();
|
SendData();
|
||||||
Thread listen = new Thread(StartListening);
|
Thread listen = new Thread(StartListening);
|
||||||
|
listen.IsBackground = true;
|
||||||
|
listen.Start();
|
||||||
|
}
|
||||||
|
public void JoinRoom(IPEndPoint endPoint) // multyplayer
|
||||||
|
{
|
||||||
|
|
||||||
|
this.endPoint = endPoint;
|
||||||
|
socket.Connect(endPoint);
|
||||||
|
SendData();
|
||||||
|
Thread listen = new Thread(StartListening);
|
||||||
|
listen.IsBackground = true;
|
||||||
listen.Start();
|
listen.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// создается одиночная комната к которой ты подключаешься
|
/// создается одиночная комната к которой ты подключаешься
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void JoinYourself() // single player
|
public void JoinYourself(int port) // single player
|
||||||
{
|
{
|
||||||
endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), port);
|
endPoint = new IPEndPoint(GetIp(), port);
|
||||||
socket.Connect(endPoint);
|
socket.Connect(endPoint);
|
||||||
SendData();
|
SendData();
|
||||||
Thread listen = new Thread(StartListening);
|
Thread listen = new Thread(StartListening);
|
||||||
|
listen.IsBackground = true;
|
||||||
listen.Start();
|
listen.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IPAddress GetIp()
|
||||||
|
{
|
||||||
|
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
||||||
|
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||||
|
string myIP = ipList[ipList.Count() - 1].ToString();// Get the IP
|
||||||
|
return IPAddress.Parse(myIP);
|
||||||
|
}
|
||||||
|
|
||||||
//поток 2
|
//поток 2
|
||||||
public void StartListening()
|
public void StartListening()
|
||||||
{
|
{
|
||||||
while(socket.Connected)
|
while(socket.Connected)
|
||||||
{
|
{
|
||||||
byte[] bytes = new byte[2048];
|
byte[] bytes = new byte[2048];
|
||||||
var countAnsw = socket.Receive(bytes);
|
var countAnsw = socket.Receive(bytes); //Вылетает если кто то закрыл
|
||||||
string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером
|
string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером
|
||||||
GetDataSent(update);
|
GetDataSent(update);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Graphics.PackedVector;
|
using Microsoft.Xna.Framework.Graphics.PackedVector;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -17,8 +18,8 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
{
|
{
|
||||||
public class ServerNetworkManager
|
public class ServerNetworkManager
|
||||||
{
|
{
|
||||||
private IPAddress ip =IPAddress.Parse("127.0.0.1"); //IPAddress.Any
|
private IPAddress ip = IPAddress.Parse("127.0.0.1");
|
||||||
private int port = 7632;
|
private const int port = 0;
|
||||||
private IPEndPoint endPoint;
|
private IPEndPoint endPoint;
|
||||||
private Socket socket;
|
private Socket socket;
|
||||||
private List<Socket> clients;
|
private List<Socket> clients;
|
||||||
|
@ -27,6 +28,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
public event OnDataSend GetDataSend; // event
|
public event OnDataSend GetDataSend; // event
|
||||||
Dictionary<Socket, Thread> managerThread;
|
Dictionary<Socket, Thread> managerThread;
|
||||||
Thread serverTheread;
|
Thread serverTheread;
|
||||||
|
public IPEndPoint InfoConnect => (IPEndPoint)socket.LocalEndPoint ?? endPoint;
|
||||||
|
|
||||||
public ServerNetworkManager() { Init(); }
|
public ServerNetworkManager() { Init(); }
|
||||||
|
|
||||||
|
@ -35,7 +37,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
endPoint = new IPEndPoint(ip, port);
|
endPoint = new IPEndPoint(GetIp(), port);
|
||||||
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
|
||||||
managerThread = new Dictionary<Socket, Thread>();
|
managerThread = new Dictionary<Socket, Thread>();
|
||||||
clients = new List<Socket>();
|
clients = new List<Socket>();
|
||||||
|
@ -44,6 +46,18 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
socket.Bind(endPoint);
|
socket.Bind(endPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получает IP устройства
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static IPAddress GetIp()
|
||||||
|
{
|
||||||
|
string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
||||||
|
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||||
|
string myIP = ipList[ipList.Count()-1].ToString();// Get the IP
|
||||||
|
return IPAddress.Parse(myIP);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// отправляет клиенту Data
|
/// отправляет клиенту Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -56,13 +70,19 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
}
|
}
|
||||||
updates.Clear();
|
updates.Clear();
|
||||||
return; //TODO TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK
|
return; //TODO TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK TODO REMOVE TO ADD NETWORK
|
||||||
|
//Что это?
|
||||||
string data = JsonSerializer.Serialize(updates);
|
//по 10 паков за раз TODO FIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXIT
|
||||||
|
List<UpdateData> datasToSend = new List<UpdateData>();
|
||||||
|
for (int i = 0; i < 5 && i<updates.Count; i++)
|
||||||
|
datasToSend.Add(updates[i]);
|
||||||
|
string data = JsonSerializer.Serialize(datasToSend);
|
||||||
var databytes = Encoding.UTF8.GetBytes(data);
|
var databytes = Encoding.UTF8.GetBytes(data);
|
||||||
foreach (var item in clients)
|
foreach (var item in clients)
|
||||||
{
|
{
|
||||||
item.SendAsync(databytes);
|
item.SendAsync(databytes);
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < 5 && i< datasToSend.Count; i++)
|
||||||
|
updates.RemoveAt(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -105,11 +125,11 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
public void Start(object players)
|
public void Start(object players)
|
||||||
{
|
{
|
||||||
serverTheread = new Thread(StartWaitingForPlayers);
|
serverTheread = new Thread(StartWaitingForPlayers);
|
||||||
|
serverTheread.IsBackground = true;
|
||||||
serverTheread.Start(players);
|
serverTheread.Start(players);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Потоки Клиентов
|
//Потоки Клиентов
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Слушает игроков, которые хотят подключиться
|
/// Слушает игроков, которые хотят подключиться
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -122,12 +142,16 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
for (int i = 0; i < playNumber; i++)
|
for (int i = 0; i < playNumber; i++)
|
||||||
{
|
{
|
||||||
Socket client = socket.Accept();
|
Socket client = socket.Accept();
|
||||||
|
AppManager.Instance.debugHud.Log($"Connect {client.LocalEndPoint.ToString()}");
|
||||||
Thread thread = new Thread(StartListening);
|
Thread thread = new Thread(StartListening);
|
||||||
|
thread.IsBackground = true;
|
||||||
thread.Start(client);
|
thread.Start(client);
|
||||||
managerThread.Add(client, thread);
|
managerThread.Add(client, thread);
|
||||||
clients.Add(client); //добавляем клиентов в лист
|
clients.Add(client);
|
||||||
|
//AppManager.Instance.ChangeState(GameState.HostPlaying);
|
||||||
|
//добавляем клиентов в лист
|
||||||
}
|
}
|
||||||
|
AppManager.Instance.ChangeState(GameState.HostPlaying);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -145,7 +169,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
||||||
string response = Encoding.UTF8.GetString(buff, 0, answ);
|
string response = Encoding.UTF8.GetString(buff, 0, answ);
|
||||||
GetDataSend(response);
|
GetDataSend(response);
|
||||||
}
|
}
|
||||||
Thread.Sleep(-1);
|
Task.Delay(-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
@ -9,9 +11,12 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer
|
||||||
public class UpdateInput :UpdateData
|
public class UpdateInput :UpdateData
|
||||||
{
|
{
|
||||||
// public int IdEntity { get; set; }
|
// public int IdEntity { get; set; }
|
||||||
|
public Vector2 InputMovementDirection{get;set;}
|
||||||
|
public Vector2 InputAttackDirection {get;set;}
|
||||||
public UpdateInput()
|
public UpdateInput()
|
||||||
{
|
{
|
||||||
UpdateType = "UpdateInput";
|
UpdateType = "UpdateInput";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateAnimation : UpdateData //хранит новую анимации
|
/// <summary>
|
||||||
|
/// Хранит новое сосотяние анимации
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateAnimation : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateAnimation() { UpdateType = "UpdateAnimation"; }
|
public UpdateAnimation() { UpdateType = "UpdateAnimation"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateEntityHealth : UpdateData//хранит новое хп entity
|
/// <summary>
|
||||||
|
/// Обнивляет хп сущности
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateEntityHealth : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateEntityHealth() { UpdateType = "UpdateEntityHealth"; }
|
public UpdateEntityHealth() { UpdateType = "UpdateEntityHealth"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateGameEnded : UpdateData //хранит полученый лут и уведомляет о конце игры
|
/// <summary>
|
||||||
|
/// Хранит полученый лут и уведомляет о конце игры
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameEnded : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateGameEnded() { UpdateType = "UpdateGameEnded"; }
|
public UpdateGameEnded() { UpdateType = "UpdateGameEnded"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -6,8 +7,14 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateGameObjectCreated : UpdateData //Хранит объект, который только отправили
|
/// <summary>
|
||||||
|
/// Хранит объект, который только отправили
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameObjectCreated : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
|
public UpdateGameObjectCreated() { UpdateType = "UpdateGameObjectCreated"; }
|
||||||
|
public string GameObjectType;
|
||||||
|
public string GameObjectId;
|
||||||
|
public Vector2 position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Хранит объект, который надо удлить
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateGameObjectDeleted : UpdateData
|
||||||
|
{
|
||||||
|
public UpdateGameObjectDeleted() { UpdateType = "UpdateGameObjectDeleted"; }
|
||||||
|
public string GameObjectType;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При попытке взаимодействия с объектом
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateInteraction : UpdateData
|
||||||
|
{
|
||||||
|
public UpdateInteraction() { UpdateType = "UpdateInteraction"; }
|
||||||
|
public UpdateInteraction(int id)
|
||||||
|
{
|
||||||
|
IdEntity = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int IdEntity { get; set; }
|
||||||
|
public string UpdateType { get; set; }
|
||||||
|
}
|
|
@ -0,0 +1,14 @@
|
||||||
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При изменении возможности повзаимодействовать с объектом
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="idEntity"></param>
|
||||||
|
/// <param name="isReady"></param>
|
||||||
|
public class UpdateInteractionReady(int idEntity, bool isReady)
|
||||||
|
: UpdateData
|
||||||
|
{
|
||||||
|
public int IdEntity { get; set; } = idEntity;
|
||||||
|
public string UpdateType { get; set; } = "UpdateInteractionReady";
|
||||||
|
public bool IsReady { get; set; } = isReady;
|
||||||
|
}
|
|
@ -6,8 +6,17 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdateLoot : UpdateData //Хранит лут
|
/// <summary>
|
||||||
|
/// Хранит лут
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateLoot : UpdateData
|
||||||
{
|
{
|
||||||
|
public string lootName;
|
||||||
public UpdateLoot() { UpdateType = "UpdateLoot"; }
|
public UpdateLoot() { UpdateType = "UpdateLoot"; }
|
||||||
|
public UpdateLoot(string lootName)
|
||||||
|
{
|
||||||
|
UpdateType = "UpdateLoot";
|
||||||
|
this.lootName = lootName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,10 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdatePlayerParametrs : UpdateData //Хранит хп, радиацию
|
/// <summary>
|
||||||
|
/// Хранит хп, радиацию
|
||||||
|
/// </summary>
|
||||||
|
public class UpdatePlayerParametrs : UpdateData
|
||||||
{
|
{
|
||||||
public UpdatePlayerParametrs() { UpdateType = "UpdatePlayerParametrs"; }
|
public UpdatePlayerParametrs() { UpdateType = "UpdatePlayerParametrs"; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,20 @@
|
||||||
using System;
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
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 ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
public class UpdatePosition : UpdateData //Хранит новую позицию
|
/// <summary>
|
||||||
|
/// Хранит новую позицию
|
||||||
|
/// </summary>
|
||||||
|
public class UpdatePosition : UpdateData
|
||||||
{
|
{
|
||||||
public UpdatePosition() { UpdateType = "UpdatePosition"; }
|
public UpdatePosition() { UpdateType = "UpdatePosition"; }
|
||||||
|
|
||||||
|
public Vector2 NewPosition { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// При создании тайла
|
||||||
|
/// </summary>
|
||||||
public class UpdateTileCreated : UpdateData
|
public class UpdateTileCreated : UpdateData
|
||||||
{
|
{
|
||||||
public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; }
|
public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; }
|
||||||
|
@ -20,4 +23,17 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||||
public Rectangle sourceRectangle { get; set; }
|
public Rectangle sourceRectangle { get; set; }
|
||||||
public string tileSetName { get; set; }
|
public string tileSetName { get; set; }
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// При создании тайла TODO move to another file
|
||||||
|
/// </summary>
|
||||||
|
public class UpdateStopObjectCreated : UpdateData
|
||||||
|
{
|
||||||
|
public UpdateStopObjectCreated() { UpdateType = "UpdateStopObjectCreated"; }
|
||||||
|
public Texture2D TextureTile { get; set; }
|
||||||
|
public Vector2 Position { get; set; }
|
||||||
|
public Point Size { get; set; }
|
||||||
|
public Rectangle sourceRectangle { get; set; }
|
||||||
|
public string tileSetName { get; set; }
|
||||||
|
public Rectangle[] collisions { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,16 +14,29 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates
|
||||||
[JsonDerivedType(typeof(UpdateEntityHealth))]
|
[JsonDerivedType(typeof(UpdateEntityHealth))]
|
||||||
[JsonDerivedType(typeof(UpdateGameEnded))]
|
[JsonDerivedType(typeof(UpdateGameEnded))]
|
||||||
[JsonDerivedType(typeof(UpdateGameObjectCreated))]
|
[JsonDerivedType(typeof(UpdateGameObjectCreated))]
|
||||||
|
[JsonDerivedType(typeof(UpdateGameObjectDeleted))]
|
||||||
[JsonDerivedType(typeof(UpdateLoot))]
|
[JsonDerivedType(typeof(UpdateLoot))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
[JsonDerivedType(typeof(UpdatePlayerParametrs))]
|
||||||
[JsonDerivedType(typeof(UpdatePosition))]
|
[JsonDerivedType(typeof(UpdatePosition))]
|
||||||
[JsonDerivedType(typeof(UpdateTileCreated))]
|
[JsonDerivedType(typeof(UpdateTileCreated))]
|
||||||
[JsonDerivedType(typeof(UpdateInput))]
|
[JsonDerivedType(typeof(UpdateInput))]
|
||||||
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
[JsonDerivedType(typeof(UpdatePlayerExit))]
|
||||||
|
[JsonDerivedType(typeof(UpdateInteractionReady))]
|
||||||
|
[JsonDerivedType(typeof(UpdateInteraction))]
|
||||||
|
|
||||||
public class UpdateData
|
public class UpdateData
|
||||||
{
|
{
|
||||||
public int IdEntity { get; set; } //Id объекта
|
public int IdEntity { get; set; } //Id объекта
|
||||||
public string UpdateType { get; protected set; } //тип обновления
|
public string UpdateType { get; protected set; } //тип обновления
|
||||||
|
|
||||||
|
public UpdateData()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public UpdateData(int idEntity)
|
||||||
|
{
|
||||||
|
this.IdEntity = idEntity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Audio;
|
using Microsoft.Xna.Framework.Audio;
|
||||||
using Microsoft.Xna.Framework.Content;
|
using Microsoft.Xna.Framework.Content;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DangerousD.GameCore.Graphics;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Microsoft.Xna.Framework.Media;
|
using Microsoft.Xna.Framework.Media;
|
||||||
|
|
||||||
|
@ -20,23 +20,28 @@ namespace ZoFo.GameCore.GameManagers
|
||||||
|
|
||||||
public void LoadSounds() // метод для загрузки звуков из папки
|
public void LoadSounds() // метод для загрузки звуков из папки
|
||||||
{
|
{
|
||||||
var k = Directory.GetFiles("../../..//Content//sounds").Where(x => x.EndsWith("wav"));
|
//List<string> sounds = AppManager.Instance.Content.Load<List<string>>("sounds/");
|
||||||
|
|
||||||
|
var k = Directory.GetFiles(Directory.GetCurrentDirectory() + "//Content//sounds").Where(x => x.EndsWith("xnb"));
|
||||||
if (k.Count() > 0)
|
if (k.Count() > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".wav", "")).ToArray();// папка со звуками там где exe
|
string[] soundFiles = k.Select(x => x.Split("\\").Last().Split("/").Last().Replace(".xnb", "")).ToArray();// папка со звуками там где exe
|
||||||
foreach (var soundFile in soundFiles)
|
foreach (var soundFile in soundFiles)
|
||||||
{
|
{
|
||||||
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds//" + soundFile));
|
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds//" + soundFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
/*/if (sounds.Count() > 0)
|
||||||
if (k.Count() > 0)
|
|
||||||
{
|
{
|
||||||
|
foreach (var soundFile in sounds)
|
||||||
|
{
|
||||||
|
Sounds.Add(soundFile, AppManager.Instance.Content.Load<SoundEffect>("sounds/" + soundFile));
|
||||||
}
|
}
|
||||||
|
}/*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartAmbientSound(string soundName) // запустить звук у которого нет позиции
|
public void StartAmbientSound(string soundName) // запустить звук у которого нет позиции
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities
|
||||||
|
{
|
||||||
|
internal class EntittyForAnimationTests : Entity
|
||||||
|
{
|
||||||
|
|
||||||
|
//public override GraphicsComponent graphicsComponent { get; } = new GraphicsComponent(new List<string> { "тут пишите название анимации" }, "сдублируйте " +
|
||||||
|
|
||||||
|
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_idle_rotate_weapon" }, "player_idle_rotate_weapon");
|
||||||
|
|
||||||
|
public EntittyForAnimationTests(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*12, 16 * 16);
|
||||||
|
position = new Vector2(10, 10);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,21 +4,37 @@ using System.Text;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using ZoFo.GameCore.GameManagers.CollisionManager;
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities
|
namespace ZoFo.GameCore.GameObjects.Entities
|
||||||
{
|
{
|
||||||
public abstract class Entity : GameObject
|
public abstract class Entity : GameObject
|
||||||
{
|
{
|
||||||
public override GraphicsComponent graphicsComponent => null;
|
//public override GraphicsComponent graphicsComponent => null;
|
||||||
public CollisionComponent collisionComponent { get; protected set; }
|
public CollisionComponent collisionComponent { get; protected set; }
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
static int totalEntitiesCreated = 0;
|
||||||
protected Entity(Vector2 position) : base(position)
|
protected Entity(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
|
Id = totalEntitiesCreated;
|
||||||
|
totalEntitiesCreated++;
|
||||||
|
collisionComponent = new CollisionComponent(this);
|
||||||
}
|
}
|
||||||
|
/// <summary>
|
||||||
|
/// For initialisation on Client
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="newId"></param>
|
||||||
|
public void SetIdByClient(int newId)
|
||||||
|
{
|
||||||
|
Id = newId;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void Update()
|
public virtual void Update()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
public override void UpdateLogic()
|
||||||
|
{
|
||||||
|
Update();
|
||||||
|
base.UpdateLogic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
class Ammo:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("Textures/icons/8");
|
||||||
|
public Ammo(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
graphicsComponent.ObjectDrawRectangle.Width = 20;
|
||||||
|
graphicsComponent.ObjectDrawRectangle.Height = 20;
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("Ammo"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
class Antiradine:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("Antiradine");
|
||||||
|
public Antiradine(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("Antiradine"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
public class BottleOfWater : Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("BottleOfWater");
|
||||||
|
public BottleOfWater(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("BottleOfWater"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,20 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using System;
|
using System;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
||||||
public class Collectable : Entity
|
public class Collectable : Interactable
|
||||||
{
|
{
|
||||||
public Collectable(Vector2 position) : base(position)
|
public Collectable(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot());
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
public class Peeble:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("Peeble");
|
||||||
|
|
||||||
|
public Peeble(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("Peeble"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
class PureBottleOfWater:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("PureBottleOfWater");
|
||||||
|
|
||||||
|
public PureBottleOfWater(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("PureBottleOfWater"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
class RottenFlesh:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("RottenFlesh");
|
||||||
|
public RottenFlesh(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("RottenFlesh"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||||
|
{
|
||||||
|
class Steel:Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("Steel");
|
||||||
|
|
||||||
|
public Steel(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("Steel"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
||||||
|
|
||||||
|
public class Wood : Collectable
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("Wood");
|
||||||
|
|
||||||
|
public Wood(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateLoot("Wood"));
|
||||||
|
AppManager.Instance.server.DeleteObject(this);
|
||||||
|
}
|
||||||
|
}
|
24
ZoFo/GameCore/GameObjects/Entities/Interactables/Door.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
|
||||||
|
|
||||||
|
public class Door : Interactable
|
||||||
|
{
|
||||||
|
public bool isOpened;
|
||||||
|
|
||||||
|
public override StaticGraphicsComponent graphicsComponent { get; } = new("DoorInteraction");
|
||||||
|
|
||||||
|
public Door(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
//graphicsComponent.OnAnimationEnd += _ => { isOpened = !isOpened; };//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - SD
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
//graphicsComponent.AnimationSelect("DoorInteraction", isOpened);
|
||||||
|
//graphicsComponent.AnimationStep();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
|
namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
|
||||||
|
|
||||||
|
public class Interactable : Entity
|
||||||
|
{
|
||||||
|
public override StaticGraphicsComponent graphicsComponent => throw new System.NotImplementedException();
|
||||||
|
|
||||||
|
public Interactable(Vector2 position) : base(position)
|
||||||
|
{
|
||||||
|
collisionComponent.OnTriggerEnter += (sender, e) => ChangeInteraction(sender, e, true);
|
||||||
|
collisionComponent.OnTriggerExit += (sender, e) => ChangeInteraction(sender, e, false);
|
||||||
|
collisionComponent.OnTriggerZone += OnInteraction;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeInteraction(object sender, CollisionComponent e, bool isReady)
|
||||||
|
{
|
||||||
|
AppManager.Instance.server.AddData(new UpdateInteractionReady((sender as Player).Id, isReady));
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual void OnInteraction(object sender, CollisionComponent e)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,12 +2,16 @@
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using ZoFo.GameCore.GameObjects.Entities;
|
using ZoFo.GameCore.GameObjects.Entities;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
|
||||||
using ZoFo.GameCore.GameManagers;
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
||||||
public class LivingEntity : Entity
|
public class LivingEntity : Entity
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Переменная для заявки на передвижения, т.е. то, на сколько вы хотите, чтобы в этом кадре переместился объект
|
||||||
|
/// </summary>
|
||||||
public Vector2 velocity;
|
public Vector2 velocity;
|
||||||
|
|
||||||
private InputManager inputManager;
|
private InputManager inputManager;
|
||||||
|
@ -17,6 +21,8 @@ public class LivingEntity : Entity
|
||||||
inputManager = new InputManager();
|
inputManager = new InputManager();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override GraphicsComponent graphicsComponent { get; } = null;
|
||||||
|
|
||||||
#region Server side
|
#region Server side
|
||||||
/*public override void Update()
|
/*public override void Update()
|
||||||
{
|
{
|
||||||
|
@ -24,6 +30,12 @@ public class LivingEntity : Entity
|
||||||
}*/
|
}*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public void OnCollision(CollisionComponent component)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,13 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player
|
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player
|
||||||
{
|
{
|
||||||
internal class LootData
|
class LootData
|
||||||
{
|
{
|
||||||
public Dictionary<string, int> loots;
|
public Dictionary<string, int> loots;
|
||||||
public void AddLoot(object lootObject, int quantity)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
public void AddLoot(string lootName, int quantity)
|
||||||
|
{
|
||||||
|
loots.Add(lootName, quantity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Xna.Framework.Input;
|
||||||
using ZoFo.GameCore.GameManagers;
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||||
|
|
||||||
|
@ -10,17 +15,42 @@ public class Player : LivingEntity
|
||||||
{
|
{
|
||||||
public Vector2 InputWeaponRotation { get; set; }
|
public Vector2 InputWeaponRotation { get; set; }
|
||||||
public Vector2 InputPlayerRotation { get; set; }
|
public Vector2 InputPlayerRotation { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Факт того, что плеер в этом апдейте пытается стрелять
|
||||||
|
/// </summary>
|
||||||
public bool IsTryingToShoot { get; set; }
|
public bool IsTryingToShoot { get; set; }
|
||||||
Texture2D texture;
|
|
||||||
private float speed;
|
private float speed;
|
||||||
private int health;
|
private int health;
|
||||||
|
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_running_top_rotate" }, "player_running_top_rotate");
|
||||||
|
private LootData lootData;
|
||||||
public Player(Vector2 position) : base(position)
|
public Player(Vector2 position) : base(position)
|
||||||
{
|
{
|
||||||
//InputWeaponRotation = new Vector2(0, 0);
|
//InputWeaponRotation = new Vector2(0, 0);
|
||||||
//InputPlayerRotation = new Vector2(0, 0);
|
//InputPlayerRotation = new Vector2(0, 0);
|
||||||
|
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 100, 100);
|
||||||
|
collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(GameTime gameTime)
|
|
||||||
|
public override void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
MovementLogic();
|
||||||
|
}
|
||||||
|
float t;
|
||||||
|
public void MovementLogic()
|
||||||
|
{
|
||||||
|
//velocity.X = 3+(float)Math.Sin(t);
|
||||||
|
t++;
|
||||||
|
if (InputPlayerRotation.X > 0.9)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (Keyboard.GetState().IsKeyDown(Keys.D)) velocity.X = 5;
|
||||||
|
if (Keyboard.GetState().IsKeyDown(Keys.A)) velocity.X = -5;
|
||||||
|
if (Keyboard.GetState().IsKeyDown(Keys.S)) velocity.Y = 5;
|
||||||
|
if (Keyboard.GetState().IsKeyDown(Keys.W)) velocity.Y = -5;
|
||||||
|
}
|
||||||
|
public void HandleNewInput(UpdateInput updateInput)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,8 +3,8 @@ using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using ZoFo.GameCore.GameManagers;
|
using ZoFo.GameCore.GameManagers;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
|
||||||
using ZoFo.GameCore;
|
using ZoFo.GameCore;
|
||||||
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects;
|
namespace ZoFo.GameCore.GameObjects;
|
||||||
|
|
||||||
|
@ -12,20 +12,24 @@ public abstract class GameObject
|
||||||
{
|
{
|
||||||
public Vector2 position;
|
public Vector2 position;
|
||||||
|
|
||||||
private Server server;
|
|
||||||
public Vector2 rotation; //вектор направления объекта
|
public Vector2 rotation; //вектор направления объекта
|
||||||
public abstract GraphicsComponent graphicsComponent { get; }
|
public virtual GraphicsComponent graphicsComponent { get; }
|
||||||
|
|
||||||
#region ServerSide
|
#region ServerSide
|
||||||
public GameObject(Vector2 position)
|
public GameObject(Vector2 position)
|
||||||
{
|
{
|
||||||
this.position = position;
|
this.position = position;
|
||||||
|
|
||||||
graphicsComponent.LoadContent();
|
graphicsComponent.LoadContent();
|
||||||
|
|
||||||
|
graphicsComponent.ObjectDrawRectangle.X = (int)position.X;
|
||||||
|
graphicsComponent.ObjectDrawRectangle.Y = (int)position.Y;
|
||||||
|
|
||||||
}
|
}
|
||||||
public virtual void UpdateLogic(GameTime gameTime)
|
public virtual void UpdateLogic()
|
||||||
{
|
{
|
||||||
PlayAnimation_OnServer();
|
PlayAnimation_OnServer();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,6 +46,7 @@ public abstract class GameObject
|
||||||
|
|
||||||
#region Client Side
|
#region Client Side
|
||||||
|
|
||||||
|
public static Texture2D debugTexture;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Для клиента
|
/// Для клиента
|
||||||
/// Это вызывается в клиентской части игры
|
/// Это вызывается в клиентской части игры
|
||||||
|
@ -64,8 +69,10 @@ public abstract class GameObject
|
||||||
/// Для клиента
|
/// Для клиента
|
||||||
/// Обновление, которое вызывается у клиента, для просмотра анимаций
|
/// Обновление, которое вызывается у клиента, для просмотра анимаций
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void UpdateAnimations(GameTime gameTime)
|
public virtual void UpdateAnimations()
|
||||||
{
|
{
|
||||||
|
graphicsComponent.ObjectDrawRectangle.X = (int)position.X; //Move To place where Updates Sets your position
|
||||||
|
graphicsComponent.ObjectDrawRectangle.Y = (int)position.Y;
|
||||||
PlayAnimation_OnClient();
|
PlayAnimation_OnClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,21 +81,23 @@ public abstract class GameObject
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public virtual void Draw(SpriteBatch spriteBatch)
|
public virtual void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
graphicsComponent.DrawAnimation(graphicsComponent.ObjectDrawRectangle, spriteBatch);
|
graphicsComponent.Draw(graphicsComponent.ObjectDrawRectangle, spriteBatch);
|
||||||
//debug
|
//debug
|
||||||
|
DrawDebugRectangle(spriteBatch, graphicsComponent.ObjectDrawRectangle);
|
||||||
|
|
||||||
if (AppManager.Instance.InputManager.CollisionsCheat)
|
if (AppManager.Instance.InputManager.CollisionsCheat)
|
||||||
DrawDebugRectangle(spriteBatch, graphicsComponent.ObjectDrawRectangle);
|
DrawDebugRectangle(spriteBatch, graphicsComponent.ObjectDrawRectangle);
|
||||||
|
|
||||||
}
|
}
|
||||||
public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null)
|
public void DrawDebugRectangle(SpriteBatch spriteBatch, Rectangle _rectangle, Nullable<Color> color = null)
|
||||||
{
|
{
|
||||||
if (color is null) color = new Color(1, 0, 0, 0.25f);
|
if (color is null) color = new Color(1, 0, 0, 0.1f);
|
||||||
if (color.Value.A == 255) color = new Color(color.Value, 0.25f);
|
if (color.Value.A == 255) color = new Color(color.Value, 0.25f);
|
||||||
//spriteBatch.Draw(debugTexture,
|
spriteBatch.Draw(debugTexture,
|
||||||
// new Rectangle((_rectangle.X - GraphicsComponent.CameraPosition.X) * GraphicsComponent.scaling,
|
new Rectangle((_rectangle.X - GraphicsComponent.CameraPosition.X) * GraphicsComponent.scaling,
|
||||||
// (_rectangle.Y - GraphicsComponent.CameraPosition.Y) * GraphicsComponent.scaling,
|
(_rectangle.Y - GraphicsComponent.CameraPosition.Y) * GraphicsComponent.scaling,
|
||||||
// _rectangle.Width * GraphicsComponent.scaling,
|
_rectangle.Width * GraphicsComponent.scaling,
|
||||||
// _rectangle.Height * GraphicsComponent.scaling), color.Value);
|
_rectangle.Height * GraphicsComponent.scaling), color.Value);
|
||||||
|
|
||||||
//TODO: debugTexture
|
//TODO: debugTexture
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,33 +2,42 @@
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using ZoFo.GameCore.GameManagers;
|
using ZoFo.GameCore.GameManagers;
|
||||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
using ZoFo.GameCore.Graphics;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.MapObjects
|
namespace ZoFo.GameCore.GameObjects.MapObjects
|
||||||
{
|
{
|
||||||
public class MapObject : GameObject
|
public class MapObject : GameObject
|
||||||
{
|
{
|
||||||
public virtual bool IsColliderOn { get; protected set; } = true;//Who added that?
|
public virtual bool IsColliderOn { get; protected set; } = true;//Who added that?
|
||||||
public Rectangle _sourceRectangle;
|
public Rectangle sourceRectangle;
|
||||||
public override GraphicsComponent graphicsComponent { get; } = new();
|
public override GraphicsComponent graphicsComponent { get; }
|
||||||
|
= new StaticGraphicsComponent();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Создается простой объект на карте - no animations, только где, насколько крупно рисовать, по какой сорс ректанглу рисовать и из какой текстуры
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="position"></param>
|
||||||
|
/// <param name="size"></param>
|
||||||
|
/// <param name="sourceRectangle"></param>
|
||||||
|
/// <param name="textureName"></param>
|
||||||
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position)
|
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position)
|
||||||
{
|
{
|
||||||
_sourceRectangle = sourceRectangle;
|
(graphicsComponent as StaticGraphicsComponent)._textureName = textureName;
|
||||||
graphicsComponent.ObjectDrawRectangle = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y);
|
(graphicsComponent as StaticGraphicsComponent).BuildComponent(textureName);
|
||||||
graphicsComponent.BuildComponent(textureName);
|
(graphicsComponent as StaticGraphicsComponent).ObjectDrawRectangle = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y);
|
||||||
|
(graphicsComponent as StaticGraphicsComponent).LoadContent();
|
||||||
graphicsComponent.LoadContent();
|
this.sourceRectangle = sourceRectangle;
|
||||||
|
|
||||||
}
|
}
|
||||||
public override void Draw(SpriteBatch spriteBatch)
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
{
|
{
|
||||||
graphicsComponent.DrawAnimation(graphicsComponent.ObjectDrawRectangle, spriteBatch, _sourceRectangle);
|
graphicsComponent.Draw(graphicsComponent.ObjectDrawRectangle, spriteBatch, sourceRectangle);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,32 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using ZoFo.GameCore.GameManagers.CollisionManager;
|
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||||
using ZoFo.GameCore.ZoFo_graphics;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
namespace ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||||
|
|
||||||
public class StopObject : MapObject
|
public class StopObject : MapObject
|
||||||
{
|
{
|
||||||
CollisionComponent collisionComponent;
|
public CollisionComponent[] collisionComponents;
|
||||||
|
|
||||||
protected StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName) : base(position, size, sourceRectangle, textureName)
|
|
||||||
|
public StopObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName, Rectangle[] collisions) : base(position, size, sourceRectangle, textureName)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
collisionComponents = new CollisionComponent[collisions.Length];
|
||||||
|
for (int i = 0; i < collisionComponents.Length; i++)
|
||||||
|
{
|
||||||
|
collisionComponents[i] = new CollisionComponent(this, true, new Rectangle(0,0, (int)size.X, (int)size.Y)/*collisions[i]*/);
|
||||||
|
}
|
||||||
|
//REDO
|
||||||
// TODO: Написать коллизию, пусть тразмер будет чисто таким же как и текстурка.
|
// TODO: Написать коллизию, пусть тразмер будет чисто таким же как и текстурка.
|
||||||
// Поменяйте уровень защиты конструктора, после снимите в MapManager комментарий в методе LoadMap с создания StopObject-а
|
// Поменяйте уровень защиты конструктора, после снимите в MapManager комментарий в методе LoadMap с создания StopObject-а
|
||||||
}
|
}
|
||||||
|
public override void Draw(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
base.Draw(spriteBatch);
|
||||||
|
DrawDebugRectangle(spriteBatch, new Rectangle((int)position.X, (int)position.Y, collisionComponents[0].stopRectangle.Width, collisionComponents[0].stopRectangle.Height));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace ZoFo.GameCore.GameObjects.MapObjects.Tiles;
|
|
||||||
|
|
||||||
public class Tile
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,30 +1,25 @@
|
||||||
using ZoFo.GameCore.GameObjects;
|
using System;
|
||||||
using ZoFo.GameCore.GameManagers;
|
|
||||||
using Microsoft.Xna.Framework;
|
|
||||||
using Microsoft.Xna.Framework.Content;
|
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Security.Cryptography.X509Certificates;
|
using Microsoft.Xna.Framework;
|
||||||
using System.Text;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Zofo.GameCore.ZoFo_grafics;
|
using ZoFo.GameCore.GameManagers;
|
||||||
|
using ZoFo.GameCore.GUI;
|
||||||
|
|
||||||
namespace ZoFo.GameCore.ZoFo_graphics
|
namespace ZoFo.GameCore.Graphics
|
||||||
{
|
{
|
||||||
|
|
||||||
public class GraphicsComponent
|
public class AnimatedGraphicsComponent : GraphicsComponent
|
||||||
{
|
{
|
||||||
public Rectangle ObjectDrawRectangle { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public event Action<string> actionOfAnimationEnd;
|
public event Action<string> actionOfAnimationEnd;
|
||||||
private List<AnimationContainer> animations;
|
public List<AnimationContainer> animations;
|
||||||
private List<Texture2D> textures;
|
private List<Texture2D> textures;
|
||||||
public List<string> texturesNames; //rethink public and following that errors
|
private List<string> texturesNames;
|
||||||
private AnimationContainer currentAnimation;
|
private AnimationContainer currentAnimation;
|
||||||
static public int scaling = 5;
|
static public int Camera_XW=800;
|
||||||
|
static public int Camera_YH = 400;
|
||||||
|
static public Vector2 CameraSize = new Vector2(1800, 960);
|
||||||
public int parentId;
|
public int parentId;
|
||||||
public AnimationContainer CurrentAnimation
|
public AnimationContainer CurrentAnimation
|
||||||
{
|
{
|
||||||
|
@ -50,10 +45,22 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
return currentFrame;
|
return currentFrame;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Needed to ckeck whether the frame has changed since last update call
|
||||||
|
private int lastUpdateCallFrame;
|
||||||
|
public int LastUpdateCallFrame
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return lastUpdateCallFrame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public int CurrentFrameInterval { get => interval; }
|
||||||
|
public void Force_Set_CurrentFrameInterval(int newFrameInterval) { }
|
||||||
private int interval;
|
private int interval;
|
||||||
private int lastInterval;
|
private int lastInterval;
|
||||||
private Rectangle sourceRectangle;
|
private Rectangle sourceRectangle;
|
||||||
public GraphicsComponent(List<string> animationsId, string neitralAnimationId)
|
public AnimatedGraphicsComponent(List<string> animationsId, string neitralAnimationId)
|
||||||
{
|
{
|
||||||
//this._spriteBatch = _spriteBatch;
|
//this._spriteBatch = _spriteBatch;
|
||||||
currentFrame = 0;
|
currentFrame = 0;
|
||||||
|
@ -64,18 +71,8 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
buildSourceRectangle();
|
buildSourceRectangle();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string mainTextureName;//TODO костыль - пофиксить
|
public AnimatedGraphicsComponent(string textureName)
|
||||||
public GraphicsComponent(string textureName)
|
|
||||||
{
|
{
|
||||||
BuildComponent(textureName);
|
|
||||||
}
|
|
||||||
public GraphicsComponent()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public void BuildComponent(string textureName)
|
|
||||||
{
|
|
||||||
mainTextureName = textureName;
|
|
||||||
//texturesNames.Add(textureName);//Added by SD
|
|
||||||
animations = new List<AnimationContainer>();
|
animations = new List<AnimationContainer>();
|
||||||
textures = new List<Texture2D>();
|
textures = new List<Texture2D>();
|
||||||
var texture = AppManager.Instance.Content.Load<Texture2D>(textureName);
|
var texture = AppManager.Instance.Content.Load<Texture2D>(textureName);
|
||||||
|
@ -106,16 +103,11 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadContent()
|
public override void LoadContent()
|
||||||
{
|
{
|
||||||
textures = new List<Texture2D>();
|
textures = new List<Texture2D>();
|
||||||
texturesNames = new List<string>();
|
texturesNames = new List<string>();
|
||||||
|
|
||||||
if (animations is null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var animation in animations)
|
foreach (var animation in animations)
|
||||||
{
|
{
|
||||||
if (!texturesNames.Contains(animation.TextureName))
|
if (!texturesNames.Contains(animation.TextureName))
|
||||||
|
@ -128,16 +120,6 @@ namespace ZoFo.GameCore.ZoFo_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);
|
||||||
|
|
||||||
|
@ -154,12 +136,9 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
SetInterval();
|
SetInterval();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (currentAnimation is null)
|
lastUpdateCallFrame = currentFrame;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (interval == 0)
|
if (interval == 0)
|
||||||
{
|
{
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
|
@ -186,7 +165,7 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
interval--;
|
interval--;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawAnimation(Rectangle destinationRectangle, SpriteBatch _spriteBatch)
|
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch)
|
||||||
{
|
{
|
||||||
Texture2D texture = textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)];
|
Texture2D texture = textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)];
|
||||||
float scale;
|
float scale;
|
||||||
|
@ -211,7 +190,7 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
_spriteBatch.Draw(texture,
|
_spriteBatch.Draw(texture,
|
||||||
destinationRectangle, sourceRectangle, Color.White);
|
destinationRectangle, sourceRectangle, Color.White);
|
||||||
}
|
}
|
||||||
public void DrawAnimation(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)
|
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)
|
||||||
{
|
{
|
||||||
Texture2D texture = textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)];
|
Texture2D texture = textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)];
|
||||||
float scale;
|
float scale;
|
||||||
|
@ -236,14 +215,6 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
_spriteBatch.Draw(texture,
|
_spriteBatch.Draw(texture,
|
||||||
destinationRectangle, sourceRectangle, Color.White);
|
destinationRectangle, sourceRectangle, Color.White);
|
||||||
}
|
}
|
||||||
private Rectangle Scaling(Rectangle destinationRectangle)
|
|
||||||
{
|
|
||||||
destinationRectangle.X *= scaling;
|
|
||||||
destinationRectangle.Y *= scaling;
|
|
||||||
destinationRectangle.Width *= scaling;
|
|
||||||
destinationRectangle.Height *= scaling;
|
|
||||||
return destinationRectangle;
|
|
||||||
}
|
|
||||||
private void buildSourceRectangle()
|
private void buildSourceRectangle()
|
||||||
{
|
{
|
||||||
sourceRectangle = new Rectangle();
|
sourceRectangle = new Rectangle();
|
||||||
|
@ -271,35 +242,6 @@ namespace ZoFo.GameCore.ZoFo_graphics
|
||||||
interval = lastInterval;
|
interval = lastInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public static void SetCameraPosition(Vector2 playerPosition)
|
|
||||||
{
|
|
||||||
CameraPosition = (playerPosition).ToPoint();
|
|
||||||
CameraPosition.X -= 200;
|
|
||||||
CameraPosition.Y -= 120;
|
|
||||||
|
|
||||||
// TODO
|
|
||||||
/*
|
|
||||||
if (CameraPosition.X > AppManager.Instance.GameManager.CameraBorder.Y - 460)
|
|
||||||
{
|
|
||||||
CameraPosition.X = (int)AppManager.Instance.GameManager.CameraBorder.Y - 460;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CameraPosition.Y < AppManager.Instance.GameManager.CameraBorder.Z)
|
|
||||||
{
|
|
||||||
CameraPosition.Y = (int)AppManager.Instance.GameManager.CameraBorder.Z;
|
|
||||||
}
|
|
||||||
if (CameraPosition.X < AppManager.Instance.GameManager.CameraBorder.X)
|
|
||||||
{
|
|
||||||
CameraPosition.X = (int)AppManager.Instance.GameManager.CameraBorder.X;
|
|
||||||
}
|
|
||||||
if (CameraPosition.Y > AppManager.Instance.GameManager.CameraBorder.W - 240)
|
|
||||||
{
|
|
||||||
CameraPosition.Y = (int)AppManager.Instance.GameManager.CameraBorder.W - 240;
|
|
||||||
}
|
|
||||||
|
|
||||||
AppManager.Instance.DebugHUD.Set("CameraPosition", $"{CameraPosition.X}, {CameraPosition.Y}");
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
public static Point CameraPosition = new Point(0, 0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,9 +3,8 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Zofo.GameCore.ZoFo_grafics;
|
|
||||||
|
|
||||||
namespace DangerousD.GameCore.Graphics
|
namespace ZoFo.GameCore.Graphics
|
||||||
{
|
{
|
||||||
public class AnimationBuilder
|
public class AnimationBuilder
|
||||||
{
|
{
|
||||||
|
@ -13,11 +12,12 @@ namespace DangerousD.GameCore.Graphics
|
||||||
public void LoadAnimations()
|
public void LoadAnimations()
|
||||||
{
|
{
|
||||||
Animations = new List<AnimationContainer>();
|
Animations = new List<AnimationContainer>();
|
||||||
string[] animationFilesNames = Directory.GetFiles("../../../Content/animations");
|
string[] animationFilesNames = Directory.GetFiles("Content/Textures/Animations");
|
||||||
|
|
||||||
StreamReader reader;
|
StreamReader reader;
|
||||||
foreach (var fileName in animationFilesNames)
|
foreach (var fileName in animationFilesNames)
|
||||||
{
|
{
|
||||||
|
if (!fileName.EndsWith(".animation")) continue;
|
||||||
reader = new StreamReader(fileName);
|
reader = new StreamReader(fileName);
|
||||||
string json = reader.ReadToEnd();
|
string json = reader.ReadToEnd();
|
||||||
AnimationContainer animation = JsonConvert.DeserializeObject<AnimationContainer>(json);
|
AnimationContainer animation = JsonConvert.DeserializeObject<AnimationContainer>(json);
|