MagNus_Chrom Posted July 15, 2019 Share Posted July 15, 2019 Hi, I am new to coding and phaser 3. Here is what I am trying to do- I am have a world map that is draggable, and I want to add markers on the map of the cities I want to add. The cities are all stored in an array, myCities2. I have a plan to add a lot of cities and adding them through a function or loop will make it a lot easier than applying each city individually. Each city will link to a "demo scene" where the city name, city image and other relevant information will be passed and the city can be explored. I have build a lot of this in another file but each city and click event hast to be copy pasted and so on creating hundreds and hundres of lines of code and repetition, I am sure there is a better way and I know coding has a solution, as my coding friends tell me. Efficient code is my goal here. I have tried forEach(), and for loops but can't get them to add the images to the container with the map - as the map is dragged the cities need to be dragged along with it... Any suggestions? Thanks, Your help is greatly appreciated. myCities.js Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.