Week 2 Dev Log


Week 2 - Switchtosis

Things implemented:

- Functioning level

- Combo system

- Score system

Implementing the notes into the level

This was my main roadblock for the game throughout this week. Initially, I had planned to pre-place each note within the level and have them fall at a certain speed. Then each button at the bottom would have a box collider to interact with each note. Each note would have:

- A rigidbody2d

- A Circle collider2d

- A script: This script checked if the correct button was pressed on the collision of the controls on the bottom of the screen. If was pressed correctly, then it would destroy itself and add score via the scoreManager. If it had reached passed a certain Y point, it was also destroyed.

However, this process of placing each note, then playing the game in order to see if it was in time, was sure to break my sanity before the night had ended. So that whole system was scrapped.

After searching for a while, This video made by SkyanSam on YouTube was very useful. 

How this system would work is that the track for the game would be inserted into a DAW, such as FL Studio or LMMS. Then, using keys on the keyboard to map out each note, you could create your own beat map to import into Unity. By mapping out the notes, the midi file can then be read and translated by a package called DryWetMIDI. Each note within the midi file was given a lane in game for it to spawn at the correct time. Since my game had 8 buttons to control in total, I needed to assign each button a musical note. So I created the diagram for what each button should be pressed for each musical note below.

 


Re-Implementing the 'Switch' Function

The new script for each of the notes would allow each of the arrow key notes and the keyboard key notes to be pressed without having to actually press a button to switch between the two. So two separate scripts were created for each of the two different note types. The arrow notes script would check if the switch was inactive before allowing the user to use those buttons, and vice-versa for the key notes. A buttonManager script was created to toggle between the two control types, and to send the bool variable 'isSwitchActive' to each of the note scripts.

ScoreManager

The ScoreManager includes Hit() and Miss() Functions, called by each note. Hit() is called when a note is hit on time, it adds one to the current comboScore, and sets score to 30. totalScore is then calculated by multiplying the score by comboScore / 5, however this will have to change as the first current 5 notes give no score.

Miss() sets the combo score to zero (resetting the current combo).


Future plans

- Dialog box for blinky is still in development.

- More sprite work will be done this week as the method for creating beatmaps has been simplified.

Files

Build.zip Play in browser
57 days ago

Leave a comment

Log in with itch.io to leave a comment.