Here you go:
Use $gameTemp.shake_game(10, 45);
This will shake the game screen by 10 pixels (only integers are allowed) for 45 frames.
Plugin commands available as well.
If you need to move the game window (which would probably only work in windowed mode of course), do this in an event with these commands:
View attachment 347360
▶ YouTube video
Do understand that calls to the NWWindow/cWindow are expensive (including DOM, elements, etc.).
Notice in the code, I am setting the x value. You can set the y value instead and/or use a combination of it. This code moves my screen 60 pixels to the right.
Let me know if this works and if you need anything else.
Thanks!
EDIT: Made a small change in the code to allow for the window to at least return to its original location after the shake and to allow the shake to occur in different locations for when the player moves the screen. Should be better now. Please test accordingly.