Pattern-Script icon indicating copy to clipboard operation
Pattern-Script copied to clipboard

Add global visual effects

Open ClementSparrow opened this issue 2 years ago • 5 comments

Things like screen shakes (even if I hate them), particle systems, color filters, blur (even focal blur, focusing on a specific collision layer) or other shader-based effects could be predefined in the engine in the same way we have a system to generate sound effects. And like for sound effects, these visual effects could be triggered by specific in-game events or UI events (notably, undo/restart, see #23).

ClementSparrow avatar Aug 22 '21 13:08 ClementSparrow

Idea: try using the random sound generation functions and buttons to generate visual effects by controlling various rendering parameters like rotation, translation, scaling, colors, blur, etc. Using directly the sound functions will probably not work but maybe we can take something from them and factorize the code...

ClementSparrow avatar Aug 24 '21 12:08 ClementSparrow

Good idea. Also smooth moves and rotations (perhaps with various kinds of easing); 'pop' effects on creating or destroying an object; particles or shake for mouse clicks; screen shake, pop or colour on game start/end/etc.

Actually the list of events is much the same as SOUNDS, it's the list of animations that is needed.

david-pfx avatar Sep 27 '22 10:09 david-pfx

Yes, these are good ideas too. Some of them can be achieved by defining the sprites manually but procgen would help a lot.

The definition of events seems indeed separated from the definition of effects that can be triggered (visual or sound effects).

My idea was to reuse the wave-generation system from the sound effects because the value of a wave can be used to control in time any parameter of a visual transformation, so we could have a rich and complex system at low development cost, but this needs some experimentation. We could even have sound effects that share some parameters with some visual effects (for instance, the time of an echo in a sound matching the period of a screen shake).

ClementSparrow avatar Sep 27 '22 12:09 ClementSparrow

Here's another idea.

LEGEND
quad = one + one:90 + one:180 + one:270   ( new object from 4 rotations )

david-pfx avatar Sep 27 '22 23:09 david-pfx

@david-pfx, I think the LEGEND section is not the place to declare new objects, and there is already a more convenient syntax to do what you want in the OBJECTS section:

one:directions
(colors)
(sprite for upward direction)
rot:up:>

Then you can declare quad = one:directions in the LEGEND section if you need it.

Also, please create new issues rather than attach new ideas to an unrelated issue ;-)

ClementSparrow avatar Sep 28 '22 07:09 ClementSparrow