YandereDevs' Code

This is video of yanderedev coding his game

youtube.com/watch?time_continue=998&v=CX_xUN89qeA


>the 20 if else statements are fucking real

Other urls found in this thread:

youtu.be/6tfwdnY5cDg?t=6m30s
twitter.com/NSFWRedditGif

buump

...

how hard is it to make a unity game

You could probably spit some garbage out and post it on steam within the afternoon.

Why do video game devs use Windows?

because literally every video game runs on windows

We normally run it on our main computers to play video games. I only run linux on computers too weak to play video games

>20 if else statements
Well, he's using string keys, so that can't be optimized to a switch--the compilation result would just be 20 if else statements.

Being real here though, I might use up to three if else statements just to test that the hair loads properly, then I would scrap it and replace the whole thing with a map so that I don't have to write the same code 20 times over.

which one of yous is the italyfag

>>the 20 if else statements are fucking real
What's wrong with "if"? He's checking words in a string.

>what's wrong with 20 if statements?
you'll figure out what's wrong with that by the time you finish CS101

The if else statements being repeated isn't the most shocking stuff here, 'cause in machine language it'll give the same thing.
However, 20 string comparisons for something that could have been done with flags, holyshit that's retarded.

I've heard stories about how shitty his code is, but this is... just what the fuck man? He doesn't seem to know what a switch statement is, or even what a loop is for that matter, and the majority of those if-else conditions can be handled with a texture dictionary that uses constant integers as keys:

const PONYTAIL = 0;

Hairstyles = {
PONYTAIL: '/path/to/ponytail/textures/or/whatever'
}

player.hairstyle = Hairstyles[PONYTAIL];

the const strings in the code can be converted by the compiler into hashes, so comparison is a one-step operation, unless he does some string formatting bullshit.

The reason that he uses string keys for everything is probably related to how Unity uses string keys for everything.

>What are enums

family, the word you are looking for is "enum" and "associative array"... or map.

Looking over this code a second time, the key-value pair is actually backwards but you get my point.

Will never happen, I'm self taught and in different non computer field of education.

He's using JavaScript, so I don't think enums are a tool at his disposal, and I believe all JS objects are associative arrays. A hash map would be ideal but that's more of a C#/C++ thing.

I don't get why people even consider strings for anything but actual text for UI, error messages, or file paths.

I see that now. I thought Unity was purely C#.

Why the hell is there JavaScript in Unity anyway?

JS in Unity is deprecated

I don't know, he talked about porting the code to C# like a year ago because it's supposed to be 4 times faster than JS or something like that, but quickly dropped the idea when he realized it meant more work.

He ported it to C#

Really fucking easy.

Still slower than flag comparisons, and still look retarded.

unity engine is good trust us guys

youtu.be/6tfwdnY5cDg?t=6m30s
Looks more like shit implementation.
VRchat and The Forest both runs Unity and there aren't any apparent delays in both games.