May 2021
Posted 3 years ago
Writing your own movement code is a bit daunting. Something I felt we could abstract and simplify is the actual slide movement code. 

The Source Engine's movement code isn't as simple as "move here if you can, stop if you can't". If it hits a surface, it slides across it. If it hits another one when it's sliding, it slides across that one too, as long as it isn't going to push it into the original one. 

So I extracted all this behaviour into a helper struct called MoveHelper.
attribute 'class' not allowedattribute 'contenteditable' not allowedattribute 'blocktype' not allowed
I've kept it as a struct because it's actually pretty lightweight and doesn't reference an Entity at all, so you can use it for non entity things.