Added texture cache and sprite origins.
This commit is contained in:
@@ -29,7 +29,8 @@ public class GreenEnemy : EnemyShip
|
||||
Texture2D texture = args.Content.Load<Texture2D>(@$"Sprites\Enemy01_Green_Frame_1_png_processed");
|
||||
SpriteEffects spriteEffects = SpriteEffects.None;
|
||||
|
||||
args.SpriteBatch.Draw(texture, Position, null, DrawColor, 0, new Vector2(0, 0), 1, spriteEffects, 1);
|
||||
//args.SpriteBatch.Draw(texture, Position, null, DrawColor, 0, new Vector2(0, 0), 1, spriteEffects, 1);
|
||||
args.SpriteBatch.Draw(texture, Position, null, DrawColor, 0, Origin, 1, spriteEffects, 1);
|
||||
|
||||
base.Draw(args);
|
||||
}
|
||||
@@ -56,8 +57,11 @@ public class GreenEnemy : EnemyShip
|
||||
|
||||
protected override void OnKilled(SpriteUpdateContext context)
|
||||
{
|
||||
int itemXPosition = (int)XPosition + 32 - Item.Width / 2;
|
||||
int itemYPosition = (int)YPosition + 32 - Item.Height / 2;
|
||||
//int itemXPosition = (int)XPosition + 32 - Item.Width / 2;
|
||||
//int itemYPosition = (int)YPosition + 32 - Item.Height / 2;
|
||||
|
||||
int itemXPosition = (int)XPosition;
|
||||
int itemYPosition = (int)YPosition;
|
||||
|
||||
switch (context.Random.Next(0, 5))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user