AISubs v3.7
Today, November 23rd, is "Game Day"! Did you know about it?
The purpose of this show is for Nogizaka46 to learn about game programming seriously...
...and for the viewers of this show to learn about programming in their own way.
That's because...
...programming has become a must-have skill even in elementary school since 2020.
Our show is broadcast every Friday night at midnight...
...and we'll tell you about its charms while mixing in some easy-to-understand scenes.
Hello! I'm Nogizaka46's navigator, Sato Rika!
As a narrator, I'm always watching the show...
- Sato-san... - Yes?
- Today, you'll be programming a simple game... - A game!
- ...on the computer in front of you. - Yes.
That's right! I'll challenge myself to make a game!
It's been a while, and I'm really nervous about programming.
- 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.
I've done a lot of games, but I've never touched "unity" before, so I'm really nervous.
Some of the software you can program games with are free, and it's easy for beginners to start.
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.
The creative game "Elegy Head" is by a genius programmer who has fans all over the world.
- Do you usually do narration? - Yes, I always watch it.
Speaking of which, Mr. Namata...
- It's really hard to say. - But you're finally getting used to it.
Now, let me introduce you to the game engine "unity" used in the show.
"Unity" is a software called "game engine" that makes it easier to make games.
- Yes. - Yes.
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? - What is it?
- It's Mario! - It's Mario!
Wow!
You jump and aim for the goal.
Wow, it's so cute!
You can move it with an arrow.
Wow, there are still some images left.
This is also a feature of Unity.
I think you're particular about adding some images now.
Yes, I think it's not enough, so I added it.
You noticed it and you like it, don't you?
Yes, I do.
You know a lot about games, don't you?
Yes, but you can observe the details of the game.
You're really suited for this game industry.
Finally!
Now you aim for the goal.
Wow, it's so cute!
It looks fun!
It's a little difficult, though.
It looks like it's going to slip.
You have to put your feet together.
You're good!
Ah!
It's like a game over.
Wow, you're right! There are still some images left.
Yes.
It's dangerous!
You can do it!
Wow, you're good!
In fact, if you learn programming that moves things, you can easily create such games.
In fact, in this scene, we will place a game object and display it on the screen.
First of all, there is a "hierarchy" section.
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.
A 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.
There's a function related to the physical engine in "p".
I see.
There's a lot more.
It starts with "r".
"DigitBody".
"DigitBody 2D".
Please try it out.
Okay.
What's this?
You can move it now.
Wow!
Let's actually play the game.
Okay.
This triangle button...
Please click it.
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, the player's gravity has started to work for this player.
Yes, it's narrow.
Please think of this "one" as the force of gravity "one" now.
Yes.
So, everyone, please change the value a little. As you like.
And then, please play it again.
How much did you input?
Mine is "seven".
That's right! When the gravity value increases, the speed at which things fall also accelerates!
In addition, when the value is reduced, it also moves in the upward direction of the vertical axis!
In this way, you can move things quite easily in Unity!
Please think of "minus" as "upward direction".
"Minus" is "upward direction", and "downward direction" is "plus direction".
But I saw it for a moment today.
Your own book.
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 have played it know.
No, that's right. It's a little different at all.
So, the main subject!
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'll make it move.
When I thought of a game that I could play just by moving, I thought of "Irairabo".
"Irairabo"!
"Irairabo".
Do you know what "Irairabo" is?
"Irairabo"?
Yes.
It's a game that makes you feel irritated.
Of course, it's very simple.
If you come here like this, it's like a goal.
And you 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 it's famous as "Irairabo".
Do you have confidence in it?
No, I don't.
So, the game we're going to make today is "Irairabo".
The elements you need to complete it look like this.
Please try making it with us!
First of all, we're going to create a player to operate.
It's easy to make.
We're going to use a function called "sprite renderer" that displays images.
Is "circle" okay for this game?
I think "circle" is good.
"Circle" and...
"Create"...
"2D"?
Yes, "2D".
It's "circle".
Oh, it's "circle".
Yes, that's right.
We've created an image.
The next thing we need to display an image is what we saw earlier in "component".
"Sprite renderer"?
Yes, that's right.
That's great.
Please add "component" to it.
"Sprite renderer"...
Oh, okay.
Yes.
And if you put the round image we made earlier in this sprite part...
A cube has come. No, a circle.
A circle has come.
It's a circle.
Okay. Now the image display is complete.
Yay!
Wow, are you clapping for me?
From now on, we will add the necessary functions to the player and complete it.
First of all, programming to move the player.
The first one is a function you definitely want to remember.
Digit body.
It's moving.
It's already moving.
It's moving.
Wow, so even if you put this in, it will fall on its own...
Yes, that's right.
It feels like a function has been added.
Yes, that's right.
A useful function that allows you to move things just by adding it.
When you want to move things in Unity...
For now, you just need to add a digit body.
By the way, when you were a student...
Yes.
Did you make games as part of your programming class?
Basically...
Beginners make games...
First of all, I made a game called "scratch" which is a software that makes games easier to make.
It's like a game in which bats break balloons a lot...
I don't know...
But I made it.
Wow...
Even in elementary school...
Yes, that's right.
I think "scratch" was the most used one.
There is a software that makes programming easy for even small children to understand...
So I made it.
Also, it's like a game in which you battle with commands...
Well, below...
Is there something like "digit output"?
Yes, that's right!
Like "someone attacked me"...
Yes, yes, yes...
I'll do it.
Like "hp0"...
I made it.
You did it, you did it...
Wow...
It's really exciting...
Yes, yes...
It's quite common...
Yes...
It's common in programming classes...
Yes, at first...
As an example of "digit output"...
Yes, "digit output"...
Is there a programming term you like?
What!?
I didn't know much about object thinking.
That's difficult.
Object thinking!?
It's amazing that an idol comes up with words like "class" and "object thinking".
I'm happy. It's been a while since I've been able to talk about this kind of program.
The members don't have such programs.
That's right.
It's not difficult if you can't say "java" or "java" or "java" or "java".
It's been a while since I've been able to talk about programming, and I'm excited.
I'll get back on track and start making games again.
Next, I'll move up and down depending on the programming.
What I'm going to use is the rigidbody I just added, and velocity, which is the speed value.
I'm going to take rigidbody by variable and change its velocity.
I'm going to use public rigidbody next.
rigidbody next.
You're using predictive conversion properly.
If you make a mistake, it won't work.
That's right.
If you miss a little spell...
This one doesn't miss a spell.
It's a common occurrence.
It happens.
If you miss a spell, you'll get in trouble.
That's right. The program doesn't move.
Here's the actual program code.
Velocity represents speed, and vector2 represents both x-axis and y-axis directions.
Let's save it for now.
Go back to Unity and add a digit body to the box you prepared earlier.
Oh, it's moving slowly.
That was fast.
After this, Ilaila stick is finally complete!
It's done!
Are you used to narrating now?
I was used to it in the beginning, but...
The name "Takahashi"...
Yeah, I got used to it in the beginning.
The official 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 show's homepage!
November 23rd.
Create Ilaila stick on the day of the game.
Next up is this process.
What you learn there is...
Important programming like "if" part.
There are various programming languages, but "if" is probably used in any language.
The most basic sentence in programming is "if" sentence.
It is an important sentence that allows processing only under certain conditions.
Here, we will explain "if" sentence using "forced performance" of shogoroku game.
Programming is running, but when expressing it in Japanese,
if you want to make it "forced stop", how do you say it? Do you explain it to people?
temporarily pause
Oh, that's right! If you tell the program "this is a one-time stop",
not all squares are "stop" squares, but only certain squares are "stop" squares.
In that case, whether it is correct or not, you can call it "flag" or "fat flag".
Oh, that's right!
You can say "let's build a "stop flag" or something like that.
"Flag" is a program that expresses whether or not you have met the conditions in programming.
And this "public bool" is a program that represents "flag".
In other words, if you come to "stop square" using this code, you are trying to make a "stop flag" stand.
If you actually look at it...
When you open the data, you can see that "stop square" that you entered cannot be set.
Let's make a "stop square" flag.
If you check this, you can see that the square is "stop square".
I asked you to make a flag earlier, but this time, if it is "stop square" and if it is not "stop square"
Do you want to separate it?
That's where "stop square" comes in.
I will briefly introduce how to use it.
First of all, you use it like this as a set.
And in this "stop square", this is a condition.
Condition...
If this condition is "true", the process inside will be executed.
In other words, if you apply it to "stop square" earlier...
If it is "stop square", this is a condition.
And if the value of the dice is forcibly zero, this is a process that is executed.
In this way, if you want to do programming that says "if this condition is true, this process will be executed", you can use "if".
Let's use "if" and 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 it to the left and right.
When I move it to the right, which key should I press to make it move to the right?
The right arrow?
Yes, the right arrow.
I see. While I surround it with "if" and press it, let's change it so that the speed increases.
"if input get key" Oh, I've heard of it before.
Here it is.
input
If you press the right arrow now, it will increase more and more.
In the same way, if you change this key code part and vector 2 part and program patterns other than moving to the right...
Wow!
That's good.
Wow!
Thank you.
He's clapping for me.
OK, now we just need to add more walls and we're done.
OK.
With this, for now, the player is complete. Now for the final step.
Add more walls and create a stage.
First, like when you made the player, create a visual image and then...
But for now, nothing will happen even if you hit it.
OK.
So, let's add "hit judgment".
"hit judgment".
Yes.
Wow!
This is a little special for Unity. Let's add "collider".
Wow!
Yes, yes, yes.
"collider" is "hit judgment".
"hit judgment" refers to touching objects in the game and determining collisions.
By adding this, you won't have to go through walls and you'll be able to function.
"pad component" "physics 3" "pad component"
physics 2d
box collider 2d
"b" starts with "b".
box collider 2d
If you want to attach it to a square wall, use "box collider".
If you want to attach it to a round object, use "circle collider".
I will also attach it.
circle collider 2d
Now, the object is attached to the player.
Since the block is square...
box collider 2d
It's OK.
Now you can collide with it.
Then, you can replicate the block with "circle collider" and create a stage.
It's fun.
It's fun to be able to create such an object easily.
If you only use words from the beginning, you will get tired.
"esra" is gorgeous.
It's done.
So, it's done.
Lastly, we will have Mr. Namatakashi do a test play.
Please judge it properly.
It's easy.
Is there anything unique to UNITY?
Can you understand the content?
Somehow... Somehow... Somehow...
Here is a request.
"Tokyo Basokon Club" will be broadcast on TVer, so please don't miss it.
The program will continue for a long time.
Please click on "TVer"'s favorite subscription button.
It's pretty easy, isn't it?
Yeah, it might be easy.
It's pretty easy.
Oh?
It's pretty difficult, isn't it?
Yeah, it's pretty...
Oh, wow!
You're good!
I don't have much time.
Oh, I'm sorry.
Wow!
Did you hit it?
No, I didn't hit it!
You're good!
Didn't you hit it?
You're too good!
Oh, I'm in trouble.
Oh, here...
Oh, isn't it difficult here?
Oh, can't you hit it?
Oh, here...
Oh, isn't it difficult here?
Oh, can't you hit it?
You fell into a trap.
There was only one curve left.
No, you can't...
You can't hit it at all, can you?
This is the most difficult part of the game.
That's why I made it.
But you can tell that by playing a test, right?
That's great.
I was completely deceived.
I thought this was the difficult part.
I've never touched a unit since high school programming.
I've been thinking about what to do.
But it's really easy to understand.
Mr. Takahashi...
No, it was so easy.
I'm sorry to say it was easy.
I don't think there are many people like me at home.
I hope you'll enjoy it while trying it out with the search tool.
Thank you very much.