Module: PseudoGame.game.common
Some functions that are commonly used in the game logic
Functions
PseudoGame.game.get_orbit (angle, distance, start_pos) | this function converts polar coordinates into cartesian ones and adds a start position | |
PseudoGame.game.get_color_from_hue (hue) | get a color from a hue | |
PseudoGame.game.transform_hue (hue, r, g, b) | transform a color by a hue |
Functions
- 🔗 PseudoGame.game.get_orbit (angle, distance, start_pos)
-
this function converts polar coordinates into cartesian ones and adds a start position
Parameters:
Name Type(s) Description angle number the angle in radians distance number the distance from the start pos start_pos table the start pos, formatted like this: {x, y}
Returns:
-
number,number
the resulting position
- 🔗 PseudoGame.game.get_color_from_hue (hue)
-
get a color from a hue
Parameters:
Name Type(s) Description hue number a number between 0 and 360 Returns:
-
table
the resulting color in this format:
{r, g, b, a}
- 🔗 PseudoGame.game.transform_hue (hue, r, g, b)
-
transform a color by a hue
Parameters:
Name Type(s) Description hue number the hue to transform by r number the r component of the color to transform g number the g component of the color to transform b number the b component of the color to transform Returns:
-
number,number,number,number
the resulting color