I have made a rhythm game engine using javascript and the library processing.js, and it’s open source, and actively in development. Here’s a demo, recorded on my very lame computer:
Track my progress
Features
- Converts any .sm text file into note information with time values in seconds
- Handles any changes in bpm without changing scroll speed
- Supports multiple difficulties in one file
- Displays notes with a vector-bases noteskin, which has potential for more visual effects
- Supports different scroll speeds
- Code infrastructure has support for more than four keys
- “Controller Visualization” displays theoretical play using a new controller concept (i.e. it's a controller with two buttons for each arrow direction, played with one button above and below each finger)
- Accepts input and allows you to hit notes (make them disappear) and it send the accuracy information to console.log
- Handles any changes in bpm without changing scroll speed
- Supports multiple difficulties in one file
- Displays notes with a vector-bases noteskin, which has potential for more visual effects
- Supports different scroll speeds
- Code infrastructure has support for more than four keys
- “Controller Visualization” displays theoretical play using a new controller concept (i.e. it's a controller with two buttons for each arrow direction, played with one button above and below each finger)
- Accepts input and allows you to hit notes (make them disappear) and it send the accuracy information to console.log
Why is This a Thing?
The point of open source projects are to push an industry or product forward, and change the status quo, this project is intended to:
- Put some skilled coders to work
- Make me better at coding, and fill my spare time
- Get people to consider the possibilities and give people on FFR something to be excited about
- Make the best dang rhythm game we can, and fill it with new, awesome features
- Make me better at coding, and fill my spare time
- Get people to consider the possibilities and give people on FFR something to be excited about
- Make the best dang rhythm game we can, and fill it with new, awesome features
How to Use This Program
1. Get a .sm file
2. Get an audio file
3. In code.js, edit the line: String lines [] = loadStrings("FILEPATH.sm"); to include your file.
4. In code.js, edit the line: var audio = new Audio("FILEPATH.abc"); to include your file.
5. Open main.html in your browser. Due to Chrome and IE security protocols, if you're running it locally, you need to open it in Firefox.
6. There are several options:
. Change your scroll direction by changing line 22 in code.js, either "Up" or "Down"
. Change your offset by changing the value of manualOffset on 72 in code.js
. Turn the controller visualization on or off by changing showController on line 23 to either true or false
. To set your own keys, you need to change line 343 to the key codes of your preferred setup
2. Get an audio file
3. In code.js, edit the line: String lines [] = loadStrings("FILEPATH.sm"); to include your file.
4. In code.js, edit the line: var audio = new Audio("FILEPATH.abc"); to include your file.
5. Open main.html in your browser. Due to Chrome and IE security protocols, if you're running it locally, you need to open it in Firefox.
6. There are several options:
. Change your scroll direction by changing line 22 in code.js, either "Up" or "Down"
. Change your offset by changing the value of manualOffset on 72 in code.js
. Turn the controller visualization on or off by changing showController on line 23 to either true or false
. To set your own keys, you need to change line 343 to the key codes of your preferred setup
How to Contribute to This Project
- Download it and use it
- Post in the thread about having used it
- Post in the thread about things you do/don’t want it to do
- Try to understand the code
- Ask things when you don’t understand the code
- Write your own code, and submit it to the GitHub page
- Teach me how to use GitHub
- Help me write a better formatted OP
- Start your own project, and make an even better engine
- Post in the thread about having used it
- Post in the thread about things you do/don’t want it to do
- Try to understand the code
- Ask things when you don’t understand the code
- Write your own code, and submit it to the GitHub page
- Teach me how to use GitHub
- Help me write a better formatted OP
- Start your own project, and make an even better engine
Bugs, Issues, or Oversights
Todo
X Handle input
- Interface for selecting songs within a folder
- Interface for options menu
- Results screen
- Return to home screen after results screen
- Crazy ideas that are only relevant once the other todo’s are done, like:
. scoring
. results graphs
. support for held notes, mines, and pull-off held notes (i.e. like osu!mania)
. visual effects on note hit
. difficulty calculation algorithm
- Interface for selecting songs within a folder
- Interface for options menu
- Results screen
- Return to home screen after results screen
- Crazy ideas that are only relevant once the other todo’s are done, like:
. scoring
. results graphs
. support for held notes, mines, and pull-off held notes (i.e. like osu!mania)
. visual effects on note hit
. difficulty calculation algorithm
Technical Overview
View Documentation
Parses .sm file:
1. Converts text into an array of strings, one string per line of the text file
2. Finds title, artist, offset, and bpms
3. Finds the line number where the notes for each difficulty starts, and associates the names of the difficulties
4. Using the bpm and information about the measure, associates each note with a time position
2. Finds title, artist, offset, and bpms
3. Finds the line number where the notes for each difficulty starts, and associates the names of the difficulties
4. Using the bpm and information about the measure, associates each note with a time position
Displays notes:
1. Based on the size of the display region, scroll speed, and receptor position, determines the range of times that can be displayed for a frame
2. Populates an array with the positions of the notes to be displayed on screen
3. Draws receptors and notes
2. Populates an array with the positions of the notes to be displayed on screen
3. Draws receptors and notes
Displays controller visualization:
1. Finds next note
2. Based on a set of rules, determine the point to which the hit-circle must move next
3. Determines distance of the nearest note from receptors
4. Determines the percent of the distance to the receptors that the note has traveled since it was first found
5. Display the hit circle based on that percent and its destination and origination points
2. Based on a set of rules, determine the point to which the hit-circle must move next
3. Determines distance of the nearest note from receptors
4. Determines the percent of the distance to the receptors that the note has traveled since it was first found
5. Display the hit circle based on that percent and its destination and origination points



(excerpt of some functions with the content of your comment)
(class tree)




good luck with the rest!


Comment