Implementing scrolling background layers and foreground interaction objects
Posted: Sun Oct 08, 2017 4:07 pm
Hi! So I'm working on and off on this space sort of exploring game. So far with some previous help here I implemented simple background infinite scrolling and that is great and all. But I'm having trouble now doing two main things.
1. How would I make multiple layers of background say stars so I can scroll multiple levels, background planets, asteroids etc. If someone can help me figure out how to even add one extra layer I bet I can do multiple layers. I'd like it so I can generate the content in the background off screen and then it scrolls on screen and vanishes, that way it can be totally different background and unique landscape all the time while moving in space.
2. How would I have pop ups of say monsters/asteroids/aliens and powerups appear on the same plane as the player, so I can have them scroll across and be collected as well? I'd like to be able to generate these too so they randomly appear over time. That is once something leaves the screen it shouldn't matter anymore, but when it's on screen it should be stationary in a spot to be collected (powerup) or a floating object (asteroid/aliens). I tried doing it but my item is just stuck in a quad and keeps resetting or something, which is useless.
I know this is a lot but I'm hoping someone can help/guide me so I can do at least part of these and then implement rest on my own from the ideas.
Github link of latest project release/code so far:
https://github.com/princessannabelle/Planet-Explorer-
Thank you for the advice!
1. How would I make multiple layers of background say stars so I can scroll multiple levels, background planets, asteroids etc. If someone can help me figure out how to even add one extra layer I bet I can do multiple layers. I'd like it so I can generate the content in the background off screen and then it scrolls on screen and vanishes, that way it can be totally different background and unique landscape all the time while moving in space.
2. How would I have pop ups of say monsters/asteroids/aliens and powerups appear on the same plane as the player, so I can have them scroll across and be collected as well? I'd like to be able to generate these too so they randomly appear over time. That is once something leaves the screen it shouldn't matter anymore, but when it's on screen it should be stationary in a spot to be collected (powerup) or a floating object (asteroid/aliens). I tried doing it but my item is just stuck in a quad and keeps resetting or something, which is useless.
I know this is a lot but I'm hoping someone can help/guide me so I can do at least part of these and then implement rest on my own from the ideas.
Github link of latest project release/code so far:
https://github.com/princessannabelle/Planet-Explorer-
Thank you for the advice!