odanek / duel6r

Duel 6 Reloaded (game)
http://www.ondrej-danek.net/en/projects/duel-6-reloaded
BSD 3-Clause "New" or "Revised" License
13 stars 9 forks source link

Allow to specify 'background' for each level #76

Closed vsmejkal closed 6 years ago

vsmejkal commented 6 years ago

You can add 'background' property (integer) to a level JSON file to bind level with specific background.

odanek commented 6 years ago

Looks very good! I have only one note - Level constructor should not take Game instance in my opinion. Game is a large object and I would prefer Level to not be coupled with it. But it is a quick fix, I can do it.

I also think it might be better if we use filenames instead of numbers for backgrounds. Because when you say you want background 42 in your level it doesn't really say much and when the backgrounds change you might no longer know which background it was. If the background was identified by a string, e.g. "blue_sky" you would have much more information.