1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

GM:S 1.4 How Do I Make a Light Emitting Barrelfire.

Discussion in 'Programming' started by AngryMesanthropistFreak, Jun 26, 2016.

  1. So I'm making an RPG. In one of the places its night And I'm wondering how I could make a barrel animated with fire emit a pulsating glow around it. I parallaxed the map in Photoshop (like I've been doing with all my maps) with a black layer given a light opacity to create the illusion of night. I was thinking of adding in the glow effect in Photoshop but I'm not sure how I would animate it. Plus that might be real tedious. Can I animate it in game maker some how.

    A step by step walking through of this would be helpfull or a video walkthrogh. I learn best through follwoing pre set out examples.
     
  2. Jaqueta

    Jaqueta Member

    Joined:
    Jun 23, 2016
    Posts:
    338
    You could animate by tweaking the Scale, Opacity, and position a bit.

    Here's a little script that increases a value to 1, and then decreases to 0, and then to 1........
    Put this into a var and then use it as a base value to tweak your light.
    Code:
    var pulse=dsin(current_time*4) ///Change the 4 Value to make the pulse faster or slower,
    Lets say that you want the light to pulse with value between 0.8 and 1.
    Then you would use something like this:
    Code:
    light_scale=0.8+(0.2*pulse),
    with the Alpha it would be the same thing
    Code:
    light_alpha=0.7+(0.3*pulse);
    Obviously, you would like to put these vars into a draw_sprite later
    Code:
    draw_sprite_ext(spr_light,0,x,y,light_scale,light_scale,0,light_color,light_alpha)
    For the Light Color you would probably use c_orange or something like that.

    Good luck. ;D
     
  3. And I'm asumeing this goes into the barrel fire object?
     
  4. Jaqueta

    Jaqueta Member

    Joined:
    Jun 23, 2016
    Posts:
    338
    Yes, on the Draw Event, of course that some changes may be necessary, but this is up to you.
    Don't forget to call a draw_self() function before this script to make sure that the barrel will be drawn
     

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