AISubs v3.5
Today, November 23rd, is Game Day! Did you all know about it?
In this show, we, Magizaka46, will seriously learn about game programming...
...and let our viewers experience programming for themselves!
That's because...
...programming has become a must for elementary school students since 2020, and it's the hottest skill right now!
Every Friday night, our show will air...
...and we'll share our charm with you, especially in easy-to-understand scenes!
Hello! I'm your navigator for today, Magizaka46's Sato Rika!
I usually watch the show as a narrator, but...
- Sato-san, too... - Yes?
- Today, you'll be programming a simple game... - A game!
- ...on the computer in front of you. - Yes.
That's right! I'll try making a game, too!
It's been a while, and I'm really nervous about programming and stuff like that.
- That's right. When you were a student... - That's right, when I was a student.
When I was in high school, I did a lot of programming with information systems like that, and I've done a lot of games, but...
I've never touched this "unity" thing before, so I'm really nervous.
Some of the software that allows you to program games is free, and it's easy for beginners to start with.
I'm in charge of a software called "unity" in the show.
I was using a different software, so my teacher, Mr. Takahashi Namata, rushed over and helped me out.
The creative game "Elegy Head" is by a genius programmer who has fans all over the world.
- Do you usually watch it through narration? - Yes, I always watch it.
- Speaking of which, Mr. Namata... - It's really hard for me to say.
But you're finally getting used to it.
Now, let's take a look at the game engine used in the show and the basic parts of "unity"!
"Unity" is a software that makes it easier to make games called "game engine."
It's probably the most famous game engine.
First of all, we're going to show you a sample of a super-easy game that even beginners can make!
- I've prepared a sample of the game we're going to make. - What is it?
- It's Mario! - Wow!
You jump and aim for the goal.
- Wow! It's so cute! - Like this.
- It's so cute! - And...
- Kirby! - And...
- You can move with arrow keys like this. - Wow!
- Yes.
- Wow! There are still some images left. - Yes, there are.
- This is also a feature of Unity. - Wow!
- Are you trying to add more images? - Yes.
- I thought it wasn't enough, so I added more. - When you realize it...
- Yes. - It's nice, isn't it?
- Yes, it is. - It's done!
- You're an expert at this. - Yes.
- But you can observe the details of the game. - Yes.
- It's perfect for game development. - Finally!
- And you aim for the goal like this. - Yes.
- Wow! It's so cute! - Yes.
- It looks fun! - It's a little difficult, though.
- It's true. It looks like an idol group. - Yes.
- You have to do it like that. - Yes.
You're good!
- Ah! - Ah!
- It's like a game over. - Wow!
- You're right! There are images left. - Wow!
- Yes. - Watch out!
- You can do it! - Wow!
- It's so fast! - Yes.
In fact, this kind of game can be easily created
if you learn programming that moves objects.
Actually, in this scene, we will place game objects and display them on the screen.
First of all, I think there is something like "heraldry", but please right-click here.
Right-click the mouse.
It's English.
That's right. Everything is English.
That's right. You can only copy and paste.
That's right.
Then, "to-the-object".
"to-the-object".
Then, "sprite".
"sprite".
It starts with "s".
This means "image".
I see.
Then, "square".
"square".
Please right-click it.
Then, everyone, can you see something on the screen of the game?
Yes, we can see "square".
What is it?
Now you can display objects.
Once you've displayed an object on the screen, you can move it.
To move an object, you need mathematics and such.
This time, Unity will automatically do it for you.
I didn't know you could do that.
There's a physical engine.
Physical engine?
Yes, I'm going to move it physically.
I'm going to add a function to this player's object.
Okay.
I'm going to select a player.
There's an "add component" option.
Okay.
It's physics, so it starts with "physics".
It starts with "p", not "f".
"p"? Why?
Is there such a thing?
No, there isn't.
It's "p".
It's "papipepepo".
"p"? Is it in the middle?
It's under "p".
Is it "p"?
Yes, it is.
It's "p" in 2D.
Yes, it is.
It contains functions related to physical engines.
I see.
There are many more.
Starting with "r",
digit body
digit body 2D
Please try it out.
Okay.
What is this?
You can move it now.
Wow!
Let's actually play the game.
Okay.
Click on this triangle button.
It fell! It fell!
It fell!
Yes.
It fell.
Yes, it fell.
Yes, but it's okay. It's correct.
Ah, it's because there's no wall.
That's right. That's right. That's right.
In this state, for this player, the map lens is working and it's gaining gravity.
Wow.
Yes.
And this "one" is gaining gravity and "one" is gaining power.
Yes.
So, everyone, please change the value a little. As you like.
And then, please play it again.
How much did you input?
Yes.
Mine is "seven".
That's right.
If the gravity value increases, the speed at which things fall also accelerates.
In addition, if you reduce the value, it also moves in the upward direction of the vertical axis.
In this way, you can move things quite easily in Unity.
Well, please think of "minus" as upward direction.
"Minus" is upward and "downward" is "plus".
But I saw it a little today.
The book itself is...
Ah, that's right.
It's really thick, isn't it?
It's really thick.
It's really nostalgic.
I pulled out the book I was using when I was in high school.
That's amazing.
I don't remember it anymore.
After all, Unity is different, isn't it?
That's right. It's a little different.
There are many unique things.
That's right.
It's something only those who play can understand.
No, that's right. It's completely different.
Now for the main topic.
We will make a game that can only be done with this element.
Mr. Nagataka, by the way, what kind of game would you like Mr. Sato to make for you today?
Basically, I'd like to move it around and think of a game that can only be played by moving it around.
I think "Iraira Stick" would be good.
"Iraira Stick"?
Yes, "Iraira Stick".
Do you know "Iraira Stick"?
"Iraira Stick"?
Yes.
It's a game that makes you feel irritated.
It's very simple, of course.
If you move it like this, it's like a goal.
And you have to go in between here so you don't touch it.
If you touch the wall, it's game over.
That's right.
It's very simple.
It's not the character that irritates you, it's you doing it that irritates you.
That's right.
That's why "Iraira Stick" is famous.
Do you have confidence in it?
No.
So, the game we're making today is "Iraira Stick".
Here are some of the elements you need to complete it.
Please try making it with us!
First, we'll make a player to operate it.
It's easy to make.
We'll use a function called "sprite renderer" that displays images.
Is it okay if it's round?
Yes, it's okay if it's round.
With "create"...
2D?
Yes, 2D.
It's a circle.
Oh, it's round.
Yes, it is.
Now we have an image.
The next thing we need to display an image is what we saw earlier as a component.
Is it "sprite renderer"?
Yes, it is.
It's great.
Try making it as a component.
Component...
Renderer...
Oh, it's okay.
And in this sprite section, if you put in the round image we just made...
A cube has come. No, a circle.
A circle has come.
It's a circle.
OK. The image display is now complete.
Yay!
Wow, you're clapping for me.
From here, we'll add the necessary functions to the player and complete it.
First of all, programming to move the player.
Next is a function you definitely want to remember.
Digit body.
It's moving.
It's already moving.
It's moving.
Wow, so just by putting this in, you can make it fall on its own?
That's right.
Wow.
A useful function that allows you to move things just by adding it.
If you want to use it in Unity, you can just add a digit body for now.
By the way, when you were in school, did you make games as part of your programming classes?
Basically, for beginners in making games, we used a software called "scratch" which makes it easier to make games.
It's like a game in which a bat breaks a balloon.
We made a game like that.
I think "scratch" was the most used in elementary school.
Even if you're a little kid, it's easy to understand.
There's software that allows you to do programming.
That's why we did it.
Also, it's like a game where you battle with commands.
The text output...
Oh, yeah, yeah.
Like, "something attacked me."
Yeah, yeah, yeah.
Like "hp zero."
Yeah, we did that.
I'm getting really excited.
There's a lot of programming stuff.
Yeah, like the first example of text output.
Oh, yeah, text output.
Do you have a favorite programming term?
Huh?!
I didn't know much about object thinking.
No, that's kind of hard.
It's hard.
Object thinking?
No, it's hard.
It's a little...
It's amazing.
From an idol's words, a class or object thinking comes out.
It's like, "Oh, you're really programming."
I'm happy.
But it's been a while since I've been able to talk about programming like this.
It's fun.
There's no such program in the members.
That's right.
I don't know if I can say "java" or "sart."
It's not difficult.
It's a resource.
No, it's not.
After a long time of programming talk, I'm getting excited.
I'll get my act together and start making games again.
Next, I'm going to move up and down depending on the programming.
I'm going to use the rigidbody I just added.
And velocity, which is the speed value.
This time, I'm going to take the rigidbody and change its velocity.
This is public rigidbody...
rigidbody...
"multiply"...
You're using your sense of prediction.
I'm using it a lot.
If I make a mistake, it won't work.
That's right.
If I miss a spell...
This one doesn't miss a spell.
That's common.
It's common.
If you miss a spell, you'll get in trouble.
That's right.
Because the program doesn't work.
Here is the actual program code.
Speed represents velocity,
and vector 2 represents both x-axis and y-axis directions.
This rigidbody velocity represents your own speed.
What you're doing now is adding 0.1 to your own speed.
I see.
For example, if you do this now, you'll go to the right.
If you want to go up...
If you want to go up, should I add a plus sign?
Like this?
Yes, like that.
That's right.
Like that, you can move now.
Let's save it for now.
Go back to Unity and add rigidbody to the box you prepared earlier.
Wow, it's moving slowly.
Yes, it is.
Wow, it's moving slowly.
Yes, it is.
You're fast.
The rigidbody is now complete!
Yay!
Are you used to narrating now?
I'm used to it now, but...
The name "Rama Takahashi"...
Yes, I got used to it in the beginning.
The official program T-shirt and smartphone case are on sale!
There are two types of T-shirts.
One with a big logo and one with only one point.
For more information, check out the program's homepage!
November 23rd, game day, make an order log! Next up is this process!
That's where you learn "if" important programming!
There are various programming languages, but I think "if" is used in any language.
In programming, the most basic subordinate "if"
is an important subordinate "if" that allows processing under specific conditions.
Here, we will explain "if" with the forced stop mask of the first location game!
When programming is running, but expressing it in Japanese,
if you want to force stop here, how do you say it? Will you explain it to people?
"Stop for now"! Oh, that's right!
So if you tell the program "stop here for now",
not all masks are stop masks, but only specific masks can have information that says "stop".
In that case, you can call a flag or ask for a "fat flag" to see if it's correct or not.
Oh, that's right!
Like trying to build a "stop flag".
A "flag" is something that shows whether or not you have met the conditions in programming.
And this "public pool" is the program that represents the "flag".
In other words, if you come to the stop mask using this code, the flag will stand.
If you actually look at it...
When you open the data, you can see the unset stop space that you entered.
Let's build a stop space flag. If you check this, you can see that the mask is a stop mask.
I asked you to make a flag earlier, but this time, if it's a stop mask and if it's not a stop mask, I want to separate the processing.
That's where "unnecessary" comes in. To briefly introduce how to use it...
First of all, you use it as a set like this.
And in this circle, this is the condition.
Condition...
Yes, if this condition is "true", the processing in this will be carried out.
In other words, if you apply it to the stop mask earlier...
If it's a stop mask, that's the condition.
And if the value of the dice is forcibly reduced to zero, that's the process that's being carried out.
In this way, if you want to program that "if this condition is true, this process will be carried out", you can use "unnecessary".
Then, using "unnecessary", we will make the player of the requested game move according to the command.
I want to move the cross, so first I will try to move the left and right.
When you move the right, which key do you want me to press to make it move to the right?
The right arrow?
Oh, the right arrow. I see. Then, I will surround it with "if" like this, and while I am pressing it, I will change it so that the speed increases.
"if input get key"... Oh, I have heard of it before.
Oh, you have?
"input"...
Now, if you press the right, it will be added more and more.
In the same way, if you change this key code part and the vector 2 part and program patterns other than the right arrow...
Oh!
That's good.
Oh!
Thank you.
She is clapping.
OK. Then, I will add more walls and it will be finished.
OK.
Now, for the moment, the player is complete.
Now, for the final step, I will add more walls and create a stage.
First of all, like when you created the player, create a visual image and then...
But now, even if I hit it, nothing will happen.
OK.
So, I will add "hit judgment".
"hit judgment"...
Yes.
Oh!
This is a little special for Unity. I will add something called "collider".
Oh!
Yes, yes, yes.
"collider" means "hit judgment".
"hit judgment" refers to the contact and collision of objects in the game.
By adding this, you will no longer have to go through walls and you will be able to function.
"pad component physics 3"...
"pad component"...
- "physics 2d"... - Yes.
- And... "box collider 2d"... - "collider"...
- "box collider"... - "b"... It starts with "b".
- "box collider 2d"... - Oh, here it is!
If you want to attach it to a square wall or something, use "box collider".
If you want to attach it to a round object, use "circle collider".
I'll go ahead and attach it now.
- Oh, that's right. - "circle collider 2d"...
And now you have a round object attached to the player.
- Now, since the block is square... - "box collider 2d"...
- That's okay. - Yes.
- Now you can hit it. - Yes.
Then, you replicate the block with the object attached and create a stage and you're done!
This is great. This is fun.
It's fun to be able to make objects like this so easily.
- If you start with just words, you get tired. - That's true.
- You get sleepy. - That's right.
- The picture is... gorgeous! - That's true.
- The picture is gorgeous. - That's true.
- Okay, it's complete! - It's complete!
And with that, it's complete!
Lastly, we'll have Takahashi-sensei give us a test play.
- Please give us a fair judgment. - A fair judgment...
- It's pretty easy, isn't it? - Yes.
- Is there anything unique about "unity"? - Most of it, I think.
- Can you understand the content? - Somehow... Somehow... Somehow...
We'd like to ask you for a favor.
"Tokyo Pasokon Club" will be on TVer after the broadcast, so please don't miss it!
The program will continue for a long time!
Please click on the "like" button on TVer!
It's pretty easy, isn't it?
Yeah, it might be easy.
It's pretty easy.
Oh!
It was really difficult, wasn't it?
Yeah, it was.
Oh, wow!
You're good!
I don't have much time.
Oh, I'm sorry.
Wow!
Did you hit it?
No, I didn't!
You're good!
Didn't you hit it?
You're too good!
Oh, no!
Oh, here...
Isn't it difficult here?
Can't you hit it?
Oh, here...
Isn't it difficult here?
Can't you hit it?
You fell into a trap.
There was only one curve left.
You can't hit it at all, can you?
This is the most difficult part of the game.
That's why I made it like that.
Can you prove it with a test play?
That's great.
I was completely fooled.
I thought this was the difficult part.
Since high school, I've never been in a program like "UNITY".
I've been thinking about what to do.
But you made it so easy for me to understand.
No, it was so much easier.
No, it was so much easier for me.
That's right.
I don't think there's anyone like you at home.
I hope you'll use the search tool and try it out.
Thank you very much.