How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?
Posted: Tue Jul 30, 2019 10:57 pm
by Chilly14
Sorry if I've been asking a lot of questions lately, but I'm thinking about making an airship level. You know how that in some Yoshi's Island levels, Gusties constantly generate and bombard the player from the sides of the screen? I've been thinking about doing something like that in the airship level previously mentioned, but with Bullet Bills.
Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?
Posted: Thu Aug 01, 2019 5:01 am
by Enjl
Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?
Posted: Thu Aug 01, 2019 12:15 pm
by Chilly14
I meant that when the player(s) goes through the level, the spawn zones "follow" them. Can you show me an example code?
Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?
Posted: Thu Aug 01, 2019 1:53 pm
by Enjl
Chilly14 wrote: ↑Thu Aug 01, 2019 12:15 pm
I meant that when the player(s) goes through the level, the spawn zones "follow" them. Can you show me an example code?
Spawn them relative to the camera coordinates? When spawning you specify X and Y coordinates, and the player's camera (global variable "camera") has x and y coordinates, as well as width and height.
http://wohlsoft.ru/pgewiki/Camera_(class)