This commit is contained in:
Lev 2023-08-15 19:32:58 +03:00
commit fc4ce31703
6 changed files with 12 additions and 4 deletions

View file

@ -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()

View file

@ -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");

View file

@ -21,7 +21,9 @@ namespace DangerousD.GameCore.Graphics
string json = reader.ReadToEnd();
AnimationContainer animation = JsonConvert.DeserializeObject<AnimationContainer>(json);
Animations.Add(animation);
}
reader.Close();
}
}
}
}

View file

@ -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);
}

View file

@ -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));

View file

@ -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;