Coding at Home: June 3rd, Reality Composer Behaviors

Join us at 1pm today on Twitch for some fun with adding behaviors to the objects in our augmented reality scenes!

Today’s Session

Today we’ll be playing around with Reality Composer some more. Sticking with our horizontal plane anchor, we’ll work on adding behaviors. This will let us explore how objects we place interact with each other with different settings.

This will involve playing around with physics and materials a little bit, to see which material and combination of settings gets you the behavior you want to see.

Since we’ve built a rocket ship scene, maybe we’ll add some planets to our project.

If you want to dive into more AR and just can’t wait for our next session, you might want to check out developer.apple.com. They have amazing sessions like this: Building AR Experiences with Reality Composer, which are very relevant to the work we’ve been doing.

Even if you just watch those for aspirational purposes, we’ll try and re-create some of their examples with you during our sessions. If you have a favorite you’d like to see, why not drop us a line in the discussions?

Catching Up

Like we’ve done with other video series, we’ve gathered the augmented reality series into a playlist. You can now go sit and watch all the videos here, on this landing page.

And if you’d like to catch up on any of our past sessions, we have the whole coding at home box set here!

We’ll see you on the live stream today at 1pm!

Coding at Home: June 2nd: Reality Composer, Continued

Join us today on Twitch at 1pm, Irish time for some more fun with Reality Composer!

First off, I want to apologize for those trying to follow the live stream for the last few sessions. It’s been pretty poor quality, and as hard as programming can be, it’s even harder when you can’t follow along the taps and touches we’re making on screen!

You can find all of our videos on our YouTube channel, and the recordings are what gets uploaded, so they should be much better quality than the stream.

Today: Reality Composer

Reality Composer icon

We’re back with Reality Composer again today. We’ll be going through the session we ran on Friday with a few improvements.

Like I plugged on Friday, this session, from Apple, is an excellent introduction to Reality Composer: https://developer.apple.com/videos/play/tech-talks/610

We’re going to add a few objects to our scene, give them some behaviors, and watch them run.

We’ll take it nice and slow and walk through some common problems you might see. Especially when you add more than one object to your scene!

So join us today for a little bit of fun, augmenting our reality!

Coding at Home: May 29th, Augmented Reality with Reality Composer

Join us today on Twitch at 1pm, Irish time, for some more augmented reality!

AR Makr

I hope you’ve enjoyed the AR Makr sessions; they’ve really built an amazing tool for telling stories. It’s a great way to try out augmented reality for yourself, and the way they allow you to create your own is brilliant.

I’ve loved seeing the odd planets people have designed and being able to walk through their creations!

Reality Composer

For today’s session we’re going to go into Reality Composer a bit more. Reality Composer is Apple’s app for building out scenes.

Slide from session 609, WWDC2019: https://developer.apple.com/videos/play/wwdc2019/609

A scene is comprised of an anchor in the real world: it could be a table top, a wall, an image, or a face. That thing, the table top, wall, image, or face, will be what we use to anchor the objects we want to add to our reality.

Reality Composer also lets us define behaviors for those objects and can have them interact with physics… but not just normal physics, like the regular gravity of your particular scene, you can define how strong or weak you want the pull of gravity to be!

There’s a great session from Apple called Get to know Reality Composer, which you can watch at https://developer.apple.com/videos/play/tech-talks/610.

More video sessions

We’ll go looking for some more great video sessions from Apple on this technology during today’s session. This will really pay off for us later this month, when all the Worldwide Developer Conference 2020 sessions start getting posted online.

Blast off!

So we’ll see you today at 1pm, when we’ll build our own rocket ship taking off, right in your very own living room (or wherever you’re watching this session)!

Coding at Home: May 28th, Augmented Reality with AR Makr!

We started our brave new series yesterday, all on augmented reality, or AR, for short.

We’ll be live today at 1pm, Irish time, building out an augmented reality scene!

Yesterday we had a whirlwind tour of AR Makr, Reality Composer, and the Augmented Reality playground from Apple to show you what we can do with augmented reality on the iPad. It also highlights the number of ways we can play around with AR!

Today’s session

Today we’re going to go back to AR Makr and build out a scene and play with some of the built-in animations.

One of the most difficult things I’ve found about augmented reality and building augmented reality apps or playgrounds is building decent 3D models to use in my real life scene.

AR Makr (and, as we’ll see with Reality Composer and the AR Create playground) has some amazing built-in models for us to use. And it lets us create our own in pretty fun, easy ways.

Our old Max the fox is back! (Borrowed from the Apple SceneKit sample code.)

So come catch up with us at 1pm today for some augmenting of your reality!

Coding at Home: May 26th, Back to Assemble Your Camera

Come back with us to assembling your camera! Live at 1pm, Irish time on Twitch!

Recap: Build an App in Swift Playgrounds

We may be done with live coding our aquarium app, but hopefully you’re not! There’s so much more you could do with the tools and techniques we’ve used over the last few days.

We added an array to track the number of ducks someone might add to our aquarium. Then we added a function to a button to line the ducks up as if someone threw bread in the aquarium for them.

Not bad for a week’s worth of work! Well, if you add all the time you’ve spent already, learning about Swift, you’ve definitely spent more than a week!

Now, you may not have gotten this far. We covered a LOT of topics and wrote a lot of code. Go back over the whole Build an App Aquarium series and catch up on parts you feel you might have missed.

If you didn’t quite get the rough contact testing we did, go back to that video and give it a re-watch. That might be a key for your app or game.

This has been a lot of material to digest. What we’ll see is that sometimes it makes sense to go back over previous code you’ve written to really understand it.

Today’s Session

The plan for today’s session is to go back to the Assemble Your Camera playground.

We were nearly done with building out our camera, so we’re going to finish it off over the next few days.

We’ll use the App class to organize our code, and maybe this will give us some ideas about how we can better organize our app or game from the App at Home playground.

In fact, when we review the code on the MyCamera class that notifies inputs of an image having been taken, you might start thinking about ways you could use that technique in your own game. Maybe for a fish that communicates with other fish in its school. Or in a squadron of enemy ships, when one gets near the player’s ship, notifies the others of their location.

You’ll be able to look back over a lot of the code you’ve written and begin to apply new things you’re learning. Or maybe just new things you’re appreciating, now that you’ve had a bit of experience coding.

See you at 1pm!

Coding at Home: May 25th, Build an App Aquarium Part 5 of 3

We’re back at 1pm today, Irish time! Come build an app with us, exercise those creative muscles!

The story so far

We’ve been building out an app using the techniques we learned in Everyone Can Code Puzzles and the Lights, Camera, Code sessions. We have a Space onto which we can place different components, like Buttons, ImageViews, Labels.

Using techniques from the Assemble Your Camera playground, we’ve wired up the buttons to perform actions in our own code!

You might have an amazing app right now that looks like a super cool digital aquarium. Or you might have a space-based game with a few tweaks to the images you use.

More tools today

Today we’re going to explore some more tools we can use for our game or app.

Arrays are great tools for keeping track of things in our apps. We’ll look at using them to remember all the fish we add to our app aquarium.

I’ll also show you a really handy feature of Swift Playgrounds for refactoring your code.

See you at 1pm!

Coding at Home: May 22nd, Lookback Session #3

Sign up to get onto today’s lookback session, where we’ll cover the beginner playground, Code Machine!

Even if you’ve never done any programming before, so long as you have an iPad, we’ll get you set up to start your journey!

Yesterday’s Session

In yesterday’s session (part 4 of 3, yes, you read that right), we built more of our app/game aquarium.

We added a stepCounter for our fish, we added a button to add more fish, we laughed, we cried. And we definitely debugged a bit, too.

We worked on some of those esoteric skills needed in development: tracking down an issue when it looks like you have everything set up right.

New Landing Pages

We added a new landing page where you can access each one of our playlists from the past 53 videos. Hopefully this will make it easier to follow along with a given series we’ve been running.

We’ve organized them into one mega-playlist, the first one, kids.code().

The next is just the videos for the Everyone Can Code Puzzles material.

Then we have the Lights, Camera, Code playlist, which covers both the Lights, Camera, Code and the Assemble Your Camera playgrounds if you’re a little more advanced.

Lastly, we have the current playlist-in-progress: Build an Aquarium App.

So if you’ve fallen behind on the live sessions, feel free to catch up on one of the playlists.

Or… you can do that and come join us for our lookback session today at 1pm! Just sign up on the registration page!

Coding at Home: May 21st: Keep Building your App in Swift Playgrounds

We’ll be back again today with our app project in Swift Playgrounds, live at 1pm, Irish time on Twitch!

Yesterday’s session

Yesterday we added a rough hit detection function to tell when we were near another component, which might come in handy if we’re building an app or game where we want to be careful for other objects on the screen.

To do this we looked deep inside the guts of the Swift playground to find the HelperFunctions.swift file, where there was a handy distance(from:) function defined on the Point type. This function did a lot of the hard work of figuring out how far away two points on our grid were from each other.

From there we could figure out if it would look like the images for those components were touching or not.

We also even added a Game Over label for our game, when we did detect a collision.

Today

Today we’ll be going back to the app just one more time, I promise!

We’ll add a counter for our game/app now. This will let us keep track of our score, whatever we determine that to be.

And the last thing we’ll do is add a label to show that score to the player.

See you at 1pm!

Coding at Home: May 20th, Build an Aquarium App, Part 3

Join us today for probably our last session on building an app in Swift Playgrounds! Live on Twitch at 1pm, Irish time!

There’s so much more we could do; we could spend weeks refining our work so far into a game or a full-fledged app.

Today’s Session

Today we’re going to focus on rudimentary hit testing… to see when one component we’ve added to the space is near another one.

We’ll use some functions defined for us inside the guts of the playground, including a method on the Point type called distance(from:). This will return us a Double, which we can use to figure out if two components appear to be touching or not.

This would be an important thing to calculate if we were to make a game where collisions with other objects might be a bad thing (or a good thing, depending on your game).

We’ll also harken back to chapter 10 of Everyone Can Code Puzzles and do some refactoring… we’ve been slapping code together without too much foresight thus far. Now we’ll revise our code a bit and make things that little bit neater.

A major goal of refactoring is often to make life easier for our future self: when we sit back down to go further with our app or game we’ll thank ourself for packaging code into a function or storing something in a variable so we could use it later.

See you at 1pm!