Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Music made by Unsigned Arduino #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agent14bricks
Copy link

Just added the music into here. It is made optional for lag purposes.

Just added the music into here
Copy link
Owner

@ractive ractive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey cool - music. 😀

Would be really nice to use camelCase in the variable and function names.

I'm also wondering why the arguments key_number, from_color and to_color are not used in the play_note function.

} else { return }
}
music.stopAllSounds()
function play_note(freq: number, length: number, key_number: number, from_color: number, to_color: number) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key_number, from_color and to_color are not used. 🤔

Names in JavaScript/TypeScript are always camelCase, so this function would be called playNote.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw I did not make most of the code, I mostly just injected it into the game.

function play_note(freq: number, length: number, key_number: number, from_color: number, to_color: number) {
music.playTone(freq, length)
}
play_song()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to playSong.

@@ -11,7 +11,2468 @@ Players.addPlayerOne();
if (twoPlayerMode) {
Players.addPlayerTwo();
}

if (game.ask("Do you want Music?", "May Increase Lag")) {
let stop_music: boolean = false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename to stopMusic

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this flag ever set to true?


timer.background(function() {
function play_song() {
stop_music = false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indendation is broken from here on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants