Introduction to Game Development (E13: falling blocks game 1/4)

preview_player
Показать описание
Welcome to episode thirteen of this introduction to game development in Unity with C#.

In this episode we look at player movement for a simple 'avoid the falling blocks' game.

Project files:

Or a once-off donation through PayPal:

Contribute subtitles here:
Рекомендации по теме
Комментарии
Автор

Hi everyone, over the next few episodes we're going to be creating a simple 'avoid the falling blocks' game.

The goal of this series of course being to enable you to create games without needing to follow a tutorial, I'm hoping that you will pause the video when I suggest, and try to tackle the given problem on your own. Let me know if you find this approach helpful, so I know whether or not to continue with it in future episodes :)

Cheers!

SebastianLague
Автор

You're getting a special thanks in the credits of every game I ever make.

haomakk
Автор

Your style of teaching is insane! I really love this series, especially now that they seem to be even more professional. Keep up the great work!

brokenstudiotv
Автор

The best Unity tutorial series on the internet right now. Love it!

_PadoStudio
Автор

Can't wrap my mind around this whole wrapping concept. Need to rewatch and hopefully i understand it more.

TheHonestLee
Автор

Hot tip for new developers that I literally just learned yesterday, transform.Translate is a lot more costly than other movement codes. It's a micro-optimization, but instead of transform.Translate(velocity) you can use transform.position += velocity(or whatever calculation you have for movement).

Just watched a video on optimization for mobile by Unity, and this was the advice Unity gave. "Don't use that handy method we made for your convenience." lol

haachamachama
Автор

These are so good tutorials I feel myself super stupid. This makes everything look so easy. Best channel ever.

jakemarcus
Автор

I love these kind of challenge style tutorial

thnxcpw
Автор

Yes yes yes!!! Thankyou very very much ch I can't contain my excitement I was waiting forever for this thank you

coolandfresh
Автор

Note to self


There are two methods available for input:

1) Input.GetAxis
2) Input.GetAxisRaw

Input.GetAxis


Input.GetAxis returns a value ranging from [-1, 1] where a value of 1 means the keyboard/joystick is pushed all the way to the right, -1 means it's pushed all the way to left and 0 means it's in its neutral position. Since the value is inbetween -1 and 1, the movement is a lot more smoother.

Input.GetAxisRaw


Same as Input.GetAxis except for the fact that input is not smoothed. So values are either -1, 1 or 0 no in betweens. Movement is a lot jerkier/rougher.

grapesalt
Автор

God bless you for being such a fine teacher. Thank you.

DavidGame
Автор

if you're a beginner like me. we also need to also understand the parameters like transform.'LocalScale' and camer.main. 'Aspect'. so do extensive research on those too.!

blastroisehunt
Автор

thanks so much for the worlunits conversion, this helped me alot as i can turn the equation around and determine the orthographic size so that the camera will always see the game map! you're the best!

shadowyxpgames
Автор

I accidentally did the same thing as you did without looking at the video,
but I used a vector2 for moving not releasing that I could just use a float, it's a good idea though makes the code way more nice looking.

oximas
Автор

500th like yeee
I thought Brackeys was the Unity Jesus until he recommended you. And finally I understand the basics. I really hope you can make enough money with your teaching skills!
I'll bookmark your patreon profil for when I have some left xD

ricowhiterider
Автор

the orthographicSize is half the size of the vertical viewing volume ( Screen Height / 2) . The horizontal size of the viewing volume depends on the aspect ratio ( Screen Width / Screen Height ).

timucin
Автор

"Alright, time to pause and see if I can do movement by myself, dont really know how to screenwrap so I'll just focus on the movement for now and see if he explains how to screenwrap."
public class Player : MonoBehaviour
{
float speed=10;
Vector2 velocity;
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
PlayerMovement();
}
void PlayerMovement(){
Vector2 input = new Vector2 (Input.GetAxisRaw("Horizontal"), 0);
Vector2 direction= input.normalized;
velocity = direction*speed;
Vector2 moveAmount= velocity*Time.deltaTime;

}
}
"Done! Movement should be similar to the "Player" script from the player and chaser video so I'll just make it into a vector2 layout. Nice it works! Now to continue the video."




"Well ok then"

carlosdude
Автор

dude this is great. me and a few buds want to create a game and this is perfect.

JATorNMNS
Автор

If you want to make the transition between each side of the screen to look more natural and less like teleportation, I would recommend taking the full width of the player and not just half. Nice video either way!

honkinghorse
Автор

This is just amazing! You have a very unique and professional style, Please make more tuts like those ♥♥♥

smartmk