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) { if (bullet == null) { bullet = contentManager.Load<Texture2D>("bullet"); } spriteBatch.Draw(bullet, new Vector2(transform.GetX(), transform.GetY()), Color.White); }
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); }
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); }
public float GetDistanceTo(Transform t) { return Artemis.Utils.Distance(t.GetX(), t.GetY(), GetX(), GetY()); }
public double GetDistanceTo(Transform t) { return(Artemis.Utils.Distance(t.GetX(), t.GetY(), x, y)); }
public float GetDistanceTo(Transform t) { return(Artemis.Utils.Distance(t.GetX(), t.GetY(), GetX(), GetY())); }