Hi folks,
After learning Objc-C and Cocoa I've decided to turn to game programming and C++. I'm starting off with a simple roguelike and read through the graphics tutorials and a little stuck already in how things are drawn.
I have my map stored in an array[5][5] of ints. A 1 is a wall and a 0 for a floor. I've created two text objects for the different elements. "#" and "." for my wall and floor.
I intend to iterate the array and draw the corresponding tile. Forgive my psuedo code but I'm not near my machine at present.
App.Clear()
iterate (map)
Update x and y for current tile position.
if (tile == 1)
Text1.SetPosition(x,y)
App.Draw(Text1)
if (tile == 0)
Text0.SetPosition(x,y)
App.Draw(Text0)
end iteration
App.Display()
Does that roughly make sense? My concern is around the usage of Clear, Draw and Display in order to display what's essentially the same Text object multiple times on the screen.