wurstscript / WurstStdlib2

WurstScript Standard Library Version 2
Apache License 2.0
55 stars 53 forks source link

Knockback3 should have some kind of Knockback2 relationship/constructor/behavior #389

Open Cokemonkey11 opened 3 years ago

Cokemonkey11 commented 3 years ago

needs scoping/proposal

Cokemonkey11 commented 3 years ago

Knockback3's design is to act as a kind of global physics system for units in a map. It behaves well when you use it for everything, and poorly if you mix and match.

The implication is that applying knockback to a unit in motion is an additive effect. setVel can be used when an instantaneous interruption is needed.

As such, scoping 2D knockback opens some questions:

Cokemonkey11 commented 3 years ago

I propose adding a new:

public static add2d(unit u, real initial_speed, angle groundAngle)

What constitutes a unit in 2D or 3D motion for answering the above?

A unit is in 2d-only motion with the 2d flag.

Should it be possible to force a 2D knockback with any guarantees?

No, out of scope.

What should the behavior be for 3D knockback with horizontal trajectory? The same as a 2D knockback? What trajectory should act as threshold between the two?

Out of scope. Leave 3d knockback with horizontal trajectory unchanged.


Leads to a new question: what special handling should 2d knockback have?

Should 2d knockback consider heightmap?

No. Out of scope. Constant friction, no terrain-z consideration initially.