Extension request - Equations and Paths

I am a middle school engineering teacher and love the arcade. It is so useful and has a lot of connections that can be made to math, but one big thing missing is the ability to create equations and use iterations. Maybe I don’t know enough about coding but all Sprite motion is controlled by vx and vy variables. With the right combination of code you can create unique movement patterns but it would be awesome if there was a block of code that said:

set (mysprite) (IMAGE) path to (allow an equation to be entered) with velocity of (NUMBER)
and
set (projectile) to projectile (IMAGE) from (mysprite) with path (EQUATION) velocity of (NUMBER)

I am not sure how possible that is, and I am definitely not informed enough to do it on my own. Man I could connect to Algebra, Algebra 2 and geometry standards all day long. You would become an educational hero.

3 Likes

Parsing equations is definitely worth an extension, but I don’t think you really need it. Instead of messing around with vx and vy, (unless you want to use derivatives) you can directly set the X and Y values of a sprite. I had a little fun making this pseudo graphing calculator:

You define your math function in the code itself and the sprite follows the path. You can set the window{X,Y}{Min,Max} and graphSteps variables to your liking.

2 Likes

(I decided to extend the path grapher to a budget graphing calculator. It kinda dies when there is undefined behavior or to +/- inf because I didn’t put in any checks for that kinda stuff. Thats why it looks weird in the preview below for tan(x))

1 Like

Iterations are pretty easy to implement! Instead of defining the whole equation, just run your code in a Forever loop! You can determine the next step based on where the sprite is currently and that’s iteration!