Better HN
topnewbestaskshowjobs
Log inSign up

523453245

1 karma · joined Mar 27, 2020 (6y ago) · 2 submissions

Submissions

comment 6y ago · link · parent

You will end up with code like this:

https://github.com/elonafoobar/elonafoobar/blob/develop/src/...

A lot of those variables could have been grouped into a struct. Like all those key_<action> variables. Even if you think global state is fine you would only have one way of accessing it. It would be closer to this:

game_instance.key_mapping.charainfo

but I never see things like that. All I ever get to see is projects with almost thousands of global variables.