This commit is contained in:
SergoDobro 2024-08-17 20:16:16 +03:00
parent 96e6e37b56
commit 2503173729
2 changed files with 10 additions and 6 deletions

View file

@ -96,9 +96,10 @@ namespace ZoFo.GameCore.GameManagers.CollisionManager
entity.position.X += entity.velocity.Y;
newRect.Y = tryingRectY.Y;//значение по X для нового РЕК приравниваем к значению испытуемого РЕК
}
entity.collisionComponent.stopRectangle = newRect;
entity.graphicsComponent.ObjectDrawRectangle = newRect;
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 });
entity.velocity = Vector2.Zero;
}

View file

@ -1,6 +1,7 @@
using System;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZoFo.GameCore.GameObjects.Entities.LivingEntities;
@ -10,8 +11,10 @@ namespace ZoFo.GameCore.GameManagers.NetworkManager.Updates.ServerToClient
/// <summary>
/// Хранит новую позицию
/// </summary>
public class UpdatePosition : UpdateData
public class UpdatePosition : UpdateData
{
public UpdatePosition() { UpdateType = "UpdatePosition"; }
public Vector2 NewPosition { get; set; }
}
}