Also for Richard, is there a reason there isn’t a way to detect the Escape key? “Any Key” does detect it, though there is no way to only detect it, unless you manually checked that the key pressed was not any of the others.
I have wanted this exact button before!
on keyboard press with (button)
set string string.join string, button
no there isn’t a way to get the value of the generic event.
the reason i left out the escape key is because that key is typically reserved for accessibility purposes in the browser (e.g. navigating through the page)
Hmm… what is the “flags” attribute for the control.onEvent() function for?
Edit:
Also y’all, as you’ll see in my next post that hasn’t been approved yet, I did get key binds working, but after changing them you have to reset the sim before they apply. I might just go the easy route of “control.reset()”ing after you change them, but I can’t see a reason I should have to do that. I think I know why they aren’t being applied, just haven’t fixed it yet is all.
Edit 2:
Never mind, I fixed it. The issue was that I was applying the event handlers while in the system menu, so once the system menu closed the new events disappeared.
Dev log:
I DID IT! I MADE KEY BINDS WORK! LETS GOOOOOOOOOOOOOOOO!!!
There is still one particular kink to work out, that being pressing enter twice when selecting the key you want rebound will make you press the key you want twice before it will be deselected, which is a tad annoying, but it should be an easy fix. I’m just pushing the update without fixing it because I want people to have this update asap and the bug isn’t game breaking. Your key binds, note up/down preference, and your sound delay are all saved with settings!
Very short dev log: sustain dots work now… maybe..? I just keep finding bugs. I spent an hour trying to do weird state stuff before I gave up and just turned a Boolean into a number so that I could have a progression of states, those being “long note hit”, and then “long note ended”, whereas before it was just “note hit”.
Edit: I just figured out how to find which line the note is playing on, not just the note that it will play, so now all instruments work for creating sustain dots. (The drum is used to create single dots)
Yay!
message I deleted
Very annoyed right now. I tried to download to PyGamer, one of the variables in a targetOverride is called “delay” which is a variable I’m using already (why is it not in a namespace?). Restoring using version history does not undo this conversion to a PyGamer file (richard why??) and I can’t find a way to remove these targetOverride files, so I’m just gonna copy all the code into a new project with a new share link. I’ll ask the mods very nicely to replace the link at the top of the topic with the new one, usually that works
Closing and opening Makecode removes the console preset. All will continue as normal. I felt like showing this because it’s good to know that everyone makes silly mistakes and it’s not a big deal!
Finished adding sustains to @InvalidProject’s song, working on designing a menu system, as well as save system for scores, etc. Changed stat screen so that different % scores show up as different colors. 90+ green, 70+ yellow, 50+ orange, 0+ red. Idk if those numbers will change, idk. I think 95% should be considered the best you can reasonably achieve on a track. My best is now 99.0% on Inval’s song.
Thanks for pointing this out that’s annoying, I put up a pr to fix it for next release
this is gonna be so cool!!!
Dev log: MENU!!! You can scroll through songs with the mouse wheel or use up/down arrows! I’m very proud of how well the smooth scrolling works You can select a song by left clicking or by pressing A. The first click will show information about the song: Title, Composer, Dot pattern composer, difficulty, and your current best score. Clicking on the same song again or pressing A again will play the song! If you didn’t know already, key binds can be changed via the system menu, which you can only open if no song playing. I’ll be making more tracks using “free music” topics, but if you want a specific one please provide the topic and/or Makecode share link. Make sure to credit the composer! If you want to try your hand at making your own dot tracks, you can look at the comments at the bottom of the main.ts file. I’m gonna try to make an extension that lets you do all this in blocks, but for now that’s your only option.
ooo i love this! adding lil thumbnails and album cover art would be a really nice touch too
i did smthing like that with my Working Music Playlist!
Making your own dot patterns! In blocks!
I haven’t added this to my Github, so it’s more of a template project than an extension. To use the “extension”, you just make a copy of this project for yourself!
You can pretty much tell what I’m doing just looking at the example in the template project, but here’s everything I added, in order from top to bottom in the new “Fmusic” blocks tab (ignoring the obvious ones)
Blocks
Play (song... dots...)
- This plays the first track as music (after a delay), and at the same time “plays” the second one, creating dots instead of sound. (that fall in time to hit the correct spot at the same time the delayed music plays) You can put one after another and they will work exactly the same as playing music normally!
When your song is played {...}
- Code in here runs when you click on your song in the menu. Make sure to use a “draw background (colors…)” block at the top to draw the background and lines. Then you just put the song stuff you want to play in there to make it play.
Draw background with background (color)...
- This block draws the background. You can also choose to update the position of falling dots, which is useful if you have changed the line width. It is a good idea to use this at the top of your “When your song is played…” block.
Set your song info...
- Put this in the On Start block to change the info displayed when you click your song in the menu. The percentage displayed in the menu is determined by that “total points” input, so make sure to play your song to find the maximum points possible and change that number accordingly (the “# / #” part of the song stat screen will count for you, so you don’t have to play the song perfectly to count points. Just let it play and then that second number be the correct points count)
Set line spacing ()
- This controls the space between the lines. Changing this number only changes where new notes spawn, and you’ll need to use the “Draw background” block to actually re-draw the lines and move already falling notes to their correct x position. This is defaulted to 16, so if you aren’t making fancy line movements like I made for the template project, you can just ignore this block.
Reset your song data
- This block resets the saved high score of your song.
Reset save data
- This deletes all saves settings, like high scores, key binds, and other preferences.
When drum 5 plays {...}
- This function runs when you use the 5th drum in the dots track. The first 4 drums are the ones that create single dots, so the 5th drum is the one right under those. It runs when the note would be created, not when the note would hit the line, so you may have to fiddle with timings for certain effects.
Copying song data from another project
To copy music data from another project, you need to go into the javaScript and copy the hex data. If you double click on the data, it should highlight all of it, even if it goes off the right side of the window with a “…”.
- Copy the data. (ctrl + c)
- Go into your copy of the template project and drag a new “Play song (…) dots (…)” block into the “On your song played” block.
- Convert to JavaScript.
JavaScript of the newly dragged song will look like this:
The data in there is stuff like the default temp, number of measures, etc. There are two sets, the first is the music data and the second is the dots data. - Double click the first bit of hex data to highlight it.
- Paste your copied hex data to replace the highlighted data.
- Just like when you double clicked the song data the first time, you have been automatically scrolled to the end of the pasted data. If you want to, scroll a bit more to the right and highlight + paste the data into the second hex spot as well. This will copy the song data into the dots track, which makes creating dots for the track a lot easier (imo) because you can listen to your song and see what is happening in the song while creating the dots. Just make sure to remove any unwanted drums or long notes from the top 5 rows so that the song data won’t create dots you don’t want.
If you have a lot of song tracks to copy, you can copy the whole block of song data, drag the same number of song+dot blocks into the project, and then paste all the song data into the javaScript somewhere and copy the hex from the block of song data into the song+dots blocks. That way you don’t have to repeatedly open and close the projects.
cool game is this gonna be in the sound game jam
I feel it might be a bit unfair to have it be compared to other submissions, considering it’s so good so far into development already, as if I had a very large head start compared to everyone else. Might make something if I have an idea. I will “submit” it because I want them to play it on stream, but I’m not gonna compare it to other peoples’ entries cause that would be unfair imo.
all I have to say is I caught you in 8k
Starting development of my own song. It will probably be a Demon difficulty, because my best is just 92.1% and I’ve only done about a 3rd of the song. I’ll update the link as I compose!
acually since december 2024
Welcome to the forums!