} //bounds of sprite public void update(Vector2 pup, Vector2 up) { pos.Y += up.Y + pup.Y; float prevscale = scale; scale = TileFactory.getScale(pos); if (prevscale > 0 && scale > 0) { pos.X = (((pos.X - 400) / prevscale) * scale + 400); } pos.X += up.X * scale + pup.X * scale; drawpos = new Vector2(pos.X, TileFactory.getDrawY(pos.Y)); }
public void update() { drawpos = pos; drawpos.Y = TileFactory.getDrawY(pos.Y); scale = TileFactory.getScale(pos); float posX = TileFactory.checkHorizontalBounds(pos.X); if (posX < pos.X) { pos.X -= texture.Width; } if (posX > pos.X) { pos.X += texture.Width; } }