landgreen / n-gon

2-d physics rogue-lite platformer shooter
https://landgreen.github.io/n-gon/
GNU General Public License v3.0
134 stars 193 forks source link

(Suggestion: New Tech/Junk Tech) Wave Theory #197

Closed jo9182 closed 2 months ago

jo9182 commented 3 months ago

You may set the equation that Wave uses.

(Requires: Wave [gun]) (Bans: Phonon, Amplitude)

jo9182 commented 3 months ago

This will show the equation that the gun is currently using. (Will help people who don’t know the equations)

jo9182 commented 3 months ago

If you were to make this an actual tech you would need limitations for amplitude (both maximum and minimum) Maybe you could limit the amplitude, but have a tech that loosens those restrictions?

landgreen commented 3 months ago

It would be cool to make a complex function, but the phonon tech is limited to just frequency and amplitude. Those tech do work though. (the equation is just y = Amplitude sin(x * frequency)

jo9182 commented 3 months ago

Oh, neat. Would this be difficult to implement? I haven’t actually looked into the code to see how the wave works, so I’m not sure if it uses an equation to determine how it fires, or if it’s hardcoded to fire the way it does.

landgreen commented 3 months ago

All the graphics and physics in n-gon is generated each frame from math. There are no hardcoded animations. (I think)

jo9182 commented 3 months ago

Alright. Does that mean whatever is used for determining how the wave gun fires and the actual mathematical equations for waves have some parallel then? (e.g. f(x)=a sin(bx+c)d )

landgreen commented 3 months ago

this.cycle++ const where = Vector.mult(transverse, this.amplitude Math.cos(this.cycle tech.waveFrequency)) Matter.Body.setPosition(this, Vector.add(this.position, where))

AnnonymousNerd87 commented 3 months ago

interesting

3xionDev commented 2 months ago

as an 8th grader currently in the trigonometric ratio section of the trig 1 course, i would very much like to see what kind of absolutely terrible, inefficient, extradimensional bullshit waveforms i could create

Batnonhrattata commented 2 months ago

lmaoooo im in geometry in 8th rn

On Thu, Apr 11, 2024 at 1:05 PM 3xion @.***> wrote:

as an 8th grader currently in the trigonometric ratio section of the trig 1 course, i would very much like to see what kind of absolutely terrible, inefficient, extradimensional bullshit waveforms i could create

— Reply to this email directly, view it on GitHub https://github.com/landgreen/n-gon/issues/197#issuecomment-2050131723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYCHGENXM7VBGGAKSMQN36LY427DJAVCNFSM6AAAAABFJ2PQ2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGEZTCNZSGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Julian Crow Sipple