I have a large map that a player will navigate over. Currently, it is just a single background image, but I would like to make it tiled map. How do I properly keep track of player coordinates?
Currently what I have working is:
1) I have a 800px wide by 500px high playing area 2) The player is normally positioned in the center of the screen at approximately (400px x 250px) 3) When the arrow keys are pressed instead of the player moving the map moves. I am currently using background-position at the moment to set which area of a background is displayed.
What I am currently trying to wrap my head around:
4) When the map reaches the boundaries it will no longer scroll, but my player is stuck in the center. 5) How to get the player back to the center again when they start to travel away from the corners.
The main problem I am having is knowing what coordinates I should be keeping track of. For example, should I be keeping track on only one of the following, or all three of the following:
- Player position in map
- Map position on screen
- Player position on screen
What is a standard way to handle player movement like this?
- ‘Overwatch’ Rialto Map Hitting PTR
- Fortnite Moisty Mire treasure map location – where to search and how to finish the Week 9 challenge
- Is the VR Universe in Ready Player One Possible?
- 3D Mapping and 3D Modelling Global Market 2018 Key Players,Share, Trend, Segmentation And Forecast To 2025
- Map Selection is Coming Soon to PUBG
- Google Maps brings Street View to the International Space Station
- Evansville Police Scanner and Daily Crime Map
- The Automated Material Handling Market is estimated to hit $32.36 billion by 2023
- Why owners of Twitter’s rarest names turn down THOUSANDS to keep their handles
- MSU's top 50 football players: No. 1 George Webster