AndBM / helichrysum

http://abmichelsen.com/helichrysum/
GNU General Public License v3.0
0 stars 1 forks source link

Change background character based on victory #5

Closed AndBM closed 2 years ago

AndBM commented 2 years ago

It would be cool that instead of the Chancellor being the background character, it was the color of the previous winner, i.e. if Red won last game, the Red character was in the background.

The images exist in assets, and the information should be in the save object in the scripts. Probably we should assign each character a CSS class and write a script like

document.getElementById("BG").className = "RedCharacter";

I will look into it later.

alexrutar commented 2 years ago

I think you can just modify the background image directly: something like

document.body.style.backgroundImage = "transparent url(../images/Oath-Character-Art-Chancellor-optim.png)";

or whatever the image file name is.

alexrutar commented 2 years ago

This should be done. Preview at dynamic-bg-image.helichrysum.pages.dev

alexrutar commented 2 years ago

I also rebased on top of the code-cleanup branch since I had made some changes to the javascript files, and also did some renaming there too, so this will fix some issues in the future.