diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Player.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Player.cs index 865c044..a36ee64 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Player.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Player.cs @@ -1,4 +1,5 @@ using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; using System; using System.Collections.Generic; using System.Linq; @@ -9,6 +10,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities { public class Player : LivingEntity { + public Player(Vector2 position): base(position) + { + + } protected override GraphicsComponent GraphicsComponent => throw new NotImplementedException(); public void Kill() diff --git a/DangerousD/GameCore/GameObjects/MapObjects/TestAnimationDeath.cs b/DangerousD/GameCore/GameObjects/MapObjects/TestAnimationDeath.cs index 6937c56..8e9be4d 100644 --- a/DangerousD/GameCore/GameObjects/MapObjects/TestAnimationDeath.cs +++ b/DangerousD/GameCore/GameObjects/MapObjects/TestAnimationDeath.cs @@ -15,8 +15,8 @@ namespace DangerousD.GameCore.GameObjects.MapObjects public TestAnimationDeath(Vector2 position) : base(position) { - Width = 64; - Height = 64; + Width =512; + Height = 512; GraphicsComponent.StartAnimation("deathbear"); diff --git a/DangerousD/GameCore/Graphics/AnimationBuilder.cs b/DangerousD/GameCore/Graphics/AnimationBuilder.cs index 8f35b5a..8f169f6 100644 --- a/DangerousD/GameCore/Graphics/AnimationBuilder.cs +++ b/DangerousD/GameCore/Graphics/AnimationBuilder.cs @@ -21,7 +21,9 @@ namespace DangerousD.GameCore.Graphics string json = reader.ReadToEnd(); AnimationContainer animation = JsonConvert.DeserializeObject(json); Animations.Add(animation); + reader.Close(); } + } } } diff --git a/DangerousD/GameCore/Graphics/GraphicsComponent.cs b/DangerousD/GameCore/Graphics/GraphicsComponent.cs index e605684..3dfed09 100644 --- a/DangerousD/GameCore/Graphics/GraphicsComponent.cs +++ b/DangerousD/GameCore/Graphics/GraphicsComponent.cs @@ -129,6 +129,7 @@ namespace DangerousD.GameCore.Graphics public void DrawAnimation(Rectangle destinationRectangle, SpriteBatch _spriteBatch) { + _spriteBatch.Draw(textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)], destinationRectangle, sourceRectangle, Color.White); } diff --git a/DangerousD/GameCore/Levels/Level1.cs b/DangerousD/GameCore/Levels/Level1.cs index 5ab7a66..781bb24 100644 --- a/DangerousD/GameCore/Levels/Level1.cs +++ b/DangerousD/GameCore/Levels/Level1.cs @@ -8,7 +8,7 @@ namespace DangerousD.GameCore.Levels { public void InitLevel() { - new Player(); + //new Player(); var Трава = new GrassBlock(new Vector2(0, 128)); var Death = new TestAnimationDeath(new Vector2(128, 128)); diff --git a/DangerousD/GameCore/Managers/AppManager.cs b/DangerousD/GameCore/Managers/AppManager.cs index e45a378..67a65cf 100644 --- a/DangerousD/GameCore/Managers/AppManager.cs +++ b/DangerousD/GameCore/Managers/AppManager.cs @@ -103,7 +103,7 @@ namespace DangerousD.GameCore LobbyGUI.Draw(_spriteBatch); break; case GameState.Game: - _spriteBatch.Begin(); + _spriteBatch.Begin(SpriteSortMode.Deferred,null,SamplerState.PointClamp); GameManager.Draw(_spriteBatch); _spriteBatch.End(); break;