How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.
Chilly14
Snifit
Snifit
Posts: 230
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?

Postby Chilly14 » Tue Jul 30, 2019 10:57 pm

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.

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?

Postby Enjl » Thu Aug 01, 2019 5:01 am


Chilly14
Snifit
Snifit
Posts: 230
Joined: Thu Jul 18, 2019 10:28 pm
Flair: wash your hands and stay at home
Pronouns: he/him

Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?

Postby Chilly14 » 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?

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9491
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: How do I make it so that Bullet Bills or other NPCs constantly spawn from the horizontal sides of the screen?

Postby Enjl » Thu Aug 01, 2019 1:53 pm

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)


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 2 guests