public void AddObject(GameObjectBase obj) { int cellX = (int)(obj.X / CellBase.Width); int cellY = (int)(obj.Y / CellBase.Height); if (cellX < WidthInCells && cellY < HeightInCells) { var cell = Cells[cellY, cellX]; cell.Objects.Add(obj); } }
private void MoveObject(GameObjectBase obj) { obj.X += obj.XSpeed; obj.Y += obj.YSpeed; }