Why do games always have code like this?

Why do games always have code like this?

Pictured: Terraria

Related: Yandere Sim

Other urls found in this thread:

github.com/csnxs/Terraria
twitter.com/NSFWRedditGif

Because indie game dev is 90% design and 10% software dev

What? No comments?

This is wrong.

Because games have a lot of menus and selection?

There are no comments because it's decompiled code
github.com/csnxs/Terraria

>why is decompiled code repetitive and have little high-level structure?

>Yandere Sim

This is not decompiled code, by the way

Show me any decompiled code that looks good.

Oh wait, you can't, because that's asking for the impossible. Decompiled code is the pile of shit that is left after a steak.

>stringly typed code

how would you do better? make a switch statement?

>This is not decompiled code

Use enum classes.

Enumerated types would be a start.

In fact an enumerated type and a matching string value for the .gameovercause would reduce it to a single expression

even firefox code is cryptic as fuck. no wonder mozilla can't make anything except chrome clones

> not using } else if {

That is shitty-ass code. Pic related is how proper programmers handle braces

Not just enums as other anons have said, but also putting this shit in text files that get parsed. Then all you have to do is change the text file not refactor that ugly beast. Would also improve the test suite.

...

The absolute state of Wintards.

They literally just said that isn't decompiled code.

Enums and switches. Don't listen to that other dumb fuck who thinks that reading in shit from a fucking text file that should be hardcoded is a good idea.

love this

>game data should be hardcoded
WEW LAD

its generated code. You know things like "generate getters and setters/ extract interface/...." exists in modern ide's?
This code is most likely generated by a tool for game development.

...

Jesus fuck, it tests weapon, blood and weapon and blood. What a piece of shit.

>switches

Kidding aside, that (float)6 is also disturbing.

More like a lot of indie devs have no idea how to code, they get into it because they want to make games and learn enough to scrape

t. indie dev

...

It still doesn't justify a massive pile of string comparisons.

They posted code from Yandere Sim, not Terraria.

How dense are you?

l m a o

I bet you draw anime and want to be a gayme designer

that could be an unrolled loop

yeah that's probably an unrolled loop

fix it and make a pull request