Allow players to throw items at an angle

Fixes #73
This commit is contained in:
Drew DeVault 2015-10-02 08:41:40 -04:00
parent 8367f97451
commit eda920cb75
2 changed files with 6 additions and 3 deletions

View File

@ -54,7 +54,10 @@ namespace TrueCraft.Core.Entities
public void TerrainCollision(Vector3 collisionPoint, Vector3 collisionDirection)
{
// This space intentionally left blank
if (collisionDirection == Vector3.Down)
{
Velocity = Vector3.Zero;
}
}
public override byte EntityType

View File

@ -39,7 +39,7 @@ namespace TrueCraft.Handlers
var inventory = client.SelectedItem;
inventory.Count--;
var item = new ItemEntity(client.Entity.Position + new Vector3(0, PlayerEntity.Height, 0), spawned);
item.Velocity = MathHelper.FowardVector(client.Entity.Yaw) * 0.3;
item.Velocity = MathHelper.RotateY(Vector3.Forwards, MathHelper.DegreesToRadians(client.Entity.Yaw)) * 0.5;
client.Inventory[client.SelectedSlot] = inventory;
server.GetEntityManagerForWorld(client.World).SpawnEntity(item);
break;