Answer the question
In order to leave comments, you need to log in
How to implement map generation?
I started to study phaser and game development in general, I decided to start with a top-down shooter. Here, it seems, everything is simple and there are no special problems. Now I want to complicate the task a little and make a map generation - just randomly place pre-prepared walls and obstacles right on the go when opening a new territory. I would like to make an endless map, but then after a few minutes of walking around the map, most likely, the game will start to slow down, and after a few more minutes it will terribly slow down. What is the best way to implement the generation and storage of the map outside of visibility?
Answer the question
In order to leave comments, you need to log in
The standard approach is to make objects outside the camera (i.e. outside a certain radius around each player) "inactive" and exclude them from processing and calculations.
By the way, "infinite map on the fly" is not so easy to implement. It's easier to generate the entire map, even if it takes a minute, mark all objects as inactive, and then connect them as players move around the map.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question