• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Help with trails

R

rxg | Maverick

Guest
So i am making a game with a tron like car and would like the trails to fade the longer they are from the car. I want to make a almost identical replica from this image if possible and would like some help with the alpha commands. Is there an easy way to do this?
 

Attachments

R

robproctor83

Guest
Yes search Google for gamemaker trails and you will find a lot. There is also a free asset in the store I believe for adding trails as well.
 
R

rxg | Maverick

Guest
So i followed a tutorial found online that uses the code but its creating this(picture). Any ideas on how to fix this to be one continuous line ?
/// Create Event : ------------------------------------ trail_x = ds_list_create(); trail_y = ds_list_create(); trail_limit = 20; /// Step Event : ---------------------------------------------- // my movement part x = x + 5 * (keyboard_check(vk_right)-keyboard_check(vk_left)); y = y + 5 * (keyboard_check(vk_down)-keyboard_check(vk_up)); // updating the lists ds_list_add(trail_x, x); ds_list_add(trail_y, y); // limiting the lists if ds_list_size(trail_x) > trail_limit { ds_list_delete(trail_x,0); ds_list_delete(trail_y,0); } /// Draw Event : ----------------------------------------- draw_circle(x,y,5,true); // that's my custom draw_self(); :p for(var i=1; i<ds_list_size(trail_x); i++) { draw_set_alpha(i/trail_limit); draw_line(trail_x[|i], trail_y[|i], trail_x[|i-1], trail_y[|i-1]); } draw_set_alpha(1); draw_line(trail_x[|i-1], trail_y[|i-1], x, y);
 

Attachments

Top