Esempio n. 1
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); 
			}
		}
Esempio n. 2
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);
	    }
Esempio n. 3
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);
	    }
Esempio n. 4
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);
	    }
Esempio n. 5
0
	    public float GetDistanceTo(Transform t) {
		    return Artemis.Utils.Distance(t.GetX(), t.GetY(), GetX(), GetY());
	    }
Esempio n. 6
0
 public double GetDistanceTo(Transform t)
 {
     return(Artemis.Utils.Distance(t.GetX(), t.GetY(), x, y));
 }
Esempio n. 7
0
 public float GetDistanceTo(Transform t)
 {
     return(Artemis.Utils.Distance(t.GetX(), t.GetY(), GetX(), GetY()));
 }