So I have created code for a grid that looks like this :
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- X - - - - - - - -
- - - - - - - - - -
Co-ordinates are accessed by calling my_grid.Grid[x_coordinate][y_coordinate]
, and new characters can be placed anywhere there (as shown by the 'X' with coordinates [1][1]
)
I want to be able to move this character in any direction using arrow key inputs, without using the 'Enter' key afterwards if possible.
What is the best way to do this?