From 9eb6ae7113d21646e073319de88f5d038261d360 Mon Sep 17 00:00:00 2001 From: Timofey06 Date: Mon, 14 Aug 2023 20:10:30 +0300 Subject: [PATCH] revorkAnimotor2 --- DangerousD/GameCore/Graphics/GraphicsComponent.cs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/DangerousD/GameCore/Graphics/GraphicsComponent.cs b/DangerousD/GameCore/Graphics/GraphicsComponent.cs index 6db5dbb..e2f93e4 100644 --- a/DangerousD/GameCore/Graphics/GraphicsComponent.cs +++ b/DangerousD/GameCore/Graphics/GraphicsComponent.cs @@ -8,7 +8,7 @@ using System.Text; namespace DangerousD.GameCore.Graphics { - public class GraphicsComponent + class GraphicsComponent { private List animations; private List textures; @@ -75,13 +75,8 @@ namespace DangerousD.GameCore.Graphics SetInterval(); } - public void DrawAnimation(Rectangle destinationRectangle, SpriteBatch _spriteBatch) + public void Update() { - - - - - if (interval == 0) { currentFrame++; @@ -98,7 +93,9 @@ namespace DangerousD.GameCore.Graphics } interval--; - + } + public void DrawAnimation(Rectangle destinationRectangle, SpriteBatch _spriteBatch) + { _spriteBatch.Draw(textures[texturesNames.FindIndex(x => x == currentAnimation.TextureName)], destinationRectangle, sourceRectangle, Color.White); } private void buildSourceRectangle()