10-18-2015, 06:15 PM | #1 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
JavaScript JavaScript Revolution
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 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 How to Use This Program 1. Get a .sm file How to Contribute to This Project - Download it and use it Bugs, Issues, or Oversights Todo X Handle input Technical Overview View Documentation Parses .sm file: 1. Converts text into an array of strings, one string per line of the text fileDisplays 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 frameDisplays controller visualization: 1. Finds next note
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. Last edited by Trumpet63; 06-30-2016 at 01:40 PM.. |
10-18-2015, 06:45 PM | #2 |
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: JavaScript JavaScript Revolution
vid is not available in germany
on a serious note, if I were to try to contribute to this if I find myself being bored during the semester, would picking up javascript be very hard if all I know is java and python? would it also be possible to set up an API doc for this? |
10-18-2015, 07:06 PM | #3 | |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Ah, that would be because the music is copywritten, I added a gif for you
Quote:
I'd love to, but... what is an API doc?
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. Last edited by Trumpet63; 10-18-2015 at 07:07 PM.. |
|
10-18-2015, 07:13 PM | #4 | |||
🡸Index🡻Is🡹Fun!🡺
Join Date: Dec 2010
Location: Auserd
Posts: 1,932
|
Re: JavaScript JavaScript Revolution
That's a nice song
__________________
Old Quotes Quote:
Quote:
Quote:
|
|||
10-18-2015, 07:37 PM | #5 | ||
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: JavaScript JavaScript Revolution
Quote:
Quote:
Java and Javascript both have dedicated code documentation syntax which can be converted into a fully functional API/HTML documentation within an integrated developing environment (such as Eclipse or IntelliJ in Java). It uses specific syntax used in comments in your code, for instance: By (automatically) generating an API doc of your whole project where each function and variable has been commented/documentated, you can get a library overview of your own project similar to the official documentation of a programming language including a class tree, function overviews, and variable listings. For example: It generally helps understanding code much better Last edited by Xayphon; 10-18-2015 at 07:43 PM.. |
||
10-18-2015, 08:13 PM | #6 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
That's gonna be a lot of work, but I'll look into it. I'm currently using notepad++ as my IDE, and my comments probably aren't very thorough right now, nor are they in the right format. I'm sure there's a plugin that'll do something like what you're talking about.
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
10-18-2015, 08:24 PM | #7 | |
Batch Manager
Game Manager, Song Release Coordinator
Join Date: Mar 2008
Location: USA
Age: 29
Posts: 14,860
|
Re: JavaScript JavaScript Revolution
Quote:
Also, what Xayphon posted is JSDoc format. There are parameters and return values for the functions, and it helps someone get an idea of what the functions are used for. PHPStorm and Brackets are two very solid IDEs for web development. The biggest issue I see in the current code (I know it's just starting out, but this should be resolved ASAP) is that basically everything is in one javascript file. Splitting up functionality into multiple files separates which file contains certain functionality, and it prevents code files from getting too large. On another note, airbnb is a good javascript coding standard. Running a JS linter through that current code is encouraged.
__________________
Last edited by DossarLX ODI; 10-18-2015 at 08:29 PM.. |
|
10-18-2015, 08:41 PM | #8 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
This is good! I will look into all these things.
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
10-24-2015, 03:58 AM | #9 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Made some changes to the OP:
- Bugs section has been moved to the GitHub page because it accomplishes the same thing much more elegantly. - Added a link to a doc I've been using to record the development I do for the project. Visit it if the thread seems inactive. I'm going to be working on improving documentation this weekend. After a huge amount of blood sweat and tears I found a documentation generator that supports the standard syntax, and also works. Don't suggest any others, I've tried them all at this point >_< Here's a sample of what the documentation program generates: It shows the documentation alongside the code, which I didn't view as an essential feature, but there it is anyways.
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
10-24-2015, 07:08 AM | #10 |
Confirmed Heartbreaker
Join Date: Jul 2012
Age: 35
Posts: 5,858
|
Re: JavaScript JavaScript Revolution
Oooo
__________________
|
10-24-2015, 07:39 PM | #11 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Added documentation webpage to the OP. Site is hosted through gh-pages. (how cool is that!?)
I have documentation for the big 3 modules on there. Feel free to tell me how bad it is, but now I want to focus on adding the ability to handle user input.
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
10-31-2015, 11:53 PM | #12 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
BIG UPDATE! This is actually playable now... in a sense. You can press buttons and hit notes, and they disappear when you hit them! To set your own keys, you need to change line 343 of code.js: Code:
var buttonsKeys = [69, 70, 75, 79]; The first number is the key corresponding to the farthest left receptor, and then the next one it the second receptor, etc. To find out what key numbers your setup uses, this page will help. Your accuracy information is sent to console.log. I use firebug to see it, there may be another way. Please try this out, let me know if you can get it working and how it feels ^_^
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
10-31-2015, 11:58 PM | #13 |
Washed and Irrelevant D7
Join Date: May 2012
Age: 26
Posts: 1,804
|
Re: JavaScript JavaScript Revolution
glad to see how much progress ur making on this trumpet good luck with the rest!
|
11-1-2015, 12:01 AM | #14 |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Thank you
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
11-1-2015, 07:50 AM | #15 |
ur worst nitemare
Join Date: Jan 2003
Age: 32
Posts: 1,626
|
Re: JavaScript JavaScript Revolution
dude
h y p e
__________________
some feathery f**k |
11-1-2015, 01:25 PM | #16 |
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: JavaScript JavaScript Revolution
I like the progress you're making, documentation is understandable as well.
What bugs me still is the fact that everything is still procedural, meaning you have everything written in one .js file. This is fine at the beginning, but if we are aiming to move towards the functionality of the current FFR engine, a more object-oriented approach is needed for a better overview. Also question for keyCodes: Does JavaScript also have a getKeyCode() function? I'm asking because I just became interested in looking into making an options menu of some sort, with a way to make picking .sm files easier (which is a little bit too much for me right now, I want to get the functionality of having an options button on the interface and have something going on there done first, e.g. change your keybindings before I move to something like that). Let's hope this spontaneous interest persists for some time, provided I don't get lazy while trying to get used to JavaScript in the mean time. I also have to check the code again and see if you already have a loop that checks for interface interaction with mouse/keys, and, if not, see where I can actually implement that without fucking up any other procedure within the code.js class. Well, actually, would you mind if I try to use your code as a template and see what I can do? I could also try to split code.js into several classes... And another question because I'm not really a developer but someone who's interested in coding a little bit and practicing to get better: What program do you use for coding? Do I need some specific compilation program that I need to run in cmd in order to test things out? Edit: Yeah, I'm dumb, there are no "classes" in JavaScript like I know them from Java. I'll read up on OOP in JavaScript later, might be a good thing to just leave your code as is right now and check back later, as I'm clearly not obliged to point out errors yet without doing some read-ups beforehand, sorry for that Last edited by Xayphon; 11-1-2015 at 01:45 PM.. |
11-1-2015, 02:40 PM | #17 | ||
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Quote:
Quote:
Processing.js also has mouseClicked(), which is what I would use to do anything mouse-driven. The library has a lot of features that make certain things easier. I would search 'processing.js + whatever' if you're wondering what other stuff it can do. I know it's awful to look at, and I haven't updated the documentation with stuff from the input update either. I have a plan though. Maybe one or two more features and I plan on breaking the code into a few modules/files/classes... whatever you wanna call them. With JS, I believe the only way to accomplish this (without getting another library) is to load your module files in the main.html, making sure that your central controller module is loaded last. Then, if you defined your modules as functions, you can call those functions in your central module. This is essentially how javascript is able to use a library, because you're calling functions in your central module that exist only in your library.js file. Some obvious choices for modules are the .sm file conversion, and the draw notes loop that generates notePos[]... and the controller visualization, which I've now disabled by default because of the massive frame drops ;w;
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
||
11-1-2015, 02:48 PM | #18 | |
Mostly Ignored
Skill Rating Designer
Join Date: Mar 2011
Posts: 471
|
Re: JavaScript JavaScript Revolution
Quote:
Do you need cmd or anything complicated? Nope... but step 1 is downloading the game yourself and getting it to run. I don't think anyone has confirmed that they ran this program yet.
__________________
2014 October 7th 1:03 AM Zageron: Trumpet Trumpet63: yes, im here Zageron: You have a problem. |
|
11-1-2015, 03:07 PM | #19 |
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: JavaScript JavaScript Revolution
I'll try my best to find myself at home with your code, especially when I can test stuff on the fly.
The processing.js is actually really convenient. I know Java has different event listener libraries for e.g. key and mouse input, but they are seperated in different classes (e.g. KeyListener and MouseListener). We'll see how having these in one class makes things go, it'll be a new experience As for the code, no need to rush just yet, it's not even in the stage where multiple people are working at it. It's just you atm. As long as you understand your code, you should be fine. I'll somehow get into it xd However, if you are going to separate code.js in several modules/libraries, I'll have you know that it's probably not that easy to separate the code already at this point, as you may have to think ahead quite a bit while making sure everything still works as intended (which is the reason why I suggest that you do it asap). You could also consider making a UML diagram for better organization. If I may recommend some brainstormed really basic modules, you could try the following: - DrawController.js, a module that handles all the visual drawing snoop and goop like arrows and interface (this module should also be able to react to key, mouse, and more events that you might implement in the future); (gameloop goes here maybe?) - FileReader.js, a module for reading and converting .sm files (also has influence on DrawController.js) - Game.js, a module for game mechanics (uses converted .sm files from FileReader.js, uses Event.js, and should probably also include audio playing in here) - Event.js module for handling key and mouse events - Perhaps a class for initiating the game and instantiating all global varriables? (at least the constants, if they are statically accessible if that works in JS) edit: I used Notepadd++ for HTML and CSS stuff, atm I use Sublime though. I'll try to get the game to run while I'm at it Last edited by Xayphon; 11-1-2015 at 03:11 PM.. |
11-1-2015, 03:25 PM | #20 |
sausage
Join Date: Nov 2008
Location: Germany
Posts: 1,630
|
Re: JavaScript JavaScript Revolution
Could you give an example how you wrote a filepath in loadString() and new Audio()? All I get is a grey square so far
edit: nvm looked into the documentation edit2: still getting a grey square (both .sm and .mp3 are in the same directory as code.js) Last edited by Xayphon; 11-1-2015 at 03:35 PM.. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|