GMS 2 [SOLVED] Earthquake Shake Conversion

Discussion in 'Programming' started by T2008, Sep 10, 2019.

  1. T2008

    T2008 Member

    Joined:
    Jul 20, 2016
    Posts:
    163
    I'm in process of converting game over from gm1.4 to gm2. I have an earthquake effect with the following old compatibility script. Does anyone have any idea what the new code under gm2 would be?

    Code:
    __view_set( e__VW.WView, 1, 960 + choose(random(3),random(7 ))); // width of room, amount of shake
    __view_set( e__VW.HView, 1, 540 + choose(random(-3),random(-7 ))); 
    
    Thanks for any help
     
  2. YellowAfterlife

    YellowAfterlife ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ Forum Staff Moderator

    Joined:
    Apr 21, 2016
    Posts:
    2,380
    it would be camera_set_view_pos(view_camera[1], 960 + ..., 540 + ...)
     
  3. T2008

    T2008 Member

    Joined:
    Jul 20, 2016
    Posts:
    163
    Thanks for your help! Your code was slightly off, but worked with camera_set_view_size instead of position. Thanks again!
     

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