GDevelopApp / GDevelop-extensions

Repository of behaviors, actions, conditions and expressions to be used in GDevelop for creating games
https://gdevelop.io
MIT License
131 stars 52 forks source link

Extended Math Support Extension #56

Closed Add00 closed 4 years ago

Add00 commented 4 years ago

Describe the extension

This extension aims to add more advance math concepts into GDevelop and some other general improvements. The extension includes; common mathematical constants (pi, e), common mathematical formulas (slope, hypotenuse), recursive functions (factorials, Fibonacci numbers) and finally, coordinate conversions for the polar and isometric systems.

Checklist

Extension file

Math.zip

Add00 commented 4 years ago

I forgot to state this in the main post, but this extension is an amalgamation of three previous extensions. So if anyone feels that one or some of the functions don't belong, I could remove them or spin them off to their own extension.

Add00 commented 4 years ago

Updated descriptions Math.zip

Bouh commented 4 years ago

Hi thank you for your work on this extension!

In the descriptions, no need to rewrite the name of the arguments. x1 | x value of the first point Can just be The value of the first point

In gcf, "a | any interger" goes to "Any integer", but this allow to use float number too? If no, you should check the value or format it just after getArgument().

"Factorial (!)" Unless the (!) have a sense i didn't know yet, let's go without signs.

Here the new files reviewed, let me know if it's good for you, if you can plug the extension on your procedural example it will be a great test.

I've changed the name of the extension the expressions in the game need to be rewrite. _ExtendedMath::constant("Goldenratio)"

ExtendedMathSupport.zip

Add00 commented 4 years ago

Thanks for your improvements and feedback, I really like how you described the colour function, it's much more understandable.

Improvements since last time:

Ideas: I was also thinking that the colour, rgbToHex and hexToRgb don't really fit in with an extension about math. Maybe they should be their own extension about colours.

Also, should I change the default value for the constant function currently it's set to -1, but that doesn't really tell the user whats wrong.

ExtendedMathSupport.zip

Bouh commented 4 years ago

Also, should I change the default value for the constant function currently it's set to -1, but that doesn't really tell the user whats wrong.

The default number value return by default in GD is 0.

I was also thinking that the colour, rgbToHex and hexToRgb don't really fit in with an extension about math. Maybe they should be their own extension about colours.

This make sense to me.

Add00 commented 4 years ago

I took out the colour related functions and changed the default value of constant to zero.

ExtendedMathSupport.zip

Bouh commented 4 years ago

Great! Let me review the file one last time today :)