- So it's time to make our sound a bit more interesting.…In order to do that I'm gonna need to do a little setup.…So I'm gonna go down here into my mousedown section…and in addition to just creating an oscillator,…I'm gonna set a few things up.…So first is make sure that I keep track…of the position of the mouse when the button is clicked.…So I'm gonna reset mouse x position to be e.clientX.…That would be, essentially the position of the mouse…through the event as the mouse was pressed.…
We of course need to do the same thing for the y-axis…so we'll do that here,…and we'll also keep track of the original mouse position.…We're not gonna use this for right now,…but I'm also gonna keep track of the position…as the mouse starts moving,…so we're gonna need to set this up here…and it will pay off a little bit later.…so we'll so original y position, and that's going to be…the same thing as mouse y position.…And as I explained earlier,…we don't really need the original x position because…the application happens to be the full width of the browser.…
Visit other courses in the series to see how to solve the exact same challenges in languages like C++, C#, Java, PHP, Python, R, Ruby, and Swift.
Skill Level Intermediate
1. Problem One - Exploring Lake Pend Oreille
2. Problem Two: Image Analysis
3. Problem Three: Eight Queens
4. Problem Four: Accessing Peripherals
5. Problem 5 - Recursion and Directories
6. Problem 6 - Building the Web
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.