Legacy GM How Do I Make a Light Emitting Barrelfire.

  • Thread starter AngryMesanthropistFreak
  • Start date
A

AngryMesanthropistFreak

Guest
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.
 
J

Jaqueta

Guest
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
 
A

AngryMesanthropistFreak

Guest
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
And I'm asumeing this goes into the barrel fire object?
 
J

Jaqueta

Guest
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
 
Top