示例#1
0
	    public static void Render(SpriteBatch spriteBatch,ContentManager contentManager,Transform transform) {
            if (bullet == null)
            {
                bullet = contentManager.Load<Texture2D>("bullet");
            }
		    spriteBatch.Draw(bullet, new Vector2(transform.GetX(), transform.GetY()), Color.White);
	    }
示例#2
0
        public static void Render(SpriteBatch spriteBatch, ContentManager contentManager, Transform transform,Color color,int radius)
        {
            if (circle == null)
            {
                circle = contentManager.Load<Texture2D>("explosion");
            }
            spriteBatch.Draw(circle, new Vector2((float)transform.GetX() - radius, (float)transform.GetY() - radius),null,Color.White,0,new Vector2(0,0),0.3f,SpriteEffects.None,0);
	    }
示例#3
0
	    public static void Render(SpriteBatch spriteBatch, ContentManager contentManager, Transform transform) {
            if (ship == null)
            {
                ship = contentManager.Load<Texture2D>("enemy");
            }
            Rectangle rect = new Rectangle((int)transform.GetX(),(int)transform.GetY(),ship.Width,ship.Height);
            spriteBatch.Draw(ship, rect, Color.Red);
	    }
示例#4
0
		public override void Process(Entity e) {
			transform = transformMapper.Get(e);
            SpatialForm spatialForm = spatialFormMapper.Get(e);
            spatialName = spatialForm.GetSpatialFormFile();
	
			if (transform.GetX() >= 0 && transform.GetY() >= 0 && transform.GetX() < spriteBatch.GraphicsDevice.Viewport.Width && transform.GetY() < spriteBatch.GraphicsDevice.Viewport.Height && spatialForm != null) {
                CreateSpatial(e); 
			}
		}
 public static void Render(SpriteBatch spriteBatch, ContentManager contentManager, Transform transform, Color color, int radius)
 {
     if (circle == null)
     {
         circle = contentManager.Load<Texture2D>("explosion");
     }
     Rectangle rect = new Rectangle((int)transform.X, (int)transform.Y, circle.Width, circle.Height);
     spriteBatch.Draw(circle, new Vector2(transform.X - circle.Width / 2, transform.Y - circle.Height / 2), circle.Bounds, Color.White);
 }
 public static void Render(SpriteBatch spriteBatch, ContentManager contentManager, Transform transform)
 {
     if (ship == null)
     {
         ship = contentManager.Load<Texture2D>("player");
     }
     Rectangle rect = new Rectangle((int)transform.X, (int)transform.Y, ship.Width, ship.Height);
     spriteBatch.Draw(ship, new Vector2(transform.X - ship.Width / 2, transform.Y - ship.Height/2), ship.Bounds, Color.White);
 }
 public static void Render(SpriteBatch spriteBatch,ContentManager contentManager,Transform transform)
 {
     if (bullet == null)
     {
         bullet = contentManager.Load<Texture2D>("bullet");
     }
     Rectangle rect = new Rectangle((int)transform.X, (int)transform.Y, bullet.Width, bullet.Height);
     spriteBatch.Draw(bullet, new Vector2(transform.X - bullet.Width / 2, transform.Y - bullet.Height / 2), bullet.Bounds, Color.White);
 }
示例#8
0
	    public float GetDistanceTo(Transform t) {
		    return Artemis.Utils.Distance(t.GetX(), t.GetY(), GetX(), GetY());
	    }
 public float DistanceTo(Transform t)
 {
     return Vector2.Distance(new Vector2(t.X, t.Y), new Vector2(X, Y));
 }
示例#10
0
 public float DistanceTo(Transform t)
 {
     return Artemis.Utils.Distance(t.X, t.Y, X, Y);
 }