how the variables in my platformers usually work

there’s usually three kinds of variables in my games. name variables, decal variables, and activity variables. i’m gonna be going over how all three types of variables work in this topic so that you can use them for your own games.

name variables - these are usually labeled “my____”, and are just there to label a sprite or asset in my game and allow it to do different things. it’s exactly what it sounds like.

decal variables - these are similar to name variables, but they’re specifically reserved for effects or “decals”, which are only ever on screen for a very short amount of time and are only used to add that extra detail that you see in my game, whether it be a puff of dust from a jump or an afterimage effect behind a character moving really fast.

then there’s activity variables. these are usually labeled “canDoThis” and “isDoingThis”, and they are easily, by far, the most frequently used variable type ingame, even if they aren’t used often in the code itself. these are what prevent or allow player characters from pulling different moves off at given times, whether it be diving, ground pounding, charging, you name it. they’re also what prevents the player from using every move at once, spamming moves, or using arial moves on the ground and vice versa. my games would be terrible if i never used activity variables.

do with this information what you will. happy coding!

2 Likes