PecaCS brilliantly demystifies the complexity of 3D systems by focusing on the core logic of state machines and hierarchies. It is a testament to how disciplined engineering transforms abstract mathematical concepts into tangible gameplay.
深度探索
先修知识
- 暂无数据。
后续步骤
- 暂无数据。
深度探索
How I Added Skeletons Into My Minecraft Clone本站添加:
In this video, I'll be adding the skeleton in my Minecraft clone. I have no idea what I'm doing. Not there, man.
The other way. The other way. And constantly end up in surprisingly amusing situations.
Yeah, we're playing with the arrow.
This is Minecraft. And these two are called skeletons in Minecraft. If you right click holding this egg, a skeleton spawns. Let's implement the egg. But since we don't have a skeleton to spawn with it yet, we will make it spawn zombies to see it works. With a lot of searching for the egg texture, the closest thing I could find was this potted one with missing parts. I quickly colored it to look like the skeleton and zombie spawn eggs. Now all I need to do is on right click with the egg to spawn a zombie since I already have them in game.
They're flying.
They're flying.
They're flying.
Oh my god. Just like we implemented the zombie spawn egg, let's implement now the skeleton spawn egg. This is the skeleton model as a text file which my game needs to process. And this is the zombie model text file which my game already can render. There is one small issue. The model I found doesn't have a bow. So how does this skeleton get to have a bow? Then I ignore the bow for now and copied over the code for rendering the zombie and changed it so it matches the skeleton model. And let's see if we have uh skeletons.
What What's this monstrosity?
I had forgotten to change the zombie texture to the skeleton one. Okay, here is the skeleton. It's not moving perfectly. The legs are a bit weird and it doesn't rotate to where it's looking.
Here is all the skeletons.
Oh my god, they're so cursed.
They're abominations. I made the mob stay put when spawned. And the skeleton has his own egg. Now I turn on the walk animation and it looks like only one of the legs is broken. The problem turned out to be from where the rotation is happening. One of the legs has its rotation pivot at the bottom instead of the top of it. One of the legs is perfect. Uh we can figure out which one.
I think the left leg is perfect. So let's stop the right leg. The left leg.
This is the Okay. So left leg is from when we look towards it. This is the left leg. That's it. And the left leg is with the wrong animation. The pivot is down there. Okay.
The legs are properly rotating. They have the right pivot. Now the issue is the skeleton is not looking towards where it's walking. The way the model is right now, if I apply a rotation, it would rotate each body part individually. Instead, I added an invisible body part that is the parent of all the other ones and will rotate only it. Okay, that solved it.
That actually solved it.
Look at how many skeletons.
Now they're looking towards where they walk.
Have skeletons.
I looked at the original and noticed he moves his arms as well.
What?
Nothing like it. Uh, the pivot is at the wrong place.
So, no, it should be when the left leg is front, left arm should be back. Yeah, I think it's proper now. Yeah, when this leg is back, this arm is forward. The skeleton walk animation is ready. And in order to continue, it needs to hold a bow. So, what should be the simplest next step? It would be. Yes. The simplest next step is not to make him hold a bow, but to hold anything at all.
Yeah, there is his head. He's holding his head now. Now, changing the head to a bow shouldn't be that difficult, but it turned out it is. This is actually the game trying to render the bow. The problem turned out to be that I try to render both the skeleton and the bow at the same time. In Minecraft, they first draw the skeleton and then all the balls. Finally, the skeleton has its own bow, but it's in the wrong spot. It should be in its hand. Let's here's the the bow is stuck on his leg.
I just need to move the bow to be at his hand. That's it. Wa! It's like on its back. That's really cool. Imagine if the skeleton can take the bow from its back and like aim at us. That would be really cool. Bro is using his imagination power. See, I have imagination. I told you I have this here. Look at this. I have this where I can move around and play around with locations and rotations. Can I have the same thing for this model? Skeleton positions. Moment of truth. Yo, look at it.
Yes. Look at it.
I'm moving it around like this. Like this. Done. And now to rotate it. Now we need to add rotations. For the next few hours, I struggled the most with two problems. Trying to rotate the ball like in Minecraft. And the second problem where the ball didn't attach to the hand when walking. It's not staying in one place. The ball like here at the end behind the arm and here at the front, it's after the arm. Can you make the pivot points visible? That's Yeah, that would help a lot. Yo, and what's that pivot point? He has one here, one here, and he has for the legs, for the waist, and there's the bow.
Let's remove this one in the center.
This one should be for the left arm.
This one should be for the right arm.
This one should be for the left leg.
This for the right leg. This for the waist. Where's the head? This is probably the head. This is probably the hit. And this is the left arm. Now, like this. Now, I want it rotated on the Y-axis like this. And then like this.
Like this. And that's it.
That's it.
Oh my god. Don't tell me this is it. The skeleton is finally holding the ball.
But there is one problem left. When the skeleton is walking, the ball doesn't stay at the arm. After a lot of trial and error, I noticed the change in the bow position was not relative to its parent the arm, but to the world. Most likely, it will work now.
Don't tell me that's it. Oh my god, man.
Don't tell me this is it.
This was so much work, man. Like my head is like going to explode. Oh my god, man. Don't tell me this is it.
Oh my god, man. This was so much work.
Just so that the skeleton can hold one bow. Oh my god, this was so much work, man. So much work. Look at how cool they are holding their little balls. We can maybe give it a hat as well. A hat. So many skeletons. Oh, what if we make a change right now? If we look at it, we moved all the balls and we can rotate all the balls. So many balls everywhere.
Next, we need to add a shooting animation. Let's see the shooting animation.
Um, not there, man. The other way. The other way.
No, no. But skeleton, don't break your arm.
Once again, I have problems with rotation. And even bringing back the pivot points didn't help me.
Excuse me.
So, this is this pesky little arm. Let's look at MGY.
This is on the X-axis. Perfect. The X-axis works perfectly.
No issues at all. Let's zero it out.
Now, let's look at the Y-axis.
No.
No bad arm. This is bad rotation, man.
This is a horrible rotation. Let's look at the Z axis rotation. No, this is a horrible rotation.
Why is it like this? Only the X-axis rotation is fine. Only the X-axis. This should be the Y-axis rotation and this should be the Z axis.
Uh, let's try to guess where the actual pivot is because what we're drawing here. I'm drawing I I thought I'm drawing the pivots, but if this was the pivot, this wouldn't be the rotation.
Let's change here the pivot and see how a rotation like that is possible. Let's pivot. What if it's here but lower?
Oh, is it using the left hand pivot? Oh my god, it's using the left hand pivot.
Don't tell me it's using the left hand pivot. That would be preposterous.
Hopefully, this fixes it. Now, moment of truth. Let's rotate on the X-axis.
Uh, perfect.
And now on the Z.
Yo.
Yes. Yes. Yes. Yes. Yes. Yes. Yes. Yes.
Yes. Yes. Oh my god. Okay. Let's do this 90°. Uh - 90 - 90. And let's do - 90 here. And now let's do this. Let's do around 45.
And these are the skeletons.
These are the skeletons.
While I'm at it, I quickly decided to make an idle animation. It's the same one I have for Steve in the inventory.
Next, I made it so only when I get close to him, he will prepare the ball for the shooting animation. Now, when we're near the the skeleton, I want the skeleton to stop moving and to look towards the player. Uh, let's see what's up with the skeleton.
Oh no.
What's he doing?
No, man. Just look towards me. Don't do these kinds of flips.
What are you doing now? Let's see what's up.
Yo yo yes.
Now he continues walking around and when we get near him, he targets us.
Yo, that's so cool. The skeleton in Minecraft, when he shoots at you, he actually moves as well, but our skeleton will stay in one place. Let's make him shoot. And uh as of now he's trying to he's trying to switch state. Look at him how he tries to switch like he has this slight movement. Yeah. Now he continues to stay put.
Only when I'm gone.
Uh only when I'm gone.
No. Now he continues to just look at me.
Yeah. Uh, I need to switch back to a different state once I'm gone. Yeah, now he doesn't change his state. He doesn't try to walk around. And when I go back, he continues his journey. But when I'm close, he just stays at one place. Now, the only thing I want is for him to shoot at me right now. So, here I spawn the arrow.
I create the arrow. Why do I use the block origin? That's really weird. Why don't I just use the just a regular position here? Position. And here position. And this is for when I spawn arrows. When the player spawns arrows.
Let's spawn them. Let's see how they spawn. Now we started.
Oh, it's We need to copy the player position.
We need to copy the Yeah, we're playing with the arrow.
We flying with arrow.
Can No, we cannot.
What the Yeah, let's let's uh not replicate this vector tree.
But that was so unexpected.
That was so unexpected. Yeah, now it's shooting normally.
Yo, it shoots an arrow.
Yeah, it shoots another arrow, but it's shooting from it down there. It should be from up above a little bit.
Whoa, not from there. It spawns the arrows from there. Maybe plus two will solve it.
It's good enough.
And now all of these arrows continue to stay. I should clean them up.
Now arrows should disappear after 5 seconds because there will be many many many many many arrows.
So now skeletons can shoot as much as they want and the arrows should start disappearing.
Yeah, that's it.
Yes.
And we should make the arrows hurt the player. These skeletons nightmare when you enable the heat box. This is what we are going to do right now is enable the heat box. So yeah, I don't even need to check collision boxes if it's just close enough to me to hurt me.
It's hurting me.
Half a heart the arrows should hurt me.
Yeah, look at how Yeah, they hurt me. Yeah.
And now I should die and I die. Yes.
Yeah. We have the skeleton. When we are far away from it, from him, he has an idle animation. He walks around. When we get close to him, he shoots. He can hurt us. The arrow collides with us. And this was my idea to be able to like with bunny hop to dodge their arrows.
This was my idea. And to attack him.
The arrows are just too fast.
Oh, I I managed to get
相关推荐
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 views•2026-05-28
How agent o11y differs from traditional o11y — Phil Hetzel, Braintrust
aiDotEngineer
450 views•2026-05-28
Re: 🗣️📍theprophedu📍2026 GST 103 CLASS (E-EXAM REVISION)
theprophedu
636 views•2026-06-04
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanation💯✅
LearnwithSahera
1K views•2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 views•2026-05-29
Search Algorithms Explained in 60 Seconds! 🤖💨
samarthtuliofficial
218 views•2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 views•2026-05-30
Instagram accounts got PWNed
EricParker
13K views•2026-06-03











