Topic was automatically imported from the old Question2Answer platform.
Asked By
Leandro
Greetings… I’m developing a shmup. Each stage background will be composed of cyclic parallax images, no big deal, but on each stage enemies will appear on predetermined time and screen positions. Currently my already made enemy ships simply are dumped on screen at a -100 y coordinate, but I now I think about a counter variable (that will of course be changed according to delta) in such a way that if the counter reaches a certain value, it’ll add a certain enemy at a certain position, and so on.
But I have no idea about how to do it in a less tiresome way, or if is there any other way to do it instead of my solution. Any ideas?
I am making a similar game, but in my game there is a moving camera. I use VisibilityNotifier2D node. Make sure the enemy doesnt move until screen_entered signal is emitted
If your camera doesnt move, maybe you can have a Path2D that moves through the camera, and place the enemies and obstacles in a Pathfollow2D node?
Someone gave me a simpler solution: I simply put visually enemies on the 2D editor. I did not know that if I added objects above the screen, the visual area on the editor would expand. I’m simply adding enemies on it and changing their scripts to make them move vertically and get active only when they enter the screen.