I am struggling on how to internally represent my roguelike maze. Currently I maintain a 2D array as well as an array of StringBuffers. The array is used for easy lookup of objects in the maze. The StringBuffer is used to quickly generate a string to draw on the screen. The problem is that I need to update both structure every time something moves in the maze.
I could just keep the 2D array. Then I could generate the Strings on the fly as I need to display. However I do a lot of display updates (whenever the player moves). That might take a lot of time to generate an 80x25 worth of character Strings.
Or I could just keep everything in the String array. Then I could index into it when I need to check different cells of the maze. That just does not feel as natural as the separate 2D array though.
Free Laundry
-
Apparently a lot of apartment buildings have coin operated laundry machines
in the basement. And guess what? You can order a key to unlock the payment
me...
5 years ago