Merge branch 'DevelopmentX' into GUIHUD

This commit is contained in:
SergoDobro 2024-08-20 05:17:43 +03:00 committed by GitHub
commit d9ae6c395d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
53 changed files with 5629 additions and 1995 deletions

View file

@ -44,6 +44,9 @@
#begin MapData/TileMaps/main.tmj
/copy:MapData/TileMaps/main.tmj
#begin MapData/TileSets/bonfire.tsj
/copy:MapData/TileSets/bonfire.tsj
#begin MapData/TileSets/IconSet.tsj
/copy:MapData/TileSets/IconSet.tsj
@ -1469,6 +1472,18 @@
/processorParam:TextureFormat=Color
/build:Textures/Test/wood.jpg
#begin Textures/TileSetImages/Campfire.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/Campfire.png
#begin Textures/TileSetImages/Pipes.png
/importer:TextureImporter
/processor:TextureProcessor

View file

@ -1,78 +1,26 @@
{
"Map/SizeTest": {
"height": 4300,
"width": 2
},
"activeFile": "TileMaps/main.tmj",
"expandedProjectPaths": [
".",
"TileSets",
"TileMaps"
],
"fileStates": {
"": {
"scaleInDock": 1
},
"TileMaps/TileSets/TileSet 1.tsj": {
"scaleInDock": 1
},
"TileMaps/main.tmj": {
"scale": 0.33,
"selectedLayer": 1,
"selectedLayer": 0,
"viewCenter": {
"x": 1010.6060606060606,
"y": 553.0303030303031
"x": -463.63636363636374,
"y": 300
}
},
"TileMaps/main.tmj#IconSet": {
"dynamicWrapping": true,
"scaleInEditor": 1
},
"TileSets/CollisionTileSet.tsj": {
"scaleInDock": 0.75,
"scaleInEditor": 1
},
"TileSets/IconSet.tsj": {
"dynamicWrapping": true
},
"TileSets/TileSet 1.tsj": {
"dynamicWrapping": false,
"scaleInDock": 1,
"scaleInEditor": 1.5
"scaleInDock": 1
},
"TileSets/TilesetNature.tsj": {
"dynamicWrapping": false
"scaleInDock": 1
},
"TileSets/WallSet.tsj": {
"scaleInDock": 1,
"scaleInEditor": 1
"scaleInDock": 1.5
},
"TileSets/tileset 1 collision.tsj": {
"dynamicWrapping": false,
"scaleInDock": 1
}
},
"last.imagePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/Textures/icons",
"last.objectTemplatePath": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/MapData/Templates",
"openFiles": [
"TileSets/TileSet 1.tsj",
"TileMaps/main.tmj"
],
"project": "MapSession.tiled-project",
"recentFiles": [
"TileSets/TileSet 1.tsj",
"TileMaps/main.tmj",
"TileSets/CollisionTileSet.tsj",
"TileSets/WallSet.tsj"
],
"stampsFolder": "D:/C#/Я смотрел ваши ХАКАТОНЫ/ZoFo/ZoFo/Content/MapData/TileStamps",
"tileset.embedInMap": false,
"tileset.lastUsedFormat": "json",
"tileset.margin": 0,
"tileset.spacing": 0,
"tileset.tileSize": {
"height": 16,
"width": 16
},
"tileset.type": 1
}
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -12,7 +12,7 @@
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
"source":"..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -9,10 +9,9 @@
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/TileSets\/IconSet.tsj"
},
"tileset": {
"firstgid": 1,
"source": "..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

View file

@ -0,0 +1,18 @@
{ "object":
{
"gid":8,
"height":16,
"id":1,
"name":"Zombie",
"rotation":0,
"type":"",
"visible":true,
"width":16
},
"tileset":
{
"firstgid":1,
"source":"..\/..\/TileSets\/IconSet.tsj"
},
"type":"template"
}

File diff suppressed because it is too large Load diff

View file

@ -8,51 +8,57 @@
"margin":0,
"name":"IconSet",
"spacing":0,
"tilecount":7,
"tilecount":8,
"tiledversion":"1.10.2",
"tileheight":1200,
"tiles":[
{
"id":0,
"image":"..\/..\/Textures\/icons\/Collectables\/ammunition.png",
"image":"..\/..\/Textures\/icons\/Collectables\/Ammo.png",
"imageheight":512,
"imagewidth":512
},
{
"id":1,
"image":"..\/..\/Textures\/icons\/Collectables\/Blue Potion.png",
"image":"..\/..\/Textures\/icons\/Collectables\/PureBottleOfWater.png",
"imageheight":32,
"imagewidth":32
},
{
"id":2,
"image":"..\/..\/Textures\/icons\/Collectables\/Water Bottle.png",
"image":"..\/..\/Textures\/icons\/Collectables\/BottleOfWater.png",
"imageheight":32,
"imagewidth":32
},
{
"id":3,
"image":"..\/..\/Textures\/icons\/Collectables\/Wood Log.png",
"image":"..\/..\/Textures\/icons\/Collectables\/Wood.png",
"imageheight":32,
"imagewidth":32
},
{
"id":4,
"image":"..\/..\/Textures\/icons\/Collectables\/Silver Ingot.png",
"image":"..\/..\/Textures\/icons\/Collectables\/Steel.png",
"imageheight":32,
"imagewidth":32
},
{
"id":5,
"image":"..\/..\/Textures\/icons\/Collectables\/Monster Meat.png",
"image":"..\/..\/Textures\/icons\/Collectables\/RottenFlesh.png",
"imageheight":32,
"imagewidth":32
},
{
"id":6,
"image":"..\/..\/Textures\/icons\/Collectables\/Stone.png",
"image":"..\/..\/Textures\/icons\/Collectables\/Peeble.png",
"imageheight":1200,
"imagewidth":1200
},
{
"id":7,
"image":"..\/..\/Textures\/icons\/zombie_218153.png",
"imageheight":512,
"imagewidth":512
}],
"tilewidth":1200,
"type":"tileset",

View file

@ -8,13 +8,13 @@
"width":24
},
"image":"..\/..\/Textures\/TileSetImages\/TilesetFloor.png",
"imageheight":417,
"imageheight":464,
"imagewidth":352,
"margin":0,
"name":"TileSet 1",
"objectalignment":"topleft",
"spacing":0,
"tilecount":572,
"tilecount":638,
"tiledversion":"1.10.2",
"tileheight":16,
"tiles":[
@ -2314,6 +2314,270 @@
{
"id":571,
"type":"Tile"
},
{
"id":572,
"type":"Tile"
},
{
"id":573,
"type":"Tile"
},
{
"id":574,
"type":"Tile"
},
{
"id":575,
"type":"Tile"
},
{
"id":576,
"type":"Tile"
},
{
"id":577,
"type":"Tile"
},
{
"id":578,
"type":"Tile"
},
{
"id":579,
"type":"Tile"
},
{
"id":580,
"type":"Tile"
},
{
"id":581,
"type":"Tile"
},
{
"id":582,
"type":"Tile"
},
{
"id":583,
"type":"Tile"
},
{
"id":584,
"type":"Tile"
},
{
"id":585,
"type":"Tile"
},
{
"id":586,
"type":"Tile"
},
{
"id":587,
"type":"Tile"
},
{
"id":588,
"type":"Tile"
},
{
"id":589,
"type":"Tile"
},
{
"id":590,
"type":"Tile"
},
{
"id":591,
"type":"Tile"
},
{
"id":592,
"type":"Tile"
},
{
"id":593,
"type":"Tile"
},
{
"id":594,
"type":"Tile"
},
{
"id":595,
"type":"Tile"
},
{
"id":596,
"type":"Tile"
},
{
"id":597,
"type":"Tile"
},
{
"id":598,
"type":"Tile"
},
{
"id":599,
"type":"Tile"
},
{
"id":600,
"type":"Tile"
},
{
"id":601,
"type":"Tile"
},
{
"id":602,
"type":"Tile"
},
{
"id":603,
"type":"Tile"
},
{
"id":604,
"type":"Tile"
},
{
"id":605,
"type":"Tile"
},
{
"id":606,
"type":"Tile"
},
{
"id":607,
"type":"Tile"
},
{
"id":608,
"type":"Tile"
},
{
"id":609,
"type":"Tile"
},
{
"id":610,
"type":"Tile"
},
{
"id":611,
"type":"Tile"
},
{
"id":612,
"type":"Tile"
},
{
"id":613,
"type":"Tile"
},
{
"id":614,
"type":"Tile"
},
{
"id":615,
"type":"Tile"
},
{
"id":616,
"type":"Tile"
},
{
"id":617,
"type":"Tile"
},
{
"id":618,
"type":"Tile"
},
{
"id":619,
"type":"Tile"
},
{
"id":620,
"type":"Tile"
},
{
"id":621,
"type":"Tile"
},
{
"id":622,
"type":"Tile"
},
{
"id":623,
"type":"Tile"
},
{
"id":624,
"type":"Tile"
},
{
"id":625,
"type":"Tile"
},
{
"id":626,
"type":"Tile"
},
{
"id":627,
"type":"Tile"
},
{
"id":628,
"type":"Tile"
},
{
"id":629,
"type":"Tile"
},
{
"id":630,
"type":"Tile"
},
{
"id":631,
"type":"Tile"
},
{
"id":632,
"type":"Tile"
},
{
"id":633,
"type":"Tile"
},
{
"id":634,
"type":"Tile"
},
{
"id":635,
"type":"Tile"
},
{
"id":636,
"type":"Tile"
},
{
"id":637,
"type":"Tile"
}],
"tilewidth":16,
"type":"tileset",
@ -2332,8 +2596,20 @@
"name":"SandStone",
"probability":0.3,
"tile":110
},
{
"color":"#0000ff",
"name":"LightGrass",
"probability":1,
"tile":265
},
{
"color":"#ff7700",
"name":"Dirt",
"probability":1,
"tile":177
}],
"name":"\u041f\u0435\u0441\u0447\u0430\u043d\u044b\u0439",
"name":"\u0411\u0438\u043e\u043c\u043d\u044b\u0439",
"tile":-1,
"type":"corner",
"wangtiles":[
@ -2424,6 +2700,228 @@
{
"tileid":114,
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
},
{
"tileid":154,
"wangid":[0, 3, 0, 4, 0, 3, 0, 3]
},
{
"tileid":155,
"wangid":[0, 3, 0, 4, 0, 4, 0, 3]
},
{
"tileid":156,
"wangid":[0, 3, 0, 3, 0, 4, 0, 3]
},
{
"tileid":163,
"wangid":[0, 3, 0, 4, 0, 3, 0, 4]
},
{
"tileid":176,
"wangid":[0, 4, 0, 4, 0, 3, 0, 3]
},
{
"tileid":177,
"wangid":[0, 4, 0, 4, 0, 4, 0, 4]
},
{
"tileid":178,
"wangid":[0, 3, 0, 3, 0, 4, 0, 4]
},
{
"tileid":181,
"wangid":[0, 4, 0, 3, 0, 4, 0, 4]
},
{
"tileid":182,
"wangid":[0, 4, 0, 4, 0, 3, 0, 4]
},
{
"tileid":185,
"wangid":[0, 4, 0, 3, 0, 4, 0, 3]
},
{
"tileid":198,
"wangid":[0, 4, 0, 3, 0, 3, 0, 3]
},
{
"tileid":199,
"wangid":[0, 4, 0, 3, 0, 3, 0, 4]
},
{
"tileid":200,
"wangid":[0, 3, 0, 3, 0, 3, 0, 4]
},
{
"tileid":203,
"wangid":[0, 3, 0, 4, 0, 4, 0, 4]
},
{
"tileid":204,
"wangid":[0, 4, 0, 4, 0, 4, 0, 3]
},
{
"tileid":242,
"wangid":[0, 4, 0, 4, 0, 4, 0, 4]
},
{
"tileid":243,
"wangid":[0, 4, 0, 4, 0, 4, 0, 4]
},
{
"tileid":244,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":245,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":264,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":265,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":266,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":267,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":268,
"wangid":[0, 3, 0, 3, 0, 3, 0, 3]
},
{
"tileid":578,
"wangid":[0, 3, 0, 2, 0, 3, 0, 3]
},
{
"tileid":579,
"wangid":[0, 3, 0, 2, 0, 2, 0, 3]
},
{
"tileid":580,
"wangid":[0, 3, 0, 3, 0, 2, 0, 3]
},
{
"tileid":581,
"wangid":[0, 2, 0, 3, 0, 2, 0, 2]
},
{
"tileid":582,
"wangid":[0, 2, 0, 2, 0, 3, 0, 2]
},
{
"tileid":600,
"wangid":[0, 2, 0, 2, 0, 3, 0, 3]
},
{
"tileid":601,
"wangid":[0, 2, 0, 2, 0, 2, 0, 2]
},
{
"tileid":602,
"wangid":[0, 3, 0, 3, 0, 2, 0, 2]
},
{
"tileid":603,
"wangid":[0, 3, 0, 2, 0, 2, 0, 2]
},
{
"tileid":604,
"wangid":[0, 2, 0, 2, 0, 2, 0, 3]
},
{
"tileid":622,
"wangid":[0, 2, 0, 3, 0, 3, 0, 3]
},
{
"tileid":623,
"wangid":[0, 2, 0, 3, 0, 3, 0, 2]
},
{
"tileid":624,
"wangid":[0, 3, 0, 3, 0, 3, 0, 2]
}]
},
{
"colors":[
{
"color":"#ff0000",
"name":"",
"probability":1,
"tile":264
}],
"name":"\u0422\u0440\u0430\u0432\u0430",
"tile":244,
"type":"corner",
"wangtiles":[
{
"tileid":244,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":245,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":264,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":265,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":266,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":267,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":268,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
}]
},
{
"colors":[
{
"color":"#ff0000",
"name":"",
"probability":1,
"tile":110
}],
"name":"\u041f\u0435\u0441\u0447\u0430\u043d\u0438\u043a",
"tile":111,
"type":"corner",
"wangtiles":[
{
"tileid":110,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":111,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":112,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":113,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
},
{
"tileid":114,
"wangid":[0, 1, 0, 1, 0, 1, 0, 1]
}]
}]
}

View file

@ -0,0 +1,102 @@
{ "columns":4,
"image":"..\/..\/Textures\/TileSetImages\/Campfire.png",
"imageheight":32,
"imagewidth":128,
"margin":0,
"name":"bonfire",
"spacing":0,
"tilecount":22,
"tiledversion":"1.10.2",
"tileheight":32,
"tiles":[
{
"animation":[
{
"duration":250,
"tileid":0
},
{
"duration":250,
"tileid":1
},
{
"duration":250,
"tileid":2
},
{
"duration":250,
"tileid":3
}],
"id":0,
"type":"StopObject"
},
{
"id":1,
"type":"StopObject"
},
{
"id":2,
"type":"StopObject"
},
{
"id":3,
"type":"StopObject"
},
{
"id":4
},
{
"id":7
},
{
"id":8
},
{
"id":9
},
{
"id":10
},
{
"id":11
},
{
"id":12
},
{
"id":13
},
{
"id":14
},
{
"id":20
},
{
"id":16
},
{
"id":17
},
{
"id":18
},
{
"id":19
},
{
"id":21
},
{
"id":5
},
{
"id":6
},
{
"id":15
}],
"tilewidth":32,
"type":"tileset",
"version":"1.10"
}

View file

@ -6,7 +6,7 @@
"name":"tileset 1 collision",
"spacing":0,
"tilecount":240,
"tiledversion":"1.10.2",
"tiledversion":"1.11.0",
"tileheight":16,
"tiles":[
{
@ -105,7 +105,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -133,7 +132,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -161,7 +159,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -189,7 +186,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -217,7 +213,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -245,7 +240,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -273,7 +267,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -301,7 +294,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -329,7 +321,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -357,7 +348,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -385,7 +375,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -449,7 +438,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -477,7 +465,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -505,7 +492,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -533,7 +519,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -561,7 +546,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -589,7 +573,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -617,7 +600,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -645,7 +627,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -673,7 +654,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -701,7 +681,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -729,7 +708,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -861,7 +839,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -889,7 +866,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -917,7 +893,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -1013,7 +988,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -1041,7 +1015,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -1069,7 +1042,6 @@
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
@ -1386,10 +1358,56 @@
},
{
"id":173,
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
"height":16,
"id":1,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":0,
"y":0
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
"type":"StopObject"
},
{
"id":174,
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
"height":16,
"id":1,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":0,
"y":0
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
"type":"StopObject"
},
{
@ -1466,10 +1484,56 @@
},
{
"id":193,
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
"height":16,
"id":1,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":0,
"y":0
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
"type":"StopObject"
},
{
"id":194,
"objectgroup":
{
"draworder":"index",
"id":2,
"name":"",
"objects":[
{
"height":16,
"id":1,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":16,
"x":0,
"y":0
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
},
"type":"StopObject"
},
{

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
{"name":"Flowers","variations":[{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjZGRgAAAAKwAL","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjYmRgAAAALwAM","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjZmRgAAAAMwAN","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjYWRgAAAANwAO","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjZWRgAAAAOwAP","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjY2RgAAAAPwAQ","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1},{"map":{"compressionlevel":-1,"height":1,"infinite":false,"layers":[{"compression":"zlib","data":"eJzjZ2RgAAAAQwAR","encoding":"base64","height":1,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":1,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":1},"probability":1}]}

View file

@ -0,0 +1 @@
{"name":"Green Trees","variations":[{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJwzZWBgMANicyC2AGJfIPYDYn8gDgDiVCBOA+J0IM4AYgBToAOv","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/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1},{"map":{"compressionlevel":-1,"height":2,"infinite":false,"layers":[{"compression":"zlib","data":"eJxjZGBgYAJiSSCWAmIAAWgANw==","encoding":"base64","height":2,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":2,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":2},"probability":1},{"map":{"compressionlevel":-1,"height":2,"infinite":false,"layers":[{"compression":"zlib","data":"eJw7zsDAcAKI7wPxAyAGACBYA08=","encoding":"base64","height":2,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":2,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":2},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJzbwsjAsBWItwHxGSA+C8TngPgJED8F4mdADACKGwc/","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/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":3},"probability":1},{"map":{"compressionlevel":-1,"height":2,"infinite":false,"layers":[{"compression":"zlib","data":"eJwTZGBgEAJiTSDWAmIAA+gAdw==","encoding":"base64","height":2,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":2,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":2},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJwNwwcNACAMALBZ45iAYYLjP7RJS0RUm93hNF1uj9fnB2JABD8=","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/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1},{"map":{"compressionlevel":-1,"height":3,"infinite":false,"layers":[{"compression":"zlib","data":"eJwNwwcNACAMALCZ45iAYYIjnzZpiYhqszucpsvt8fr8ZyAEbw==","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/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1},{"map":{"compressionlevel":-1,"height":2,"infinite":false,"layers":[{"compression":"zlib","data":"eJwTZmBgEAFibSDWAWIABDgAfw==","encoding":"base64","height":2,"id":1,"name":"","opacity":1,"type":"tilelayer","visible":true,"width":2,"x":0,"y":0}],"nextlayerid":2,"nextobjectid":1,"orientation":"orthogonal","renderorder":"right-down","tiledversion":"1.10.2","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/TilesetNature.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":2},"probability":1}]}

View file

@ -1 +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}]}
{"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.11.0","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.11.0","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.11.0","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.11.0","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.11.0","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":5,"infinite":false,"layers":[{"compression":"zlib","data":"eJwNwwsRgCAUALBXXqGCQgXQCooV/MRxu9sUEbPJ7OJqsdrsbu4eng4vbx9fP38Kng2j","encoding":"base64","height":5,"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.11.0","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":5,"infinite":false,"layers":[{"compression":"zlib","data":"eJwNwwsRgCAUALBXWqGCQgXQCooV/MRyu9sUEbPJ7OJqsdrsbu4eng4vbx9fP3/WDwxj","encoding":"base64","height":5,"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.11.0","tileheight":16,"tilesets":[{"firstgid":1,"source":"../TileSets/tileset 1 collision.tsj"}],"tilewidth":16,"type":"map","version":"1.10","width":4},"probability":1}]}

View file

@ -1 +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"}
{"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":false,"offset":"0, 0"}

View file

@ -1 +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"}
{"id":"zombie_walk","textureName":"Textures/AnimationTextures/Zombie/zombie_spritesheet_v1","startSpriteRectangle":{"X":0,"Y":32,"Width":32,"Height":32},"frameSecond":[{"Item1":0,"Item2":30}],"textureFrameInterval":0,"framesCount":8,"isCycle":true,"offset":"0, 0"}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -23,7 +23,6 @@ using System.Web;
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;
@ -50,17 +49,17 @@ namespace ZoFo.GameCore
networkManager.AddData(new UpdateInput()
{
InputMovementDirection = AppManager.Instance.InputManager.InputMovementDirection,
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection
InputAttackDirection = AppManager.Instance.InputManager.InputAttackDirection
});
};
AppManager.Instance.InputManager.OnInteract += () =>
{
networkManager.AddData(new UpdateInputInteraction() { });
};
AppManager.Instance.InputManager.ShootEvent += () =>
AppManager.Instance.InputManager.ShootEvent += () =>
{
networkManager.AddData(new UpdateInputShoot() { });
networkManager.AddData(new UpdateInputShoot() { });
};
}
@ -95,7 +94,7 @@ namespace ZoFo.GameCore
public Player myPlayer;
List<MapObject> mapObjects = new List<MapObject>();
List<GameObject> gameObjects = new List<GameObject>();
List<GameObject> gameObjects = new List<GameObject>();
List<Player> players = new List<Player>();
List<StopObject> stopObjects = new List<StopObject>();
@ -112,8 +111,13 @@ namespace ZoFo.GameCore
}
networkManager.SendData();//set to ticks
if (myPlayer!=null)
GraphicsComponent.CameraPosition = (myPlayer.position + myPlayer.graphicsComponent.ObjectDrawRectangle.Size.ToVector2()/2 - AppManager.Instance.CurentScreenResolution.ToVector2()/(2*GraphicsComponent.scaling)).ToPoint();
if (myPlayer != null)
GraphicsComponent.CameraPosition =
((GraphicsComponent.CameraPosition.ToVector2() *0.9f +
(myPlayer.position + myPlayer.graphicsComponent.ObjectDrawRectangle.Size.ToVector2() / 2 - AppManager.Instance.CurentScreenResolution.ToVector2() / (2 * GraphicsComponent.scaling)
) * 0.1f
) )
.ToPoint();
}
internal void Draw(SpriteBatch spriteBatch)
{
@ -151,47 +155,48 @@ namespace ZoFo.GameCore
(update as UpdateStopObjectCreated).Size.GetPoint().ToVector2(),
(update as UpdateStopObjectCreated).sourceRectangle.GetRectangle(),
(update as UpdateStopObjectCreated).tileSetName,
(update as UpdateStopObjectCreated).collisions.Select(x =>x.GetRectangle()).ToArray()
(update as UpdateStopObjectCreated).collisions.Select(x => x.GetRectangle()).ToArray()
));
}
else if (update is UpdateGameObjectCreated)
{
GameObject created_gameObject;
if ((update as UpdateGameObjectCreated).GameObjectType == "EntittyForAnimationTests")
gameObjects.Add(new EntittyForAnimationTests((update as UpdateGameObjectCreated).position));
if ((update as UpdateGameObjectCreated).GameObjectType == "Player")
GameObject created_gameObject;
if((update as UpdateGameObjectCreated).GameObjectType == "Player")
{
created_gameObject = new Player((update as UpdateGameObjectCreated).position);
players.Add(created_gameObject as Player);
myPlayer = players[0];
gameObjects.Add(created_gameObject);
myPlayer = players[0];
gameObjects.Add(created_gameObject);
(created_gameObject as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
}
if ((update as UpdateGameObjectCreated).GameObjectType == "Ammo")
else if ((update as UpdateGameObjectCreated).GameObjectType == "Ammo")
gameObjects.Add(new Ammo((update as UpdateGameObjectCreated).position));
if ((update as UpdateGameObjectCreated).GameObjectType == "Zombie")
gameObjects.Add(new Zombie((update as UpdateGameObjectCreated).position));
else if ((update as UpdateGameObjectCreated).GameObjectType == "BottleOfWater")
gameObjects.Add(new BottleOfWater((update as UpdateGameObjectCreated).position));
else
{
Type t = Type.GetType("ZoFo.GameCore.GameObjects." + (update as UpdateGameObjectCreated).GameObjectType);
GameObject gameObject = Activator.CreateInstance(t, (update as UpdateGameObjectCreated).position) as GameObject;
if (gameObject is Entity)
(gameObject as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
gameObjects.Add(gameObject);
}
(gameObjects.Last() as Entity).SetIdByClient((update as UpdateGameObjectCreated).IdEntity);
//var a = Assembly.GetAssembly(typeof(GameObject));
//gameObjects.Add( TODO reflection
//Activator.CreateInstance(Type.GetType("ZoFo.GameCore.GameObjects.Entities.EntittyForAnimationTests")
///*(update as UpdateGameObjectCreated).GameObjectType*/, new []{ new Vector2(100, 100) })
//as GameObject
//);
}
else if (update is UpdatePosition)
{
var ent = FindEntityById(update.IdEntity);
ent.position = (update as UpdatePosition).NewPosition;
if (ent != null)
ent.position = (update as UpdatePosition).NewPosition;
}
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);
//DebugHUD.Instance.Log("new Animation " + ent.position);
}
else if (update is UpdateGameObjectDeleted)
{

View file

@ -12,6 +12,7 @@ using ZoFo.GameCore.GameManagers.ItemManager;
using ZoFo.GameCore.GUI;
using static System.Collections.Specialized.BitVector32;
using MonogameLibrary.UI.Base;
using ZoFo.GameCore.GameManagers.AssetsManager;
using ZoFo.GameCore.GameObjects;
namespace ZoFo.GameCore.GameManagers
@ -40,6 +41,7 @@ namespace ZoFo.GameCore.GameManagers
public ItemManager.ItemManager ItemManager;
public SettingsManager SettingsManager;
public SoundManager SoundManager;
public AssetManager AssetManager;
public AnimationBuilder animationBuilder { get; set; }
@ -63,6 +65,7 @@ namespace ZoFo.GameCore.GameManagers
SettingsManager = new SettingsManager();
SettingsManager.LoadSettings();
SoundManager = new SoundManager();
AssetManager = new AssetManager();
SoundManager.LoadSounds();

View file

@ -0,0 +1,9 @@
using System.Collections.Generic;
namespace ZoFo.GameCore.GameManagers.AssetsManager;
public class AssetContainer
{
public List<string> Animations;
public string IdleAnimation;
}

View file

@ -0,0 +1,18 @@
using System.Collections.Generic;
namespace ZoFo.GameCore.GameManagers.AssetsManager;
public class AssetManager
{
public AssetContainer Zombie = new()
{
Animations = ["zombie_damaged", "zombie_walk", "zombie_idle", "zombie_attack", "zombie_death"],
IdleAnimation = "zombie_walk"
};
public AssetContainer Player = new()
{
Animations = [ "player_look_down" ],
IdleAnimation = "player_look_down"
};
}

View file

@ -30,9 +30,10 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
/// <summary>
/// минимальный накоп изменения перед перевдижением
/// </summary>
const float minimalValueToChange = 4;
const float minimalValueToChange = 0;
public void CheckComponentCollision(CollisionComponent componentOfEntity)
{
//ADD CHECKSPEED TODO
var entity = componentOfEntity.gameObject as LivingEntity;
//for (int i = 0; i < ObjectsWithCollisions.Count; i++)
//{
@ -74,7 +75,8 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
}
else
{
entity.position.X += entity.velocity.X; //update player position
entity.position.X += (int)entity.velocity.X; //update player position
//entity.position.X = (float)Math.Round(entity.position.X, 2);
newRect.X = tryingRectX.X;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
}
@ -112,7 +114,8 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
}
else
{
entity.position.Y += entity.velocity.Y;
entity.position.Y += (int)entity.velocity.Y;
//entity.position.Y = (float)Math.Round(entity.position.Y, 2);
newRect.Y = tryingRectY.Y;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
}
entity.velocity.Y = 0;
@ -205,6 +208,21 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
}
return players.ToArray();
}
public Entity[] GetEntities(Rectangle rectangle, Entity entity)
{
List<Entity> entities = new List<Entity>();
foreach (var item in AppManager.Instance.server.entities)//фильтрация
{
if (item.collisionComponent.stopRectangle.SetOrigin(item.position).Intersects(rectangle))
{
entities.Add(item);
}
}
if (entities.Contains(entity))
entities.Remove(entity);
return entities.ToArray();
}
}
public static class ExtentionClass

View file

@ -8,13 +8,14 @@ using System.Diagnostics;
using System.Formats.Tar;
using System.Linq;
using System.Reflection.Metadata.Ecma335;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.GameManagers
{
public enum ScopeState { Idle, Left, Right, Straight, Back, StraightLeft, StraightRight, BackLeft, BackRight }
public enum ScopeState { Idle, Left, Right, Top, Down, TopLeft, TopRight, DownLeft, DownRight }
public class InputManager
{
@ -82,37 +83,7 @@ namespace ZoFo.GameCore.GameManagers
#endregion // Cheats
#region set ScopeState
int currentSection = (int)Math.Ceiling(Math.Atan2(InputMovementDirection.Y,
InputMovementDirection.X) * 180 / Math.PI * 16 / 360);
switch(currentSection){
case 1 or 0 or 16:
currentScopeState = ScopeState.Right;
break;
case 2 or 3:
currentScopeState = ScopeState.StraightRight;
break;
case 4 or 5:
currentScopeState = ScopeState.Straight;
break;
case 6 or 7:
currentScopeState = ScopeState.StraightLeft;
break;
case 8 or 9:
currentScopeState = ScopeState.Left;
break;
case 10 or 11:
currentScopeState = ScopeState.BackLeft;
break;
case 12 or 13:
currentScopeState = ScopeState.Back;
break;
case 14 or 15:
currentScopeState = ScopeState.BackRight;
break;
default:
break;
}
ConvertVector2ToState(InputMovementDirection);
#endregion
#region Обработка нажатия выстрела. Вызывает событие ShootEvent
@ -168,51 +139,25 @@ namespace ZoFo.GameCore.GameManagers
}
#endregion // Cheats
#region Обработка состояния объекта. Задает значение полю scopeState.
if(keyBoardState.IsKeyDown(Keys.Right) && keyBoardState.IsKeyDown(Keys.Up) ||
keyBoardState.IsKeyDown(Keys.D) && keyBoardState.IsKeyDown(Keys.W))
#region Обработка состояния объекта. Задает значение полю scopeState.
if (keyBoardState.IsKeyDown(Keys.Up) || keyBoardState.IsKeyDown(Keys.W))
{
currentScopeState = ScopeState.StraightRight;
InputMovementDirection = new Vector2(1, -1);
InputMovementDirection += new Vector2(0, -1);
}
else if(keyBoardState.IsKeyDown(Keys.Left) && keyBoardState.IsKeyDown(Keys.Up) ||
keyBoardState.IsKeyDown(Keys.A) && keyBoardState.IsKeyDown(Keys.W))
{
currentScopeState = ScopeState.StraightLeft;
InputMovementDirection = new Vector2(-1, -1);
if (keyBoardState.IsKeyDown(Keys.Down) || keyBoardState.IsKeyDown(Keys.S))
{
InputMovementDirection += new Vector2(0, 1);
}
else if(keyBoardState.IsKeyDown(Keys.Right) && keyBoardState.IsKeyDown(Keys.Down) ||
keyBoardState.IsKeyDown(Keys.D) && keyBoardState.IsKeyDown(Keys.S))
{
currentScopeState = ScopeState.BackRight;
InputMovementDirection = new Vector2(1, 1);
if (keyBoardState.IsKeyDown(Keys.Right) || keyBoardState.IsKeyDown(Keys.D))
{
InputMovementDirection += new Vector2(1, 0);
}
else if(keyBoardState.IsKeyDown(Keys.Left) && keyBoardState.IsKeyDown(Keys.Down) ||
keyBoardState.IsKeyDown(Keys.A) && keyBoardState.IsKeyDown(Keys.S))
{
currentScopeState = ScopeState.BackLeft;
InputMovementDirection = new Vector2(-1, 1);
}
else if (keyBoardState.IsKeyDown(Keys.Up) || keyBoardState.IsKeyDown(Keys.W))
{
currentScopeState = ScopeState.Straight;
InputMovementDirection = new Vector2(0, -1);
}
else if (keyBoardState.IsKeyDown(Keys.Down) || keyBoardState.IsKeyDown(Keys.S))
{
currentScopeState = ScopeState.Back;
InputMovementDirection = new Vector2(0, 1);
}
else if(keyBoardState.IsKeyDown(Keys.Left) || keyBoardState.IsKeyDown(Keys.A))
{
currentScopeState = ScopeState.Left;
InputMovementDirection = new Vector2(-1, 0);
}
else if(keyBoardState.IsKeyDown(Keys.Right) || keyBoardState.IsKeyDown(Keys.D))
{
currentScopeState = ScopeState.Right;
InputMovementDirection = new Vector2(1, 0);
if (keyBoardState.IsKeyDown(Keys.Left) || keyBoardState.IsKeyDown(Keys.A))
{
InputMovementDirection += new Vector2(-1, 0);
}
ConvertVector2ToState(InputMovementDirection);
#endregion
#region Обработка нажатия выстрела. Вызывает событие ShootEvent
@ -255,7 +200,50 @@ namespace ZoFo.GameCore.GameManagers
prevCurrentScopeState = currentScopeState;
#endregion
DebugHUD.Instance.Set("controls", currentScopeState.ToString());
DebugHUD.Instance.Set("controls", currentScopeState.ToString());
}
#region работа с ScopeState и Vector2
public ScopeState ConvertVector2ToState(Vector2 vector)
{
//if()
int currentSection = (int)Math.Ceiling(Math.Atan2(vector.Y,
vector.X) * (180 / Math.PI) / 360 * 16);
DebugHUD.DebugSet("current section", currentSection.ToString());
//DebugHUD.DebugSet("y", InputMovementDirection.Y.ToString());
//DebugHUD.DebugSet("x", InputMovementDirection.X.ToString());
switch(currentSection)
{
case 0 or 1:
currentScopeState = ScopeState.Right;
break;
case 2 or 3:
currentScopeState = ScopeState.DownRight;
break;
case 4 or 5:
currentScopeState = ScopeState.Down;
break;
case 6 or 7:
currentScopeState = ScopeState.DownLeft;
break;
case 8 or -7:
currentScopeState = ScopeState.Left;
break;
case -6 or -5:
currentScopeState = ScopeState.TopLeft;
break;
case -4 or -3:
currentScopeState = ScopeState.Top;
break;
case -2 or -1:
currentScopeState = ScopeState.TopRight;
break;
default:
break;
}
return currentScopeState;
}
#endregion
}
}
}

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
{
public class Frame
{
public int Duration { get; set; }
public int TileId { get; set; }
}
}

View file

@ -11,5 +11,6 @@ namespace ZoFo.GameCore.GameManagers.MapManager.MapElements
public int Id { get; set; }
public string Type { get; set; }
public ObjectGroup Objectgroup { get; set; }
public List<Frame> Animation { get; set; }
}
}

View file

@ -20,8 +20,8 @@ namespace ZoFo.GameCore.GameManagers.MapManager
private static readonly string _templatePath = "Content/MapData/TileMaps/{0}.tmj";
private static readonly JsonSerializerOptions _options = new JsonSerializerOptions { PropertyNameCaseInsensitive = true }; // Задача настроек для JsonSerialize
private static readonly Dictionary<string, string> _classPath = new Dictionary<string, string>() {
{ "Collectables", "ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables." },
{ "Enemies", "ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies." }
{ "Collectables", "ZoFo.GameCore.GameObjects." },
{ "Enemies", "ZoFo.GameCore.GameObjects." }
};
//private static readonly float _scale = 1.0f;
@ -72,6 +72,13 @@ namespace ZoFo.GameCore.GameManagers.MapManager
if (tileSet.FirstGid <= chunk.Data[i])
{
int number = chunk.Data[i] - tileSet.FirstGid;
Tile tile = tileSet.Tiles[number]; // По факту может быть StopObjectom, но на уровне Tiled это все в первую очередь Tile
if (tile.Animation is not null)
{
}
int relativeColumn = number % tileSet.Columns;
int relativeRow = number / tileSet.Columns; // относительно левого угла чанка
@ -84,7 +91,6 @@ namespace ZoFo.GameCore.GameManagers.MapManager
(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
switch (tile.Type)
{

View file

@ -85,7 +85,7 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager
var databytes = Encoding.UTF8.GetBytes(data);
foreach (Socket socket in clients)
{
clients[0].SendAsync(databytes, SocketFlags.Partial);
clients[0].SendAsync(databytes);
}
for (int i = 0; i < 200 && i< datasToSend.Count; i++)
updates.RemoveAt(0);

View file

@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities
namespace ZoFo.GameCore.GameObjects
{
internal class EntittyForAnimationTests : Entity
{

View file

@ -6,14 +6,14 @@ using Microsoft.Xna.Framework.Graphics;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.CollisionManager;
namespace ZoFo.GameCore.GameObjects.Entities
namespace ZoFo.GameCore.GameObjects
{
public abstract class Entity : GameObject
{
//public override GraphicsComponent graphicsComponent => null;
public CollisionComponent collisionComponent { get; protected set; }
public int Id { get; set; }
static int totalEntitiesCreated = 0;
static int totalEntitiesCreated = 1;
protected Entity(Vector2 position) : base(position)
{
Id = totalEntitiesCreated;
@ -46,7 +46,6 @@ namespace ZoFo.GameCore.GameObjects.Entities
animationId = animationId,
IdEntity = Id
});
}
public override void Draw(SpriteBatch spriteBatch)
{

View file

@ -11,7 +11,7 @@ using ZoFo.GameCore.Graphics;
using Microsoft.Xna.Framework.Graphics;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
class Ammo : Collectable
{

View file

@ -10,14 +10,15 @@ using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
public class BottleOfWater : Collectable
{
public override StaticGraphicsComponent graphicsComponent { get; } = new(_path + "BottleOfWater");
public BottleOfWater(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -4,7 +4,7 @@ using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
namespace ZoFo.GameCore.GameObjects;
public class Collectable : Interactable
{
protected static readonly string _path = "Textures/icons/Collectables/";

View file

@ -10,7 +10,7 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
public class Peeble:Collectable
{
@ -18,7 +18,8 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
public Peeble(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -9,7 +9,7 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
class PureBottleOfWater:Collectable
{
@ -17,6 +17,8 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
public PureBottleOfWater(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -9,14 +9,15 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
class RottenFlesh:Collectable
{
public override StaticGraphicsComponent graphicsComponent { get; } = new(_path + "RottenFlesh");
public RottenFlesh(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -9,7 +9,7 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
namespace ZoFo.GameCore.GameObjects
{
class Steel:Collectable
{
@ -17,6 +17,8 @@ namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables
public Steel(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -5,7 +5,7 @@ using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
namespace ZoFo.GameCore.GameObjects;
public class Wood : Collectable
{
@ -13,7 +13,8 @@ public class Wood : Collectable
public Wood(Vector2 position) : base(position)
{
graphicsComponent.ObjectDrawRectangle.Width = 20;
graphicsComponent.ObjectDrawRectangle.Height = 20;
}
public override void OnInteraction(GameObject sender)
{

View file

@ -5,7 +5,7 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.Interactables;
namespace ZoFo.GameCore.GameObjects;
public class Interactable : Entity
{

View file

@ -5,7 +5,7 @@ using System.Reflection;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies;
namespace ZoFo.GameCore.GameObjects;
public class Enemy : LivingEntity
{
protected float speed;

View file

@ -1,24 +1,37 @@
using Microsoft.Xna.Framework;
using Microsoft.VisualBasic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameManagers.AssetsManager;
using ZoFo.GameCore.Graphics;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies
namespace ZoFo.GameCore.GameObjects
{
class Zombie : Enemy
{
{
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "zombie_damaged", "zombie_walk", "zombie_idle", "zombie_attack", "zombie_death" }, "zombie_walk");
public bool isAttacking;
public Zombie(Vector2 position) : base(position)
{
health = 5;
speed = 2;
speed = 0.5f;
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
collisionComponent.stopRectangle = new Rectangle(10, 20, 10, 10);
isAttacking = false;
StartAnimation("zombie_walk");
collisionComponent.isTrigger = true;
collisionComponent.hasCollision = true;
(graphicsComponent as AnimatedGraphicsComponent).actionOfAnimationEnd += EndAttack;
collisionComponent.OnTriggerZone += OnPlayerClose;
collisionComponent.triggerRectangle = new Rectangle(-5, -5, 40, 40);
}
public override void Update()
@ -26,18 +39,39 @@ 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 (Random.Shared.NextDouble() > 0.9)
if (!isAttacking) { velocity += new Vector2(duration.X * speed, duration.Y * speed); }
}
public void OnPlayerClose(GameObject sender)
{
if(!isAttacking)
{
StartAnimation("zombie_walk");
StartAnimation("zombie_attack");
isAttacking = true;
}
if (Random.Shared.NextDouble() > 0.9)
{
//StartAnimation("zombie_idle");
}
public void EndAttack(string a)
{
var damagedPlayers=AppManager.Instance.server.collisionManager.GetPlayersInZone(collisionComponent.triggerRectangle.SetOrigin(position));
//TODO ДАМАЖИТЬ ИГРОКОВ В ЗОНЕ
if (damagedPlayers.Length>0) { DebugHUD.DebugLog("End of" + a);
AppManager.Instance.server.DeleteObject(this);
}
isAttacking = false;
}
public override void Draw(SpriteBatch spriteBatch)
{
DrawDebugRectangle(spriteBatch, collisionComponent.triggerRectangle.SetOrigin(position), Color.Blue);
base.Draw(spriteBatch);
}
}
}

View file

@ -6,7 +6,7 @@ using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities;
namespace ZoFo.GameCore.GameObjects;
public class LivingEntity : Entity
{
/// <summary>

View file

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player
namespace ZoFo.GameCore.GameObjects
{
public class LootData
{

View file

@ -4,36 +4,42 @@ using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework.Input;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.AssetsManager;
using ZoFo.GameCore.GameManagers.CollisionManager;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.Graphics;
using System.Diagnostics;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.GameObjects.Entities.LivingEntities.Player;
namespace ZoFo.GameCore.GameObjects;
public class Player : LivingEntity
{
public Vector2 InputWeaponRotation { get; set; }
public Vector2 InputPlayerRotation { get; set; }
/// <summary>
/// Факт того, что плеер в этом апдейте пытается стрелять
/// </summary>
//public bool IsTryingToShoot { get; set; }
private float speed;
public int health = 100;
public int rad = 0;
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(new List<string> { "player_look_down" }, "player_look_down");
public LootData lootData;
//public bool isTryingToInteract { get; set; }
public override GraphicsComponent graphicsComponent { get; } = new AnimatedGraphicsComponent(AppManager.Instance.AssetManager.Player);
public bool IsTryingToInteract { get; set; }
/// <summary>
/// Факт того, что плеер в этом апдейте пытается стрелять
/// </summary>
public bool IsTryingToShoot { get; set; }
public Player(Vector2 position) : base(position)
{
lootData = new LootData();
lootData.loots = new Dictionary<string, int>();
graphicsComponent.ObjectDrawRectangle = new Rectangle(0, 0, 30, 30);
collisionComponent.stopRectangle = new Rectangle(0, 20, 30, 10);
speed = 10;
//isTryingToInteract = false;
//IsTryingToShoot = false;
speed = 5;
StartAnimation("player_look_down");
}
@ -41,12 +47,40 @@ public class Player : LivingEntity
public override void Update()
{
#region анимация управления, стрельбы
switch(AppManager.Instance.InputManager.ConvertVector2ToState(InputPlayerRotation))
{
case ScopeState.Top:
break;
case ScopeState.Down:
break;
case ScopeState.Right:
//StartAnimation("player_running_top_rotate");
break;
case ScopeState.Left:
break;
case ScopeState.TopRight:
break;
case ScopeState.TopLeft:
break;
case ScopeState.DownRight:
break;
case ScopeState.DownLeft:
break;
}
#endregion
MovementLogic();
}
public void MovementLogic()
{
velocity = InputPlayerRotation * speed;
velocity += InputPlayerRotation * speed;
}
public void HandleNewInput(UpdateInput updateInput)
{
@ -56,10 +90,26 @@ public class Player : LivingEntity
}
public void HandleInteract(UpdateInputInteraction updateInputInteraction)
{
//isTryingToInteract = true;
IsTryingToInteract = true;
}
public void HandleShoot(UpdateInputShoot updateInputShoot)
{
IsTryingToShoot = true;
var rect = collisionComponent.stopRectangle.SetOrigin(position);
rect.Width += 100;
rect.Height += 100;
Entity[] entities = AppManager.Instance.server.collisionManager.GetEntities(rect, this);
if (entities.Length>0)
{
DebugHUD.DebugSet("ent[0]", entities[0].ToString());
if (entities != null)
{
foreach (Entity entity in entities)
{
AppManager.Instance.server.DeleteObject(entity);
}
}
}
}
}
}

View file

@ -10,7 +10,7 @@ using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.Graphics;
namespace ZoFo.GameCore.GameObjects.MapObjects
namespace ZoFo.GameCore.GameObjects
{
public class MapObject : GameObject
{
@ -34,6 +34,25 @@ namespace ZoFo.GameCore.GameObjects.MapObjects
(graphicsComponent as StaticGraphicsComponent).LoadContent();
this.sourceRectangle = sourceRectangle;
}
/// <summary>
/// Конструктор для объектов с карты с анимациями, REDO
/// </summary>
/// <param name="position"></param>
/// <param name="size"></param>
/// <param name="sourceRectangle"></param>
/// <param name="textureName"></param>
/// <param name="sourceRectangles"></param>
/// <param name="frameSize"></param>
public MapObject(Vector2 position, Vector2 size, Rectangle sourceRectangle, string textureName, Rectangle sourceRectangles, int frameSize) : base(position)
{
//graphicsComponent for source
(graphicsComponent as StaticGraphicsComponent)._textureName = textureName;
(graphicsComponent as StaticGraphicsComponent).BuildComponent(textureName);
(graphicsComponent as StaticGraphicsComponent).ObjectDrawRectangle = new Rectangle((int)position.X, (int)position.Y, (int)size.X, (int)size.Y);
(graphicsComponent as StaticGraphicsComponent).LoadContent();
this.sourceRectangle = sourceRectangle;
}
public override void Draw(SpriteBatch spriteBatch)
{

View file

@ -4,6 +4,7 @@ using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ZoFo.GameCore.GameManagers;
using ZoFo.GameCore.GameManagers.AssetsManager;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore.Graphics
@ -60,7 +61,17 @@ namespace ZoFo.GameCore.Graphics
private int interval;
private int lastInterval;
private Rectangle sourceRectangle;
public AnimatedGraphicsComponent(AssetContainer asset)
{
Build(asset.Animations, asset.IdleAnimation);
}
public AnimatedGraphicsComponent(List<string> animationsId, string neitralAnimationId)
{
Build(animationsId, neitralAnimationId);
}
private void Build(List<string> animationsId, string neitralAnimationId)
{
//this._spriteBatch = _spriteBatch;
currentFrame = 0;
@ -191,7 +202,7 @@ namespace ZoFo.GameCore.Graphics
destinationRectangle = Scaling(destinationRectangle);
_spriteBatch.Draw(texture, destinationRectangle, sourceRectangle, Color.White, Rotation,
Vector2.Zero, Flip, 0);
Vector2.Zero, Flip, (destinationRectangle.Y + destinationRectangle.Height) / 2000f);
}
public override void Draw(Rectangle destinationRectangle, SpriteBatch _spriteBatch, Rectangle sourceRectangle)
{
@ -217,7 +228,7 @@ namespace ZoFo.GameCore.Graphics
destinationRectangle = Scaling(destinationRectangle);
_spriteBatch.Draw(texture,
destinationRectangle, sourceRectangle, Color.White, 0,
Vector2.Zero, Flip, 0);
Vector2.Zero, Flip, (destinationRectangle.Y + destinationRectangle.Height) / 2000f);
}
private void buildSourceRectangle()
{

View file

@ -16,13 +16,13 @@ using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ClientToServer;
using ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient;
using ZoFo.GameCore.GameObjects;
using ZoFo.GameCore.GameObjects.Entities;
using ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
using ZoFo.GameCore.GameObjects.Entities.LivingEntities.Enemies;
using ZoFo.GameCore.GameObjects.Entities.Interactables.Collectables;
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;
using ZoFo.GameCore.GUI;
namespace ZoFo.GameCore
{
@ -80,7 +80,10 @@ namespace ZoFo.GameCore
case "UpdatePlayerParametrs":
break;
case "UpdateInput":
players[0].HandleNewInput(updateData as UpdateInput);
if (players.Count > 0)
players[0].HandleNewInput(updateData as UpdateInput);//TODO id instead of 0
else
DebugHUD.DebugLog("NO PLAYER ON MAP");
break;
case "UpdateTileCreated":
break;
@ -162,9 +165,9 @@ namespace ZoFo.GameCore
{
if (ticks == 3) //ОБРАБАТЫВАЕТСЯ 20 РАЗ В СЕКУНДУ
{
foreach (var go in gameObjects)
for (int i = 0; i < gameObjects.Count; i++)
{
go.UpdateLogic();
gameObjects[i].UpdateLogic();
}
collisionManager.ResolvePhysics();
ticks = 0;
@ -219,6 +222,7 @@ namespace ZoFo.GameCore
position = gameObject.position
});
collisionManager.Register(entity.collisionComponent);
entities.Add(entity);
}
else
AddData(new UpdateGameObjectCreated()