Closed lstrzebinczyk closed 7 years ago
Moving the map around has a couple of problems. First of all, both menus must stay where they are, and only the game world must move.
Read those, and whatever is acessible:
https://en.wikipedia.org/wiki/Tile-based_video_game https://gamedevelopment.tutsplus.com/tutorials/an-introduction-to-creating-a-tile-map-engine--gamedev-10900 http://gamedev.stackexchange.com/questions/5173/best-way-to-create-a-map-for-a-2d-game https://www.quora.com/In-typical-2D-game-programming-do-we-actually-move-the-player-sprite-forward-or-do-we-actually-move-the-background-backward-to-give-an-illusion-of-motion
For now the idea is to introduce a Renderer class. It will be asked for rendering objects that are supposed to end up in the map. It will add global x and y offsets to those rendered objects. When map is moved, it will be able to update all those items.
Spectacular success, done!
Currently map is 40x60 squares, it should be substantially bigger, at least. Figure out: