Coding at Home: July 3rd, Sonic Workshop #4

Join us today for some more functions at 1pm, Irish time!

Super coders!

You guys have written some amazing code at this stage! I hope you had some time to play around with that touch moved code. We were using a bit of math to figure out where the x position of our touch was, then we divided that by the width of our graphic. This was just to get us a number to plug into the Color initializer. And it was a little bit to show off how we get the updated position of the user’s finger on the graphic.

We fed that color into the setTintColor method on our graphic to visually show how often that new handler we set gets called.

Today’s session

Today we’re going to add a touch handler for when someone presses on the graphic.

We’ve done this before in previous pages. But this time we’ll use some of the other functions defined by the playground for playing music.

We’ll spend a lot of time customizing the behavior of our graphic when we tap on it. And we’ll also spend some time exploring all those messages to our onTouchMovedHandler. Maybe we can come up with some other use for them?

You can get as creative as you like with your function names, you just may sacrifice your sanity with some names.

We’ll see you at 1pm!

Leave a Reply

Your email address will not be published. Required fields are marked *