Word Chain Dev Log #4

This is a continuation of a previous post.

This is a belated post of work from last Friday. I was planning on writing up a post then and continuing work on Saturday but our apartment got bedbugs and had to be prepared to be treated by today so I had to deal with that. 😦

The game started looking like this:

Word Chain Game Screen Day 3

And ended looking like this:

Word Chain Game Screen Day 4

I was concentrating on polishing up the turns system and giving more feedback. At the start, the only thing that alerted a player that it was there turn was when their screen showed the controls. If they weren’t watching their screen and hadn’t been paying attention to the turn order they would not know it was their turn. I added a highlighted border around the scoreline of the player whose turn it is and a sound that plays on their phone. This sound automatically worked even when my phone’s screen was turned off so I am very happy about that. I wish I could make their phone vibrate as well but I could not find an easy way of triggering that via Javascript.

The score lines are all dynamically generated html elements. I spent a while trying to make it so that when a player’s turn starts, the class of the element is set to a predefined class in the CSS file.That way if I wanted to redesign what the highlighted scoreline looked like I would just change a CSS file and not any code. I am disappointed that I could not get it to work and did end up having to write all the highlighting style in code.

The sound was taken from JumpJump but it is not just a simple sound file. It is an array of data that is used to dynamically generate the sound.

var sounds = {
coin: { jsfx: ["square",0.0000,0.4000,0.0000,0.0240,0.4080,0.3480,20.0000,909.0000,2400.0000,0.0000,0.0000,0.0000,0.0100,0.0003,0.0000,0.2540,0.1090,0.0000,0.0000,0.0000,0.0000,0.0000,1.0000,0.0000,0.0000,0.0000,0.0000], },
g_audioManager = new AudioManager(sounds);

The library being used is jsfx, a Javascript library inspired by sfxr. It has a sound generator interface very similar to sfxr that output the array of data. All this means you don’t have to package up any audio files with your game and you get interesting retro sounding effects.

It will be a while until I work on this again. Today was my first day back at NetherRealm and I will only have time to work on one side project. I will be working on Train and we’re hoping to have it finished by December. If I ever get time to work on this again, I will be working on a back end script that takes in pairs of words, processes a graph of those pairs and then outputs word chains to a json file. That way I won’t know all the chains beforehand and I’ll actually have fun playing the game!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s