Join Lynn Langit for an in-depth discussion in this video Creating a conversation, part of Learning Visual Programming with Kodu.
- We've seen how to make a number of changes associated to an individual object to make the object richer in a Kodu game. We've added visual motion, we've added sound, we've added perspective. Another thing that we can add is the ability to talk to another character, or just talk in general. This is expressed through programming the character, as well. To do this, we're gonna work with both our Kodu and our Rover. Right now, they're not saying anything to each other. To get started, I click on the Object Tool. Then, I click on the Kodu, and then I'm gonna right-click and say, "Program." Now, when he bumps into the Rover, or sees him, I want him to talk to the Rover.
We're not gonna have the WHEN condition blank. We're gonna have a WHEN condition that indicates that. Let's say, "WHEN he bumps the Rover." I have to see what kind of thing this is. Let's see, it's not one of these things, and it is not one of these things. It is the Rover. Does it have to be an instance of the Rover? I think because we have one, we don't have to put the color, although we're gonna have to test this. I actually can't remember. If you have multiple, then you're gonna put the color, cuz that indicates the instance.
So, then, I'm going to do something. What I'm gonna do here is I'm going to say, "Hello." This is an interesting capability of Kodu, if you put an object in angle brackets, it actually turns it into the object, so it's kind of a fun thing. So, "Hello Rover." Again, I'm not sure this is gonna work because I didn't put the color in, but there's an easy way to test that. I'm gonna leave the first-person camera on, cuz I'm gonna be able to see the Rover close up that way. Let's go ahead and play the game.
We gotta find the Rover. Let's go over here, and let's try to bump into him, gently. I guess I should put a "move quickly" on here, cuz we're moving kinda slow. There we go, let's see if we're gonna get this. This is interesting. I can't see, because I'm in a first-person view. So, first of all, I don't know if it worked. It's a grey Rover, so we're gonna test that. Second, I need to change the perspective. In order to do this, let me go ahead and go on the Kodu. It's not gonna hurt anything for me to put a grey Rover on there, so I'm gonna say, "grey." Let me go ahead and say, "WHEN this happens, then I wanna go back to a different perspective." Then, I want this to occur at the same time, so I'm gonna indent it.
So, it's WHEN I bump, I say something and change the camera angle. Let's see how this works. We're on our first person. Let's go ahead and try and bump into him. Whoops... I am not being a good driver today. Let's see... Am I bumpin' him? I'm just having a really hard time with this camera angle. So, let me take that off, and this is typical kind of debugging that you'll end up doing in the real world, so that's why I'm leaving it in the video, here. Let me take this line off, cuz this is causing me problems.
Let me run this again, and now I can see what's going on a little bit better. This is a real common sort of process you go through with your students when they're exploring camera angles, because you can't see things sometimes that you need to see. I am bumping him, so perhaps the color of the Rover is not right. Let me go in here. Again, objects are not identified by the number, they're identified by the color. Let me take this grey tile off and see if that will do it. This is the first movie where I've been showing a little bit of the interactive, I call it the debugging, experience.
As you get into more complex programming, you're gonna find that you're gonna do this a lot more often, so it's kinda good to show it. There it is! "Hello, Rover." You notice, it just popped up once. We were able to, through this interactive process, figure out what we needed to change to get this to work. What we did is we set the bump condition, and then we added the say tile, and then we did an indent. We really wouldn't need this camera angle anymore. It's redundant, so we can actually take that off. If we wanted to work in this say tile, we would just double-click it, and "you are really cool." We could save that.
One more time, we're just gonna go through this and play it just to make sure it's the desired effect. Don't wanna hit the tree... Boy, I need a path here, don't I? You remember, back to the previous movie where I was showing paths. There we go! That's conversations.
- Installing and starting Kodu
- Using the Make Land, Water, and Mountain tools
- Exporting and sharing files in Kodu
- Downloading and playing a game
- Adding objects to your game
- Programming object behavior
- Building paths
- Adding emotions and sounds to a character
- Creating advanced two-player controls
- Using the health meter
- Controlling sound