Author Topic: Screen shake motion blur  (Read 2615 times)

BoshyMan741

  • Wannabe
  • Posts: 29
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.130 Chrome 44.0.2403.130
    • View Profile
  • Playstyle: Keyboard
Screen shake motion blur
« on: August 06, 2015, 12:45:13 PM »
Does anyone know how to make a screen shake that also does motion blur, kinda like in Boshy?

Katz

  • Cherry Eater
  • Posts: 71
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.130 Chrome 44.0.2403.130
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #1 on: August 06, 2015, 01:05:57 PM »

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.107 Chrome 44.0.2403.107
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #2 on: August 06, 2015, 02:35:43 PM »
There's some fancy stuff you can do with drawing the screen to a surface and then drawing the surface in random spots with a low alpha, but what Katz linked might work better for what you want.
(click to show/hide)

smoke weed everyday

BoshyMan741

  • Wannabe
  • Posts: 29
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 44.0.2403.130 Chrome 44.0.2403.130
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #3 on: August 06, 2015, 03:01:48 PM »
Yeah I actually used what Katz linked right before coming here to ask. Also do you know if you could explain how to what you said. I'm a pretty big n00b with the draw event.

lawatson

  • The Kid
  • Posts: 331
  • I do things and I make things.
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.107 Chrome 44.0.2403.107
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #4 on: August 06, 2015, 05:52:51 PM »
Well, you'd have to learn how surfaces work, which is actually pretty complicated. I made a topic about it in the forums at some point, so maybe you can learn from that.
(click to show/hide)

smoke weed everyday

Kyir

  • The Kid
  • Posts: 293
  • Normal Guy
  • OS:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 44.0.2403.130 Chrome 44.0.2403.130
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #5 on: August 06, 2015, 09:16:04 PM »
As for screen shake, you basically just want to adjust the view_angle (be sure to enable views in whatever screen you're doing this in). You can fiddle with the other stuff in https://docs.yoyogames.com/source/dadiospice/002_reference/windows%20and%20views/views/index.html but the angle is the easiest I've found.

Katz

  • Cherry Eater
  • Posts: 71
  • OS:
  • Windows 8.1/Server 2013 Windows 8.1/Server 2013
  • Browser:
  • Chrome 44.0.2403.130 Chrome 44.0.2403.130
    • View Profile
  • Playstyle: Keyboard
Re: Screen shake motion blur
« Reply #6 on: August 06, 2015, 11:26:18 PM »
As for screen shake, you basically just want to adjust the view_angle (be sure to enable views in whatever screen you're doing this in). You can fiddle with the other stuff in https://docs.yoyogames.com/source/dadiospice/002_reference/windows%20and%20views/views/index.html but the angle is the easiest I've found.

Have an old script that does just that.

Quote from: screenShake
///screenShake(time,shakeX,shakeY)
//
//  shakes the screen for an amount of time
//
//      time        the time to shake
//      shakeX      the maximum shaking intensity in x axis(pixel)
//      shakeY      the maximum shaking intensity in y axis(pixel)
//

{
    var inst;
    inst = instance_create(view_xview[0],view_yview[0],objScreenShake);
    inst.alarm[0] = argument0;
    inst.shakeX = argument1;
    inst.shakeY = argument2;
}

and it creates an object that actually shakes the view.

objScreenShake:

Quote from: Create Event:
{
    //get the x,y value of current view
    xview=view_xview[0];
    yview=view_yview[0];
}

Quote from: Alarm 0:
{
    //restoring original views
    view_xview[0]=xview;
    view_yview[0]=yview;
    instance_destroy();
}

Quote from: Step Event:
{
    //shaking views
    view_xview[0]=xview+random_range(-shakeX,shakeX);
    view_yview[0]=yview+random_range(-shakeY,shakeY);
}

Basically you sohuldn't be using this more than once at a time; Otherwise the view in the actual room will be restored to an angle that be off from the actual window.