Home Artists Posts Import Register

Content

i don't think i've talked about code in a while so i wanted to explain how i made the music player for my new game! (releasing this weekend???? AAAA)

ren'py has a built-in feature called the Music Room, which is normally meant as a bonus gallery you can go into at the end of your standard visual novel. but it totally works as its own little screen in the main game as you play!

the only issue if you use it this way is that you can't allow rollback, because if you change the song, it changes in rollback too... but since the chatlog is on screen the whole time, i figured it was fine to disable rollback for this game anyway :)

the music player screen

when you start a new game from the main menu, it plays the first song in the list, but if you've already beaten the game it plays a random song! this was more important when i kicked you back to the main menu between playthroughs, but i don't do that anymore, so... now it's just for whenever someone comes back to the game later i guess. (more installments??? MORE INSTALLMENTS??????)

the rest of the screen is the little buttons i drew (i put them in the same order as windows media player haha), and the song title + artist. each track has a number, so when that song is playing it changes to that number, which shows the corresponding song/artist name from each of my lists.

the only bug right now is that if you focus the buttons with keyboard going left to right, it skips over the play/pause button because i needed the art to overlap... so annoying...! sorry keyboard/gamepad players, i don't know how to fix this for you just yet.

unlocking songs

i decided to make the bonus songs unlockable since there were 4 "good" endings, and 4 bonus songs. i wanted people to listen to Jaelights' original tracks first, so that your first impression of the game is the original music! also... unlocking things just feels good... it was nice to add an extra reward that you can enjoy during subsequent playthroughs.

so right before the credits (if you hit a new ending) it'll play the new song for you!

the way the music room works is that songs can be unlocked if you hear them at any point during the game (since it's meant as a bonus gallery in the first place). this meant i needed to actually start playing the new song for it to get unlocked, rather than just telling you it's unlocked now and letting you go to the song yourself like i originally planned...

so in the game script, i save which ending you saw (since all endings jump to the same label), check if you got a new one during your playthrough, then play the song

an unfortunate bug with this right now is that because i'm playing the music normally instead of with the music room action thingy, it loops the song instead of going to the next track in the list. i THINK i can fix it, so i'll try to do that before release lol... it's a small bug so i don't mind people just clicking to the next song manually (which solves the issue). hopefully they won't just leave the bonus track on forever tho..... ahhh i should really fix this...........

anyway this is what the screen code looks like for the gif above:

i wanted to fadeout whatever song was playing before abruptly switching tracks, so i needed to use my "delayappear" transform (which just keeps the alpha at 0 for a split second before dissolving in normally), otherwise you're presented with too much info at once and it's hard to absorb. little game design things!

the game is almost done aaaaaa

the last feature i want to add is a little dropdown menu that shows all your songs, but it's low priority... gotta finish the art first...! so we'll see if i have the time and energy to add it! i'll probably add it in later updates (got some translations planned!) if not for the initial release.

THAT'S ALL FOR TODAY! thanks for reading <3

Files

Comments

Yajoovya

You didn't answer my question about Teen Titans in the APoC Q+A event!!!!?!??!! Or the one about the doughnuts!!??!?!!!! hOw dArE yoU i'M uNsUbScRiBiNg Nah, just kidding. Thanks for answering my questions in Another Piece of Candy! I've read webcomics for several years now, and I felt really honoured to actually be part of one! :) Interesting to read this stuff about music, too!

nomnomnami

you really had so many good ones!!!!!! i'll be writing strips in the future that touch on some of them so u better look forward to it hehe

Anonymous

Oooh... Certainly curious what questions you submitted; the Mochi and Treat ones were very powerful. BUT I SUPPOSE I SHALL FIND OUT IN THE FUTURE...!!!

Anonymous

I am nervous…and excited. Nervoucited? 0_0