MichaelSinsbeck / platformer

A ninja platformer written in LÖVE
7 stars 0 forks source link

Pass optional seed to parallax:init()? #240

Closed Germanunkol closed 9 years ago

Germanunkol commented 9 years ago

At the moment, the parallax background is recreated by every level, so the menu also needs to recreate it every time.

This means that the background is generated randomly every time, which may be a bit weird. We could add an optional parameter to the parallax:init function which is the random seed - then we could force the menu to always generate the same parallax background...

michalove commented 9 years ago

That is a good idea. I also noticed, that every time you die, the background jumps around. That should not happen either. That could simply be avoided by passing the level-number as a random seed (or only generate the background, when the level is loaded from file, not when it is started.)

Germanunkol commented 9 years ago

I like the idea of giving the level number as the seed. Then we could maybe pass something like -1 as the seed for the menu.

Will you do this?

michalove commented 9 years ago

Sure.

michalove commented 9 years ago

I implemented it a bit different, but the effect is the same: in the menu the background is always the same and in each level the background is only created, when the level is loaded.