Merge branch 'DevelopmentX' into PlayerLogic
|
@ -37,11 +37,14 @@
|
|||
#begin MapData/TileMaps/main.tmj
|
||||
/copy:MapData/TileMaps/main.tmj
|
||||
|
||||
#begin MapData/TileMaps/main.tmx
|
||||
/copy:MapData/TileMaps/main.tmx
|
||||
#begin MapData/TileSets/tileset 1 collision.tsj
|
||||
/copy:MapData/TileSets/tileset 1 collision.tsj
|
||||
|
||||
#begin MapData/TileSets/CollisionTileSet.tsj
|
||||
/copy:MapData/TileSets/CollisionTileSet.tsj
|
||||
#begin MapData/TileSets/TileSet 1.tsj
|
||||
/copy:MapData/TileSets/TileSet 1.tsj
|
||||
|
||||
#begin MapData/TileSets/TilesetNature.tsj
|
||||
/copy:MapData/TileSets/TilesetNature.tsj
|
||||
|
||||
#begin sounds/Loot.wav
|
||||
/importer:WavImporter
|
||||
|
@ -121,54 +124,54 @@
|
|||
#begin Textures/Animations/player_left_idle.animation
|
||||
/copy:Textures/Animations/player_left_idle.animation
|
||||
|
||||
#begin Textures/Animations/player_look_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_down_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_down.animation
|
||||
/copy:Textures/Animations/player_look_down.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_down_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left_down.animation
|
||||
/copy:Textures/Animations/player_look_left_down.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_up_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left_up.animation
|
||||
/copy:Textures/Animations/player_look_left_up.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_weapon.animation
|
||||
#begin Textures/Animations/player_look_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_down_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_left.animation
|
||||
/copy:Textures/Animations/player_look_left.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_down_weapon.animation
|
||||
#begin Textures/Animations/player_look_left_down.animation
|
||||
/copy:Textures/Animations/player_look_left_down.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_down.animation
|
||||
/copy:Textures/Animations/player_look_right_down.animation
|
||||
#begin Textures/Animations/player_look_left_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_down_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_up_weapon.animation
|
||||
#begin Textures/Animations/player_look_left_up.animation
|
||||
/copy:Textures/Animations/player_look_left_up.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_up.animation
|
||||
/copy:Textures/Animations/player_look_right_up.animation
|
||||
#begin Textures/Animations/player_look_left_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_up_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_weapon.animation
|
||||
#begin Textures/Animations/player_look_left_weapon.animation
|
||||
/copy:Textures/Animations/player_look_left_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right.animation
|
||||
/copy:Textures/Animations/player_look_right.animation
|
||||
|
||||
#begin Textures/Animations/player_look_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_up_weapon.animation
|
||||
#begin Textures/Animations/player_look_right_down.animation
|
||||
/copy:Textures/Animations/player_look_right_down.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_down_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_down_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_up.animation
|
||||
/copy:Textures/Animations/player_look_right_up.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_up_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_right_weapon.animation
|
||||
/copy:Textures/Animations/player_look_right_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_look_up.animation
|
||||
/copy:Textures/Animations/player_look_up.animation
|
||||
|
||||
#begin Textures/Animations/player_look_up_weapon.animation
|
||||
/copy:Textures/Animations/player_look_up_weapon.animation
|
||||
|
||||
#begin Textures/Animations/player_right_idle.animation
|
||||
/copy:Textures/Animations/player_right_idle.animation
|
||||
|
||||
|
@ -193,17 +196,20 @@
|
|||
#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/Animations/zombie_attack.animation
|
||||
/copy:Textures/Animations/zombie_attack.animation
|
||||
|
||||
#begin Textures/Animations/zombie_damaged.animation
|
||||
/copy:Textures/Animations/zombie_damaged.animation
|
||||
|
||||
#begin Textures/Animations/zombie_death.animation
|
||||
/copy:Textures/Animations/zombie_death.animation
|
||||
|
||||
#begin Textures/Animations/zombie_idle.animation
|
||||
/copy:Textures/Animations/zombie_idle.animation
|
||||
|
||||
#begin Textures/Animations/zombie_walk.animation
|
||||
/copy:Textures/Animations/zombie_walk.animation
|
||||
|
||||
#begin Textures/AnimationTextures/Character/hr-level1_idle.png
|
||||
/importer:TextureImporter
|
||||
|
@ -217,6 +223,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/AnimationTextures/Character/hr-level1_idle.png
|
||||
|
||||
#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_mining_tool-1.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -241,18 +259,6 @@
|
|||
/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
|
||||
|
@ -265,6 +271,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/AnimationTextures/Character/hr-level1_running.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/unicorn.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -277,6 +295,30 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/AnimationTextures/unicorn.png
|
||||
|
||||
#begin Textures/AnimationTextures/Zombie/zombie_spritesheet_v1.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/Zombie/zombie_spritesheet_v1.png
|
||||
|
||||
#begin Textures/AnimationTextures/Zombie/zombie_spritesheet_v2.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/Zombie/zombie_spritesheet_v2.png
|
||||
|
||||
#begin Textures/GUI/background/base.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -361,18 +403,6 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/background/waiting.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off-on.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
/processorParam:ColorKeyEnabled=True
|
||||
/processorParam:GenerateMipmaps=False
|
||||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/checkboxs_off-on.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -385,6 +415,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/checkboxs_off.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_off-on.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
/processorParam:ColorKeyEnabled=True
|
||||
/processorParam:GenerateMipmaps=False
|
||||
/processorParam:PremultiplyAlpha=True
|
||||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/checkboxs_off-on.png
|
||||
|
||||
#begin Textures/GUI/checkboxs_on.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -421,18 +463,6 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/mouse.png
|
||||
|
||||
#begin Textures/GUI/Switch_backgrownd.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/GUI/Switch_backgrownd.png
|
||||
|
||||
#begin Textures/GUI/switch.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -445,6 +475,18 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/GUI/switch.png
|
||||
|
||||
#begin Textures/GUI/Switch_backgrownd.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/GUI/Switch_backgrownd.png
|
||||
|
||||
#begin Textures/icons/12.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
|
@ -613,7 +655,7 @@
|
|||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/Test/wood.jpg
|
||||
|
||||
#begin Textures/TileSets/Tilelist1.png
|
||||
#begin Textures/TileSetImages/Pipes.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -623,9 +665,9 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/TileSets/Tilelist1.png
|
||||
/build:Textures/TileSetImages/Pipes.png
|
||||
|
||||
#begin Textures/TileSets/Tilelist2.png
|
||||
#begin Textures/TileSetImages/Tilelist1.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -635,9 +677,9 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/TileSets/Tilelist2.png
|
||||
/build:Textures/TileSetImages/Tilelist1.png
|
||||
|
||||
#begin Textures/TileSets/Tilelist3.png
|
||||
#begin Textures/TileSetImages/Tilelist2.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -647,9 +689,9 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/TileSets/Tilelist3.png
|
||||
/build:Textures/TileSetImages/Tilelist2.png
|
||||
|
||||
#begin Textures/TileSets/Tilelist4.png
|
||||
#begin Textures/TileSetImages/Tilelist3.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -659,9 +701,9 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/TileSets/Tilelist4.png
|
||||
/build:Textures/TileSetImages/Tilelist3.png
|
||||
|
||||
#begin Textures/TileSets/TilesetFloor.png
|
||||
#begin Textures/TileSetImages/Tilelist4.png
|
||||
/importer:TextureImporter
|
||||
/processor:TextureProcessor
|
||||
/processorParam:ColorKeyColor=255,0,255,255
|
||||
|
@ -671,5 +713,197 @@
|
|||
/processorParam:ResizeToPowerOfTwo=False
|
||||
/processorParam:MakeSquare=False
|
||||
/processorParam:TextureFormat=Color
|
||||
/build:Textures/TileSets/TilesetFloor.png
|
||||
/build:Textures/TileSetImages/Tilelist4.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetDesert.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/TileSetImages/TilesetDesert.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetDungeon.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/TileSetImages/TilesetDungeon.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetElement.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/TileSetImages/TilesetElement.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetField.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/TileSetImages/TilesetField.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetFloor.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/TileSetImages/TilesetFloor.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetFloorB.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/TileSetImages/TilesetFloorB.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetFloorDetail.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/TileSetImages/TilesetFloorDetail.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetHole.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/TileSetImages/TilesetHole.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetHouse.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/TileSetImages/TilesetHouse.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetLogic.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/TileSetImages/TilesetLogic.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetNature.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/TileSetImages/TilesetNature.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetRelief.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/TileSetImages/TilesetRelief.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetReliefDetail.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/TileSetImages/TilesetReliefDetail.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetTowers.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/TileSetImages/TilesetTowers.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetVillageAbandoned.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/TileSetImages/TilesetVillageAbandoned.png
|
||||
|
||||
#begin Textures/TileSetImages/TilesetWater.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/TileSetImages/TilesetWater.png
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
"scaleInDock": 1
|
||||
},
|
||||
"TileMaps/main.tmj": {
|
||||
"scale": 0.75,
|
||||
"selectedLayer": 0,
|
||||
"scale": 0.33,
|
||||
"selectedLayer": 1,
|
||||
"viewCenter": {
|
||||
"x": 578,
|
||||
"y": 482.66666666666674
|
||||
"x": 1010.6060606060606,
|
||||
"y": 553.0303030303031
|
||||
}
|
||||
},
|
||||
"TileSets/CollisionTileSet.tsj": {
|
||||
|
@ -29,29 +29,35 @@
|
|||
"scaleInDock": 1,
|
||||
"scaleInEditor": 1.5
|
||||
},
|
||||
"TileSets/TilesetNature.tsj": {
|
||||
"scaleInDock": 1
|
||||
},
|
||||
"TileSets/WallSet.tsj": {
|
||||
"scaleInDock": 1,
|
||||
"scaleInEditor": 1
|
||||
},
|
||||
"TileSets/tileset 1 collision.tsj": {
|
||||
"scaleInDock": 1
|
||||
}
|
||||
},
|
||||
"last.imagePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/Textures/TileSetImages",
|
||||
"openFiles": [
|
||||
"TileSets/TileSet 1.tsj",
|
||||
"TileMaps/main.tmj",
|
||||
"TileSets/CollisionTileSet.tsj"
|
||||
"TileMaps/main.tmj"
|
||||
],
|
||||
"project": "MapSession.tiled-project",
|
||||
"recentFiles": [
|
||||
"TileMaps/main.tmj",
|
||||
"TileSets/TileSet 1.tsj",
|
||||
"TileMaps/main.tmj",
|
||||
"TileSets/CollisionTileSet.tsj",
|
||||
"TileSets/WallSet.tsj"
|
||||
],
|
||||
"stampsFolder": "C:/Users/artem/source/repos/ZoFo/ZoFo/Content/MapData/TileStamps",
|
||||
"tileset.lastUsedFormat": "json",
|
||||
"tileset.margin": 2,
|
||||
"tileset.spacing": 2,
|
||||
"tileset.margin": 0,
|
||||
"tileset.spacing": 0,
|
||||
"tileset.tileSize": {
|
||||
"height": 128,
|
||||
"width": 128
|
||||
"height": 16,
|
||||
"width": 16
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,435 +0,0 @@
|
|||
{ "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"
|
||||
}
|
|
@ -8,15 +8,15 @@
|
|||
"width":24
|
||||
},
|
||||
"image":"..\/..\/Textures\/TileSetImages\/TilesetFloor.png",
|
||||
"imageheight":832,
|
||||
"imagewidth":704,
|
||||
"imageheight":417,
|
||||
"imagewidth":352,
|
||||
"margin":0,
|
||||
"name":"TileSet 1",
|
||||
"objectalignment":"topleft",
|
||||
"spacing":0,
|
||||
"tilecount":572,
|
||||
"tiledversion":"1.10.2",
|
||||
"tileheight":32,
|
||||
"tileheight":16,
|
||||
"tiles":[
|
||||
{
|
||||
"id":0,
|
||||
|
@ -2315,7 +2315,7 @@
|
|||
"id":571,
|
||||
"type":"Tile"
|
||||
}],
|
||||
"tilewidth":32,
|
||||
"tilewidth":16,
|
||||
"type":"tileset",
|
||||
"version":"1.10",
|
||||
"wangsets":[
|
||||
|
|
2537
ZoFo/Content/MapData/TileSets/TilesetNature.tsj
Normal file
1658
ZoFo/Content/MapData/TileSets/tileset 1 collision.tsj
Normal file
1
ZoFo/Content/MapData/TileStamps/boulders.stamp
Normal file
1
ZoFo/Content/MapData/TileStamps/stone buildings.stamp
Normal file
|
@ -0,0 +1 @@
|
|||
{"name":"Stone Buildings","variations":[{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJwNwwcNACAMALBxLMCwwPGvjzZpiYhqszucpsvt8fr8EWABDw==","encoding":"base64","height":3,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":4,"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 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJxjZWBgYANidiDmAGJJIJYCYmkglgFiXSDWA2J9IDYAYgAWQAE/","encoding":"base64","height":3,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":4,"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 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjZGBg4AJibiCWBWI5IJYHYkMgNgJiYyAGAA+EAQ8=","encoding":"base64","height":3,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":3,"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 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":3},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjYWBg4AViPiBWAGJFIFYCYhMgNgViMyAGABGgASo=","encoding":"base64","height":3,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":3,"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 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":3},"probability":1},{"map":{"compressionlevel":-1,"height":2,"infinite":false,"layers":[{"compression":"zlib","data":"eJzzY2Bg8AfiACBOAuJkIE4BYgAb1AIX","encoding":"base64","height":2,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":3,"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 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":3},"probability":1}]}
|
After Width: | Height: | Size: 5 KiB |
After Width: | Height: | Size: 16 KiB |
1
ZoFo/Content/Textures/Animations/zombie_attack.animation
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"zombie_attack","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":64,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":3,"isCycle":true,"offset":"0, 0"}
|
|
@ -0,0 +1 @@
|
|||
{"id":"zombie_damaged","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":128,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":1,"isCycle":true,"offset":"0, 0"}
|
1
ZoFo/Content/Textures/Animations/zombie_death.animation
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"zombie_death","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":96,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":9,"isCycle":true,"offset":"0, 0"}
|
1
ZoFo/Content/Textures/Animations/zombie_idle.animation
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"zombie_idle","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":0,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":60}],"textureFrameInterval":0,"framesCount":2,"isCycle":true,"offset":"0, 0"}
|
1
ZoFo/Content/Textures/Animations/zombie_walk.animation
Normal file
|
@ -0,0 +1 @@
|
|||
{"id":"zombie_walk","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":32,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":5}],"textureFrameInterval":0,"framesCount":8,"isCycle":true,"offset":"0, 0"}
|
BIN
ZoFo/Content/Textures/TileSetImages/Pipes.png
Normal file
After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 769 KiB After Width: | Height: | Size: 769 KiB |
Before Width: | Height: | Size: 578 KiB After Width: | Height: | Size: 578 KiB |
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 2.1 MiB |
Before Width: | Height: | Size: 120 KiB After Width: | Height: | Size: 120 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetDesert.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetDungeon.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetElement.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetField.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetFloor.png
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetFloorB.png
Normal file
After Width: | Height: | Size: 2 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetFloorDetail.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetHole.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetHouse.png
Normal file
After Width: | Height: | Size: 57 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetLogic.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetNature.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetRelief.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetReliefDetail.png
Normal file
After Width: | Height: | Size: 6 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetTowers.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetVillageAbandoned.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
ZoFo/Content/Textures/TileSetImages/TilesetWater.png
Normal file
After Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 399 KiB |
|
@ -24,6 +24,9 @@ using ZoFo.GameCore.GUI;
|
|||
using ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
|
||||
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies;
|
||||
using ZoFo.GameCore.Graphics;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
namespace ZoFo.GameCore
|
||||
{
|
||||
public class Client
|
||||
|
@ -47,7 +50,7 @@ namespace ZoFo.GameCore
|
|||
networkManager.AddData(new UpdateInput()
|
||||
{
|
||||
InputMovementDirection = AppManager.Instance.InputManager.InputMovementDirection,
|
||||
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection
|
||||
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection
|
||||
});
|
||||
|
||||
};
|
||||
|
@ -57,19 +60,27 @@ namespace ZoFo.GameCore
|
|||
};
|
||||
AppManager.Instance.InputManager.ShootEvent += () =>
|
||||
{
|
||||
networkManager.AddData(new UpdateInputShoot() { });
|
||||
networkManager.AddData(new UpdateInputShoot() { });
|
||||
};
|
||||
}
|
||||
|
||||
public void OnDataSend(string data)
|
||||
{
|
||||
List<UpdateData> updateDatas = JsonSerializer.Deserialize<List<UpdateData>>(data);
|
||||
//List<UpdateTileCreated> updateDatas = JsonSerializer.Deserialize<List<UpdateTileCreated>>(data);
|
||||
JArray jToken = JsonConvert.DeserializeObject(data) as JArray;
|
||||
|
||||
//string[] brands = jToken.SelectToken("")?.ToObject<string[]>();
|
||||
foreach (JToken update in jToken.Children())
|
||||
{
|
||||
string a = update.ToString();
|
||||
UpdateTileCreated u = System.Text.Json.JsonSerializer.Deserialize<UpdateTileCreated>(a);
|
||||
}
|
||||
// тут будет switch
|
||||
AppManager.Instance.debugHud.Log(data);
|
||||
foreach (var item in updateDatas)
|
||||
{
|
||||
GotData(item);
|
||||
}
|
||||
//foreach (var item in updateDatas)
|
||||
//{
|
||||
// GotData(item);
|
||||
//}
|
||||
|
||||
}
|
||||
public void GameEndedUnexpectedly() { }
|
||||
|
@ -124,22 +135,21 @@ namespace ZoFo.GameCore
|
|||
mapObjects.Add(
|
||||
new MapObject(
|
||||
(update as UpdateTileCreated).Position,
|
||||
(update as UpdateTileCreated).Size.ToVector2(),
|
||||
(update as UpdateTileCreated).sourceRectangle,
|
||||
(update as UpdateTileCreated).Size.GetPoint().ToVector2(),
|
||||
(update as UpdateTileCreated).sourceRectangle.GetRectangle(),
|
||||
(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 UpdateStopObjectCreated)
|
||||
//{
|
||||
// stopObjects.Add(
|
||||
// new StopObject(
|
||||
// (update as UpdateStopObjectCreated).Position,
|
||||
// (update as UpdateStopObjectCreated).Size.ToVector2(),
|
||||
// (update as UpdateStopObjectCreated).sourceRectangle,
|
||||
// (update as UpdateStopObjectCreated).tileSetName
|
||||
// ));
|
||||
//}
|
||||
else if (update is UpdateGameObjectCreated)
|
||||
{
|
||||
GameObject created_gameObject;
|
||||
|
@ -168,9 +178,23 @@ namespace ZoFo.GameCore
|
|||
else if (update is UpdatePosition)
|
||||
{
|
||||
var ent = FindEntityById(update.IdEntity);
|
||||
|
||||
|
||||
ent.position = (update as UpdatePosition).NewPosition;
|
||||
DebugHUD.Instance.Log("newPosition " + ent.position);
|
||||
}
|
||||
else if (update is UpdateAnimation)
|
||||
{
|
||||
var ent = FindEntityById(update.IdEntity);
|
||||
if (ent != null)
|
||||
((ent as Entity).graphicsComponent as AnimatedGraphicsComponent).StartAnimation((update as UpdateAnimation).animationId);
|
||||
//DebugHUD.Instance.Log("new Animation " + ent.position);
|
||||
}
|
||||
else if (update is UpdateGameObjectDeleted)
|
||||
{
|
||||
var ent = FindEntityById(update.IdEntity);
|
||||
|
||||
if (ent != null)
|
||||
DeleteObject(ent);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,6 +213,16 @@ namespace ZoFo.GameCore
|
|||
}
|
||||
return null;
|
||||
}
|
||||
public void DeleteObject(Entity entity)
|
||||
{
|
||||
|
||||
if (gameObjects.Contains(entity))
|
||||
gameObjects.Remove(entity);
|
||||
//if (entities.Contains(entity))
|
||||
// entities.Remove(entity);
|
||||
if (players.Contains(entity))
|
||||
players.Remove(entity as Player);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -62,6 +62,10 @@ public class DebugHUD
|
|||
{
|
||||
_text[key] = value;
|
||||
}
|
||||
public static void DebugSet(string key, string value)
|
||||
{
|
||||
Instance._text[key] = value;
|
||||
}
|
||||
|
||||
public void Log(string value)
|
||||
{
|
||||
|
@ -71,4 +75,12 @@ public class DebugHUD
|
|||
_log.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
public static void DebugLog(string value)
|
||||
{
|
||||
Instance._log.Add(value);
|
||||
if (Instance._log.Count > 30)
|
||||
{
|
||||
Instance._log.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -43,12 +43,11 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
|||
public GameObject gameObject { get; set; }
|
||||
|
||||
|
||||
bool doesStop;
|
||||
bool hasCollision;
|
||||
public bool hasCollision;
|
||||
public Rectangle stopRectangle;
|
||||
|
||||
// triggers for rectangle
|
||||
bool isTrigger;
|
||||
public bool isTrigger;
|
||||
public Rectangle triggerRectangle;
|
||||
|
||||
//delegate
|
||||
|
@ -58,13 +57,21 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
|||
|
||||
|
||||
//events DoorInteraction
|
||||
public event EventHandler<CollisionComponent> OnTriggerEnter;
|
||||
public event EventHandler<CollisionComponent> OnTriggerZone;
|
||||
public event EventHandler<CollisionComponent> OnTriggerExit;
|
||||
|
||||
public event EventHandler<CollisionComponent> OnCollision;
|
||||
public delegate void CollisionAction(Player player);
|
||||
public event CollisionAction? OnTriggerEnter;
|
||||
public event CollisionAction? OnTriggerZone;
|
||||
public event CollisionAction? OnTriggerExit;
|
||||
|
||||
public delegate void CoollisionEvent(GameObject gameObject);
|
||||
public event CoollisionEvent? OnCollision;
|
||||
|
||||
|
||||
|
||||
public void PlayerInZone(Player player) => OnTriggerZone?.Invoke(player);
|
||||
public void PlayerEnter(Player player) => OnTriggerEnter?.Invoke(player);
|
||||
public void PlayerExit(Player player) => OnTriggerExit?.Invoke(player);
|
||||
public void OnCollisionWithObject(GameObject gameObject) => OnCollision?.Invoke(gameObject);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ using ZoFo.GameCore.GameObjects.Entities;
|
|||
using ZoFo.GameCore.GameObjects.Entities.LivingEntities;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||
using ZoFo.GameCore.Graphics;
|
||||
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
||||
|
||||
namespace ZoFo.GameCore.GameManagers.CollisionManager
|
||||
{
|
||||
|
@ -25,119 +26,185 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
|
|||
|
||||
|
||||
//чекаем коллизии в листе
|
||||
|
||||
/// <summary>
|
||||
/// минимальный накоп изменения перед перевдижением
|
||||
/// </summary>
|
||||
const float minimalValueToChange = 4;
|
||||
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;
|
||||
currentRect.X += (int)entity.position.X;
|
||||
currentRect.Y += (int)entity.position.Y;
|
||||
|
||||
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)//фильтрация
|
||||
if (Math.Abs((int)entity.velocity.X) > minimalValueToChange ) //TODO
|
||||
{
|
||||
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))
|
||||
var collidedX = false; // соприкосновение
|
||||
var tryingRectX = currentRect;//переменная для попытки перемещения по X
|
||||
|
||||
tryingRectX.Offset((int)(entity.velocity.X), 0);//задаём значения для tryingRectX по X и по Y
|
||||
|
||||
foreach (var item in ObjectsWithCollisions)//фильтрация
|
||||
{
|
||||
collidedX = true;// меняем значение соприкосновения на true
|
||||
entity.OnCollision(item);//подписываем entity на ивент коллизии
|
||||
if (item == componentOfEntity) continue;
|
||||
|
||||
break;// выход
|
||||
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))
|
||||
|
||||
{
|
||||
collidedX = true;// меняем значение соприкосновения на true
|
||||
//entity.OnCollision(item);//подписываем entity на ивент коллизии
|
||||
item.OnCollisionWithObject(entity);
|
||||
entity.collisionComponent.OnCollisionWithObject(item.gameObject);
|
||||
break;// выход
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (collidedX)// срабатывает, если перемещение блокируется
|
||||
{
|
||||
entity.velocity.X = 0;// задаём значение смещения entity на 0
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.position.X += entity.velocity.X; //update player position
|
||||
newRect.X = tryingRectX.X;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
|
||||
}
|
||||
if (collidedX)// срабатывает, если перемещение блокируется
|
||||
{
|
||||
entity.velocity.X = 0;// задаём значение смещения entity на 0
|
||||
}
|
||||
else
|
||||
{
|
||||
entity.position.X += entity.velocity.X; //update player position
|
||||
newRect.X = tryingRectX.X;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
|
||||
}
|
||||
|
||||
entity.velocity.X = 0;
|
||||
}
|
||||
//==ПОВТОРЯЕМ ТОЖЕ САМОЕ ДЛЯ 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 (Math.Abs((int)entity.velocity.Y)> minimalValueToChange) //TODO
|
||||
{
|
||||
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))
|
||||
|
||||
tryingRectY.Offset(new Point(0, (int)entity.velocity.Y));//задаём значения для tryingRectX по X и по Y
|
||||
|
||||
foreach (var item in ObjectsWithCollisions)//фильтрация
|
||||
{
|
||||
collidedY = true;// меняем значение соприкосновения на true
|
||||
entity.OnCollision(item);//подписываем entity на ивент коллизии
|
||||
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))
|
||||
|
||||
break;// выход
|
||||
{
|
||||
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.velocity.Y = 0;
|
||||
}
|
||||
|
||||
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 UpdateTriggerZones(Player player)
|
||||
{
|
||||
|
||||
var entity = player as LivingEntity;
|
||||
var currentRect = entity.collisionComponent.stopRectangle;//задаём РЕК
|
||||
currentRect.X += (int)entity.position.X;
|
||||
currentRect.Y += (int)entity.position.Y;
|
||||
|
||||
|
||||
for (int i = 0; i < ObjectsWithTriggers.Count; i++)
|
||||
{
|
||||
int c = ObjectsWithTriggers.Count;
|
||||
|
||||
if (ObjectsWithTriggers[i].triggerRectangle.SetOrigin(ObjectsWithTriggers[i].gameObject.position).Intersects(currentRect))
|
||||
{
|
||||
ObjectsWithTriggers[i].PlayerInZone(player);
|
||||
}
|
||||
i -= c - ObjectsWithTriggers.Count;
|
||||
}
|
||||
}
|
||||
|
||||
//обновление позиции объекта
|
||||
|
||||
public void UpdatePositions()
|
||||
public void ResolvePhysics()
|
||||
{
|
||||
foreach (var item in EntitiesWithMovements)
|
||||
{
|
||||
CheckComponentCollision(item);
|
||||
}
|
||||
foreach (var item in AppManager.Instance.server.players)
|
||||
{
|
||||
UpdateTriggerZones(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CollisionManager()
|
||||
{
|
||||
//graphicsComponent
|
||||
//.ObjectDrawRectangle = new Rectangle(0, 0, 16 * 12, 16 * 16);
|
||||
EntitiesWithMovements = new List<CollisionComponent>();
|
||||
ObjectsWithCollisions = new List<CollisionComponent>();
|
||||
ObjectsWithTriggers = new List<CollisionComponent>();
|
||||
}
|
||||
//регистрация компонента(его коллизии)
|
||||
public void Register(CollisionComponent component)
|
||||
{
|
||||
ObjectsWithCollisions.Add(component);
|
||||
if (component.hasCollision)
|
||||
ObjectsWithCollisions.Add(component);
|
||||
if (component.isTrigger)
|
||||
ObjectsWithTriggers.Add(component);
|
||||
if (component.gameObject is LivingEntity)
|
||||
{
|
||||
EntitiesWithMovements.Add(component);
|
||||
}
|
||||
}
|
||||
public void Deregister(CollisionComponent component)
|
||||
{
|
||||
if (ObjectsWithCollisions.Contains(component))
|
||||
ObjectsWithCollisions.Remove(component);
|
||||
if (ObjectsWithTriggers.Contains(component))
|
||||
ObjectsWithTriggers.Remove(component);
|
||||
if (component.gameObject is LivingEntity)
|
||||
{
|
||||
if (EntitiesWithMovements.Contains(component))
|
||||
EntitiesWithMovements.Remove(component);
|
||||
}
|
||||
}
|
||||
|
||||
public Player[] GetPlayersInZone(Rectangle rectangle)
|
||||
{
|
||||
|
||||
List<Player> players = new List<Player>();
|
||||
foreach (var item in AppManager.Instance.server.players)//фильтрация
|
||||
{
|
||||
if (item.collisionComponent.stopRectangle.SetOrigin(item.position).Intersects(rectangle))
|
||||
{
|
||||
players.Add(item);
|
||||
}
|
||||
}
|
||||
return players.ToArray();
|
||||
}
|
||||
|
||||
}
|
||||
public static class ExtentionClass
|
||||
|
|
|
@ -15,5 +15,6 @@ namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
|
|||
public int Id { get; set; }
|
||||
public bool Visibility { get; set; }
|
||||
public string Class { get; set; }
|
||||
public string Type { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,13 +33,13 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
|||
PropertyNameCaseInsensitive = true
|
||||
};
|
||||
TileMap tileMap =
|
||||
JsonSerializer.Deserialize<TileMap>(File.ReadAllText(string.Format(_templatePath, mapName)), options);
|
||||
JsonSerializer.Deserialize<TileMap>(File.ReadAllText(Path.Combine(AppContext.BaseDirectory, string.Format(_templatePath, mapName))), options);
|
||||
|
||||
// Загрузка TileSet-ов по TileSetInfo
|
||||
List<TileSet> tileSets = new List<TileSet>();
|
||||
foreach (TileSetInfo tileSetInfo in tileMap.TileSets)
|
||||
{
|
||||
TileSet tileSet = LoadTileSet(Path.Combine("Content", "MapData", "TileMaps", tileSetInfo.Source));
|
||||
TileSet tileSet = LoadTileSet(Path.Combine(AppContext.BaseDirectory, "Content", "MapData", "TileMaps", tileSetInfo.Source));
|
||||
tileSet.FirstGid = tileSetInfo.FirstGid;
|
||||
tileSets.Add(tileSet);
|
||||
}
|
||||
|
@ -47,51 +47,60 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
|||
|
||||
foreach (var layer in tileMap.Layers)
|
||||
{
|
||||
foreach (var chunk in layer.Chunks)
|
||||
if (layer.Type == "objectgroup")
|
||||
{
|
||||
for (int i = 0; i < chunk.Data.Length; i++)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var chunk in layer.Chunks)
|
||||
{
|
||||
foreach (var tileSet in tileSets)
|
||||
for (int i = 0; i < chunk.Data.Length; i++)
|
||||
{
|
||||
if (tileSet.FirstGid <= chunk.Data[i])
|
||||
foreach (var tileSet in tileSets)
|
||||
{
|
||||
int number = chunk.Data[i] - tileSet.FirstGid;
|
||||
|
||||
int relativeColumn = number % tileSet.Columns;
|
||||
int relativeRow = number / tileSet.Columns; // относительно левого угла чанка
|
||||
|
||||
Rectangle sourceRectangle = new Rectangle(relativeColumn * tileSet.TileWidth,
|
||||
relativeRow * tileSet.TileHeight,
|
||||
tileSet.TileWidth, tileSet.TileHeight);
|
||||
|
||||
Vector2 position = new Vector2(
|
||||
(i % chunk.Width) * tileSet.TileWidth + chunk.X * tileSet.TileWidth,
|
||||
(i / chunk.Height) * tileSet.TileHeight + chunk.Y * tileSet.TileHeight);
|
||||
|
||||
Tile tile = tileSet.Tiles[number]; // По факту может быть StopObjectom, но на уровне Tiled это все в первую очередь Tile
|
||||
|
||||
switch (tile.Type)
|
||||
if (tileSet.FirstGid <= chunk.Data[i])
|
||||
{
|
||||
case "Tile":
|
||||
AppManager.Instance.server.RegisterGameObject(new MapObject(position,
|
||||
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||
sourceRectangle,
|
||||
"Textures/TileSets/" +
|
||||
Path.GetFileName(tileSet.Image).Replace(".png", "")));
|
||||
break;
|
||||
case "StopObject":
|
||||
var collisionRectangles = LoadRectangles(tile); // Грузит коллизии обьектов
|
||||
AppManager.Instance.server.RegisterGameObject(new StopObject(position/4,//TODO
|
||||
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||
sourceRectangle,
|
||||
"Textures/TileSets/" +
|
||||
Path.GetFileName(tileSet.Image).Replace(".png", ""),
|
||||
collisionRectangles.ToArray()));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
int number = chunk.Data[i] - tileSet.FirstGid;
|
||||
|
||||
int relativeColumn = number % tileSet.Columns;
|
||||
int relativeRow = number / tileSet.Columns; // относительно левого угла чанка
|
||||
|
||||
Rectangle sourceRectangle = new Rectangle(relativeColumn * (tileSet.TileWidth + tileSet.Spacing) + tileSet.Margin,
|
||||
relativeRow * (tileSet.TileHeight + tileSet.Spacing) + tileSet.Margin,
|
||||
tileSet.TileWidth, tileSet.TileHeight);
|
||||
|
||||
Vector2 position = new Vector2(
|
||||
(i % chunk.Width) * tileMap.TileWidth + chunk.X * tileMap.TileWidth,
|
||||
(i / chunk.Height) * tileMap.TileHeight + chunk.Y * tileMap.TileHeight);
|
||||
|
||||
Tile tile = tileSet.Tiles[number]; // По факту может быть StopObjectom, но на уровне Tiled это все в первую очередь Tile
|
||||
string textureName = Path.Combine(AppContext.BaseDirectory, "Content", "Textures", "TileSetImages",
|
||||
Path.GetFileName(tileSet.Image).Replace(".png", ""));
|
||||
switch (tile.Type)
|
||||
{
|
||||
case "Tile":
|
||||
AppManager.Instance.server.RegisterGameObject(new MapObject(position,
|
||||
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||
sourceRectangle,
|
||||
textureName));
|
||||
break;
|
||||
|
||||
case "StopObject":
|
||||
var collisionRectangles = LoadRectangles(tile); // Грузит коллизии обьектов
|
||||
|
||||
AppManager.Instance.server.RegisterGameObject(new StopObject(position,
|
||||
new Vector2(tileSet.TileWidth, tileSet.TileHeight),
|
||||
sourceRectangle,
|
||||
textureName,
|
||||
collisionRectangles.ToArray()));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +135,7 @@ namespace ZoFo.GameCore.GameManagers.MapManager
|
|||
{
|
||||
if (tile.Objectgroup == null)
|
||||
{
|
||||
return new List<Rectangle>();
|
||||
return new List<Rectangle>() { new Rectangle(0, 0, 0, 0) };
|
||||
}
|
||||
|
||||
List<Rectangle> collisionRectangles = new List<Rectangle>();
|
||||
|
|
|
@ -107,6 +107,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
{
|
||||
/*string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
||||
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||
|
||||
foreach (var ip in ipList)
|
||||
{
|
||||
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||
|
@ -122,8 +123,8 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
{
|
||||
while(socket.Connected)
|
||||
{
|
||||
byte[] bytes = new byte[2048];
|
||||
var countAnsw = socket.Receive(bytes); //Вылетает если кто то закрыл
|
||||
byte[] bytes = new byte[65535];
|
||||
var countAnsw = socket.Receive(bytes, SocketFlags.Partial); //Вылетает если кто то закрыл
|
||||
string update = Encoding.UTF8.GetString(bytes, 0, countAnsw); // обновление отосланные сервером
|
||||
GetDataSent(update);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.SerializableDTO
|
||||
{
|
||||
public class SerializablePoint
|
||||
{
|
||||
public int X;
|
||||
public int Y;
|
||||
|
||||
public SerializablePoint(Point point) { X = point.X; Y = point.Y;}
|
||||
public Point GetPoint() { return new Point(X, Y);}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.SerializableDTO;
|
||||
|
||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.SerializableDTO
|
||||
{
|
||||
[Serializable]
|
||||
[JsonSerializable(typeof(SerializableRectangle))]
|
||||
public class SerializableRectangle
|
||||
{
|
||||
public SerializablePoint Size { get; set; }
|
||||
public SerializablePoint Location { get; set; }
|
||||
public int X { get; set; }
|
||||
public int Y { get; set; }
|
||||
public SerializableRectangle()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public SerializableRectangle(Rectangle rectangle) { X = rectangle.X; Y = rectangle.Y;
|
||||
Size = new SerializablePoint(rectangle.Size); Location = new SerializablePoint(rectangle.Location); }
|
||||
|
||||
public Rectangle GetRectangle()
|
||||
{
|
||||
return new Rectangle() { X = X, Y = Y, Size = Size.GetPoint(), Location = Location.GetPoint() };
|
||||
}
|
||||
}
|
||||
}
|
|
@ -51,17 +51,17 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static IPAddress GetIp()
|
||||
{
|
||||
{
|
||||
/*string hostName = Dns.GetHostName(); // Retrive the Name of HOST
|
||||
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||
var ipList = Dns.GetHostByName(hostName).AddressList;
|
||||
foreach (var ip in ipList)
|
||||
{
|
||||
if (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
|
||||
{
|
||||
return ip;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
return IPAddress.Parse("127.0.0.1");
|
||||
return IPAddress.Parse("127.0.0.1");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -79,15 +79,15 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
//Что это?
|
||||
//по 10 паков за раз TODO FIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXITFIXIT
|
||||
List<UpdateData> datasToSend = new List<UpdateData>();
|
||||
for (int i = 0; i < 5 && i<updates.Count; i++)
|
||||
for (int i = 0; i < 200 && i<updates.Count; i++)
|
||||
datasToSend.Add(updates[i]);
|
||||
string data = JsonSerializer.Serialize(datasToSend);
|
||||
var databytes = Encoding.UTF8.GetBytes(data);
|
||||
foreach (var item in clients)
|
||||
foreach (Socket socket in clients)
|
||||
{
|
||||
item.SendAsync(databytes);
|
||||
clients[0].SendAsync(databytes, SocketFlags.Partial);
|
||||
}
|
||||
for (int i = 0; i < 5 && i< datasToSend.Count; i++)
|
||||
for (int i = 0; i < 200 && i< datasToSend.Count; i++)
|
||||
updates.RemoveAt(0);
|
||||
}
|
||||
|
||||
|
@ -170,8 +170,8 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
|
|||
Socket client = (Socket)socket;
|
||||
while (client.Connected)
|
||||
{
|
||||
var buff = new byte[1024];
|
||||
var answ = client.Receive(buff);
|
||||
var buff = new byte[65535];
|
||||
var answ = client.Receive(buff, SocketFlags.Partial);
|
||||
string response = Encoding.UTF8.GetString(buff, 0, answ);
|
||||
GetDataSend(response);
|
||||
}
|
||||
|
|
|
@ -12,5 +12,6 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
|||
public class UpdateAnimation : UpdateData
|
||||
{
|
||||
public UpdateAnimation() { UpdateType = "UpdateAnimation"; }
|
||||
public string animationId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Threading.Tasks;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.SerializableDTO;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
|
||||
|
||||
namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
||||
|
@ -18,22 +19,9 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
|
|||
{
|
||||
public UpdateTileCreated() { UpdateType = "UpdateTileCreated"; }
|
||||
public Texture2D TextureTile { get; set; }
|
||||
public Vector2 Position { get; set; }
|
||||
public Point Size { get; set; }
|
||||
public Rectangle sourceRectangle { get; set; }
|
||||
public Vector2 Position { get; set; }
|
||||
public SerializablePoint Size { get; set; }
|
||||
public SerializableRectangle sourceRectangle { 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; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,15 +24,7 @@ namespace ZoFo.GameCore.GameManagers
|
|||
{
|
||||
//List<string> sounds = AppManager.Instance.Content.Load<List<string>>("sounds/");
|
||||
|
||||
string a = Path.Combine("Content", "sounds");
|
||||
string[] k;
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||
{
|
||||
k = Directory.GetFiles(Path.Combine("bin", "Debug", "net8.0", "Content", "sounds")).Where(x => x.EndsWith("xnb")).ToArray();
|
||||
}
|
||||
else{
|
||||
k = Directory.GetFiles(Path.Combine(Directory.GetCurrentDirectory(), "Content", "sounds")).Where(x => x.EndsWith("xnb")).ToArray();
|
||||
}
|
||||
string[] k = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "sounds")).Where(x => x.EndsWith("xnb")).ToArray();
|
||||
if (k.Length > 0)
|
||||
{
|
||||
|
||||
|
|
|
@ -14,11 +14,11 @@ namespace ZoFo.GameCore.GameObjects.Entities
|
|||
//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 override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "zombie_idle" }, "zombie_idle");
|
||||
|
||||
public EntittyForAnimationTests(Vector2 position) : base(position)
|
||||
{
|
||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*12, 16 * 16);
|
||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0,0,16*20, 16 * 20);
|
||||
position = new Vector2(10, 10);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Text;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ZoFo.GameCore.GameManagers;
|
||||
using ZoFo.GameCore.GameManagers.CollisionManager;
|
||||
|
||||
namespace ZoFo.GameCore.GameObjects.Entities
|
||||
|
@ -36,6 +37,23 @@ namespace ZoFo.GameCore.GameObjects.Entities
|
|||
Update();
|
||||
base.UpdateLogic();
|
||||
}
|
||||
|
||||
public void StartAnimation(string animationId)
|
||||
{
|
||||
(graphicsComponent as Graphics.AnimatedGraphicsComponent).StartAnimation(animationId);
|
||||
AppManager.Instance.server.AddData(new GameManagers.NetworkManager.Updates.ServerToClient.UpdateAnimation()
|
||||
{
|
||||
animationId = animationId,
|
||||
IdEntity = Id
|
||||
});
|
||||
|
||||
}
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
DrawDebugRectangle(spriteBatch, collisionComponent.stopRectangle.SetOrigin(position), Color.Orange);
|
||||
|
||||
base.Draw(spriteBatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ using ZoFo.GameCore.GameManagers.CollisionManager;
|
|||
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
|
||||
using ZoFo.GameCore.GameManagers;
|
||||
using ZoFo.GameCore.Graphics;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using ZoFo.GameCore.GUI;
|
||||
|
||||
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
||||
{
|
||||
|
@ -18,11 +20,19 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
{
|
||||
graphicsComponent.ObjectDrawRectangle.Width = 20;
|
||||
graphicsComponent.ObjectDrawRectangle.Height = 20;
|
||||
|
||||
collisionComponent.triggerRectangle = new Rectangle(0, 0, 20, 20);
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
DebugHUD.DebugLog("collected");
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("Ammo"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
}
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
DrawDebugRectangle(spriteBatch, collisionComponent.triggerRectangle.SetOrigin(position), Color.Blue);
|
||||
base.Draw(spriteBatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
{
|
||||
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("Antiradine"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
{
|
||||
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("BottleOfWater"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -11,7 +11,7 @@ public class Collectable : Interactable
|
|||
{
|
||||
}
|
||||
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
//
|
||||
AppManager.Instance.server.AddData(new UpdateLoot());
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
{
|
||||
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("Peeble"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
public PureBottleOfWater(Vector2 position) : base(position)
|
||||
{
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("PureBottleOfWater"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
{
|
||||
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("RottenFlesh"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
|
|||
public Steel(Vector2 position) : base(position)
|
||||
{
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("Steel"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -15,7 +15,7 @@ public class Wood : Collectable
|
|||
{
|
||||
|
||||
}
|
||||
public override void OnInteraction(object sender, CollisionComponent e)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateLoot("Wood"));
|
||||
AppManager.Instance.server.DeleteObject(this);
|
||||
|
|
|
@ -16,7 +16,7 @@ public class Door : Interactable
|
|||
//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)
|
||||
public override void OnInteraction(GameObject sender)
|
||||
{
|
||||
//graphicsComponent.AnimationSelect("DoorInteraction", isOpened);
|
||||
//graphicsComponent.AnimationStep();
|
||||
|
|
|
@ -13,17 +13,19 @@ public class Interactable : Entity
|
|||
|
||||
public Interactable(Vector2 position) : base(position)
|
||||
{
|
||||
collisionComponent.OnTriggerEnter += (sender, e) => ChangeInteraction(sender, e, true);
|
||||
collisionComponent.OnTriggerExit += (sender, e) => ChangeInteraction(sender, e, false);
|
||||
collisionComponent.isTrigger = true;
|
||||
collisionComponent.hasCollision = false;
|
||||
collisionComponent.OnTriggerEnter += (sender) => ChangeInteraction(sender, true);
|
||||
collisionComponent.OnTriggerExit += (sender) => ChangeInteraction(sender, false);
|
||||
collisionComponent.OnTriggerZone += OnInteraction;
|
||||
}
|
||||
|
||||
private void ChangeInteraction(object sender, CollisionComponent e, bool isReady)
|
||||
private void ChangeInteraction(GameObject sender, bool isReady)
|
||||
{
|
||||
AppManager.Instance.server.AddData(new UpdateInteractionReady((sender as Player).Id, isReady));
|
||||
}
|
||||
|
||||
public virtual void OnInteraction(object sender, CollisionComponent e)
|
||||
public virtual void OnInteraction(GameObject sender)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -11,12 +11,12 @@ namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies
|
|||
{
|
||||
class Zombie : Enemy
|
||||
{
|
||||
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent("Textures/icons/8");
|
||||
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "zombie_damaged","zombie_walk","zombie_idle","zombie_attack","zombie_death" }, "zombie_walk");
|
||||
public Zombie(Vector2 position) : base(position)
|
||||
{
|
||||
health = 5;
|
||||
speed =5;
|
||||
collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100);
|
||||
health = 5;
|
||||
speed =2;
|
||||
collisionComponent.stopRectangle = new Rectangle(0, 0, 52, 100);
|
||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 100, 100);
|
||||
}
|
||||
|
||||
|
@ -25,13 +25,18 @@ namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies
|
|||
Vector2 duration = Vector2.Normalize(
|
||||
AppManager.Instance.server.players[0].position - position
|
||||
);
|
||||
velocity=new Vector2(duration.X * speed, duration.Y*speed);
|
||||
if(position.X>595 && 605>position.X && position.Y>495 && 505>position.Y)
|
||||
velocity+=new Vector2(duration.X * speed, duration.Y*speed);
|
||||
if (Random.Shared.NextDouble() > 0.9)
|
||||
{
|
||||
velocity = Vector2.Zero;
|
||||
|
||||
StartAnimation("zombie_damaged");
|
||||
}
|
||||
//position.X += velocity.X*t;
|
||||
//position.Y += velocity.Y * t;
|
||||
if (Random.Shared.NextDouble() > 0.9)
|
||||
{
|
||||
|
||||
StartAnimation("zombie_idle");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ public class LivingEntity : Entity
|
|||
public LivingEntity(Vector2 position) : base(position)
|
||||
{
|
||||
inputManager = new InputManager();
|
||||
collisionComponent.hasCollision = true;
|
||||
}
|
||||
|
||||
public override GraphicsComponent graphicsComponent { get; } = null;
|
||||
|
@ -34,7 +35,21 @@ public class LivingEntity : Entity
|
|||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
public override void UpdateAnimations()
|
||||
{
|
||||
base.UpdateAnimations();
|
||||
}
|
||||
Vector2 prevPosition_forClient;
|
||||
public override void Draw(SpriteBatch spriteBatch)
|
||||
{
|
||||
if ((position - prevPosition_forClient).X< 0)
|
||||
graphicsComponent.Flip = SpriteEffects.FlipHorizontally;
|
||||
else if((position - prevPosition_forClient).X > 0)
|
||||
graphicsComponent.Flip = SpriteEffects.None;
|
||||
base.Draw(spriteBatch);
|
||||
prevPosition_forClient = position;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -27,10 +27,12 @@ public class Player : LivingEntity
|
|||
public Player(Vector2 position) : base(position)
|
||||
{
|
||||
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 100, 100);
|
||||
collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100);
|
||||
collisionComponent.stopRectangle = new Rectangle(0, 0, 100, 100);
|
||||
speed = 10;
|
||||
//isTryingToInteract = false;
|
||||
//IsTryingToShoot = false;
|
||||
//IsTryingToShoot = false;
|
||||
|
||||
StartAnimation("player_look_down");
|
||||
}
|
||||
|
||||
|
||||
|
@ -39,9 +41,9 @@ public class Player : LivingEntity
|
|||
|
||||
MovementLogic();
|
||||
}
|
||||
public void MovementLogic()
|
||||
public void MovementLogic()
|
||||
{
|
||||
velocity = InputPlayerRotation * speed;
|
||||
velocity = InputPlayerRotation * speed;
|
||||
}
|
||||
public void HandleNewInput(UpdateInput updateInput)
|
||||
{
|
||||
|
|
|
@ -83,8 +83,6 @@ public abstract class GameObject
|
|||
{
|
||||
graphicsComponent.Draw(graphicsComponent.ObjectDrawRectangle, spriteBatch);
|
||||
//debug
|
||||
DrawDebugRectangle(spriteBatch, graphicsComponent.ObjectDrawRectangle);
|
||||
|
||||
if (AppManager.Instance.InputManager.CollisionsCheat)
|
||||
DrawDebugRectangle(spriteBatch, graphicsComponent.ObjectDrawRectangle);
|
||||
|
||||
|
|
|
@ -20,13 +20,10 @@ public class StopObject : MapObject
|
|||
{
|
||||
collisionComponents[i] = new CollisionComponent(this, true, new Rectangle(0,0, (int)size.X, (int)size.Y)/*collisions[i]*/);
|
||||
}
|
||||
//REDO
|
||||
// TODO: Написать коллизию, пусть тразмер будет чисто таким же как и текстурка.
|
||||
// Поменяйте уровень защиты конструктора, после снимите в 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));
|
||||
DrawDebugRectangle(spriteBatch, new Rectangle((int)position.X, (int)position.Y, collisionComponents[0].stopRectangle.Width, collisionComponents[0].stopRectangle.Height));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -125,8 +125,9 @@ namespace ZoFo.GameCore.Graphics
|
|||
|
||||
buildSourceRectangle();
|
||||
SetInterval();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void StopAnimation()
|
||||
{
|
||||
currentFrame = 0;
|
||||
|
@ -163,6 +164,7 @@ namespace ZoFo.GameCore.Graphics
|
|||
}
|
||||
|
||||
interval--;
|
||||
|
||||
}
|
||||
|
||||
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch)
|
||||
|
@ -187,8 +189,9 @@ namespace ZoFo.GameCore.Graphics
|
|||
destinationRectangle.Y -= CameraPosition.Y;
|
||||
|
||||
destinationRectangle = Scaling(destinationRectangle);
|
||||
_spriteBatch.Draw(texture,
|
||||
destinationRectangle, sourceRectangle, Color.White);
|
||||
|
||||
_spriteBatch.Draw(texture, destinationRectangle, sourceRectangle, Color.White, Rotation,
|
||||
Vector2.Zero, Flip, 0);
|
||||
}
|
||||
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)
|
||||
{
|
||||
|
@ -213,7 +216,8 @@ namespace ZoFo.GameCore.Graphics
|
|||
|
||||
destinationRectangle = Scaling(destinationRectangle);
|
||||
_spriteBatch.Draw(texture,
|
||||
destinationRectangle, sourceRectangle, Color.White);
|
||||
destinationRectangle, sourceRectangle, Color.White, 0,
|
||||
Vector2.Zero, Flip, 0);
|
||||
}
|
||||
private void buildSourceRectangle()
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace ZoFo.GameCore.Graphics
|
|||
public void LoadAnimations()
|
||||
{
|
||||
Animations = new List<AnimationContainer>();
|
||||
string[] animationFilesNames = Directory.GetFiles("Content/Textures/Animations");
|
||||
string[] animationFilesNames = Directory.GetFiles(Path.Combine(AppContext.BaseDirectory, "Content", "Textures", "Animations"));
|
||||
|
||||
StreamReader reader;
|
||||
foreach (var fileName in animationFilesNames)
|
||||
|
|
|
@ -9,6 +9,9 @@ public abstract class GraphicsComponent
|
|||
public static int scaling = 1;
|
||||
public string mainTextureName;//TODO костыль - пофиксить
|
||||
|
||||
public SpriteEffects Flip = SpriteEffects.None;
|
||||
public float Rotation;
|
||||
|
||||
public abstract void LoadContent();
|
||||
public abstract void Update();
|
||||
public abstract void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch);
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
|
||||
namespace ZoFo.GameCore.Graphics;
|
||||
|
||||
public interface IGraphicsComponent
|
||||
{
|
||||
public Rectangle ObjectDrawRectangle { get; set; }
|
||||
public static int scaling = 1;
|
||||
public string mainTextureName { get; set; }//TODO костыль - пофиксить
|
||||
|
||||
public abstract void LoadContent();
|
||||
public abstract void Update();
|
||||
public abstract void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch);
|
||||
public abstract void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle);
|
||||
}
|
|
@ -8,7 +8,6 @@ using ZoFo.GameCore.GUI;
|
|||
|
||||
namespace ZoFo.GameCore.Graphics
|
||||
{
|
||||
|
||||
public class StaticGraphicsComponent : GraphicsComponent
|
||||
{
|
||||
private Texture2D texture;
|
||||
|
@ -18,7 +17,7 @@ namespace ZoFo.GameCore.Graphics
|
|||
{
|
||||
LoadContent();
|
||||
}
|
||||
|
||||
|
||||
public StaticGraphicsComponent(string textureName)
|
||||
{
|
||||
BuildComponent(textureName);
|
||||
|
@ -29,7 +28,7 @@ namespace ZoFo.GameCore.Graphics
|
|||
{
|
||||
_textureName = textureName;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override void LoadContent()
|
||||
{
|
||||
|
@ -37,7 +36,7 @@ namespace ZoFo.GameCore.Graphics
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
texture = AppManager.Instance.Content.Load<Texture2D>(_textureName);
|
||||
}
|
||||
|
||||
|
@ -48,24 +47,28 @@ namespace ZoFo.GameCore.Graphics
|
|||
|
||||
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch)
|
||||
{
|
||||
DebugHUD.Instance.Log("draw ");
|
||||
//DebugHUD.Instance.Log("draw ");
|
||||
|
||||
destinationRectangle.X -= CameraPosition.X;
|
||||
destinationRectangle.Y -= CameraPosition.Y;
|
||||
destinationRectangle = Scaling(destinationRectangle);
|
||||
_spriteBatch.Draw(texture, destinationRectangle, Color.White);
|
||||
_spriteBatch.Draw(texture, destinationRectangle, texture.Bounds, Color.White, Rotation,
|
||||
Vector2.Zero, Flip, 0);
|
||||
}
|
||||
|
||||
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)
|
||||
{
|
||||
DebugHUD.Instance.Log("draw ");
|
||||
{
|
||||
//DebugHUD.Instance.Log("draw ");
|
||||
// Uncomment to go brrrr
|
||||
//Rotation = new Random().Next(1, 365);
|
||||
|
||||
destinationRectangle.X -= CameraPosition.X;
|
||||
destinationRectangle.Y -= CameraPosition.Y;
|
||||
|
||||
destinationRectangle = Scaling(destinationRectangle);
|
||||
_spriteBatch.Draw(texture,
|
||||
destinationRectangle, sourceRectangle, Color.White);
|
||||
destinationRectangle, sourceRectangle, Color.White, Rotation,
|
||||
Vector2.Zero, Flip, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
|
|||
using ZoFo.GameCore.GameObjects.MapObjects;
|
||||
using ZoFo.GameCore.GameObjects.MapObjects.StopObjects;
|
||||
using ZoFo.GameCore.Graphics;
|
||||
using ZoFo.GameCore.GameManagers.NetworkManager.SerializableDTO;
|
||||
|
||||
namespace ZoFo.GameCore
|
||||
{
|
||||
|
@ -165,7 +166,7 @@ namespace ZoFo.GameCore
|
|||
{
|
||||
go.UpdateLogic();
|
||||
}
|
||||
collisionManager.UpdatePositions();
|
||||
collisionManager.ResolvePhysics();
|
||||
ticks = 0;
|
||||
networkManager.SendData();
|
||||
}
|
||||
|
@ -182,30 +183,13 @@ namespace ZoFo.GameCore
|
|||
{
|
||||
|
||||
gameObjects.Add(gameObject);
|
||||
if (gameObject is StopObject)
|
||||
{
|
||||
AddData(new UpdateStopObjectCreated()
|
||||
{
|
||||
Position = (gameObject as StopObject).position,
|
||||
sourceRectangle = (gameObject as StopObject).sourceRectangle,
|
||||
Size = (gameObject as StopObject).graphicsComponent.ObjectDrawRectangle.Size,
|
||||
collisions = (gameObject as StopObject).collisionComponents.Select(x=>x.stopRectangle).ToArray(),
|
||||
tileSetName = ((gameObject as StopObject).graphicsComponent as StaticGraphicsComponent)._textureName
|
||||
});//TODO
|
||||
foreach (var item in (gameObject as StopObject).collisionComponents)
|
||||
{
|
||||
collisionManager.Register(item);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (gameObject is MapObject)
|
||||
{
|
||||
AddData(new UpdateTileCreated()
|
||||
{
|
||||
Position = (gameObject as MapObject).position,
|
||||
sourceRectangle = (gameObject as MapObject).sourceRectangle,
|
||||
Size = (gameObject as MapObject).graphicsComponent.ObjectDrawRectangle.Size,
|
||||
sourceRectangle = new SerializableRectangle((gameObject as MapObject).sourceRectangle),
|
||||
Size = new SerializablePoint((gameObject as MapObject).graphicsComponent.ObjectDrawRectangle.Size),
|
||||
tileSetName = ((gameObject as MapObject).graphicsComponent as StaticGraphicsComponent)._textureName
|
||||
});//TODO
|
||||
return;
|
||||
|
@ -238,12 +222,18 @@ namespace ZoFo.GameCore
|
|||
/// Удаляет игровой объект
|
||||
/// </summary>
|
||||
/// <param name="gameObject"></param>
|
||||
public void DeleteObject(GameObject gameObject)
|
||||
public void DeleteObject(Entity entity)
|
||||
{
|
||||
gameObjects.Remove(gameObject);
|
||||
if (gameObjects.Contains(entity))
|
||||
gameObjects.Remove(entity);
|
||||
if (entities.Contains(entity))
|
||||
entities.Remove(entity);
|
||||
if (players.Contains(entity))
|
||||
players.Remove(entity as Player);
|
||||
AddData(new UpdateGameObjectDeleted()
|
||||
{ GameObjectType = gameObject.GetType().Name}
|
||||
{ GameObjectType = entity.GetType().Name, IdEntity = entity .Id}
|
||||
);
|
||||
collisionManager.Deregister(entity.collisionComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|