Time for action – completing the editor – part 1

  1. Open the MapEditor form in Design mode.
  2. Double-click on the listTiles ListView control to automatically generate an event handler for the SelectedIndexChanged event. Update the event code to read:
    private void listTiles_SelectedIndexChanged(
        object sender, EventArgs e)
    {
        if (listTiles.SelectedIndices.Count > 0)
        {
            game.DrawTile =
                listTiles.SelectedIndices[0];
        }
    }
  3. Return to the Design view of the MapEditor form and double-click on the radio button labelled Toggle Passable to generate a handler for the CheckChanged event. Update the event handler to read:
    private void radioPassable_CheckedChanged(object sender, EventArgs e) { if (radioPassable.Checked) { game.EditingCode = false; } else { game.EditingCode ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.