/// <summary> /// Acts as the food item's draw method, but instead of drawing straight to the screen, it fills the level's grid /// with its texture, which is drawn when the grid is drawn. /// </summary> /// <param name="grid">The level's grid.</param> public void fillGrid(LevelType level) { rotation = MovementFunctions.calculateRotation(ai.Orientation); PortalType portal; if (level.tryGetPortal(vector, out portal)) { portal.fillGrid(level); } fill(level.Grid); }
public virtual void fillGrid(GameGrid grid, Color color) { float rotation = MovementFunctions.calculateRotation(orientation); grid.GetCell(vector).fillCell(CellContent.snake, texture, rotation, color); }
/// <summary> /// Initializes the food item's AI agent and the rotation of the food item. /// </summary> public void initialize() { ai.initialize(); rotation = MovementFunctions.calculateRotation(ai.Orientation); }