1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

GM:S 1.4 Need little assistance with screen shake effect

Discussion in 'Programming' started by Zuljaras, Apr 27, 2019.

  1. Zuljaras

    Zuljaras Member

    Joined:
    Jan 16, 2017
    Posts:
    414
    Hello,

    So I have the following code in the player (object that is followed by the view) DRAW event.

    Code:
    if(shake){
      view_angle=choose(irandom(2),irandom(2)*-1);
    }else{
      view_angle = 0;
      }
    It works fine but I want to know if I can make it the same with up, down, left and right?

    I tried with view_xview etc. but the only things that moved were my health bar objects. Not the whole screen.
    The view_angle works so good why can't the other view parameters work the same.

    I want to make the screen shake without camera control object. My player_parent object is the one followed.
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    6,982
    The issue is probably that you have some other object that is setting the view x/y position and so over-riding the position you set with the screenshake... So, to fix this we need to know one thing... are you setting object following using the room editor? Or through code in the player object? If it's through code then we need to see the code, and if it's in the room editor then we'll need to switch that off and add code to do it into the player. So, let us know what you're doing and then we can help you edit things to get the screenshake to work.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice