1
I am making a game called Dungeon Rush, and I am using a lighting system that I've made. It is grid based and it looks pretty cool, I was wondering how I could increase my fps with it.
LIGHTING SYSTEM CODE -
LIGHTING SYSTEM CODE -
obj=instance_nearest(x,y,obj_player);
if (distance_to_object(obj)<160)&&!collision_line(x+16,y+16,obj.x,obj.y,obj_wall,1,1){
temp_alpha=distance_to_object(obj)/160;
};else
{temp_alpha=1};
alpha2=1;
if temp_alpha<alpha2
alpha2=temp_alpha
{
draw_sprite(sprite_index,image_index,x,y);
draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,image_yscale,image_angle,c_black,alpha2);
};
Create an account or sign in to comment.
6
1
Cache the results and only re-calculate it on affected tiles when they or nearby tiles change.
1
I'll try to do that, thanks for the advise!
1
Could you provide a picture of what the lighting looks like? As if it were in the world
1
I added a picture in my first post.
1
bump... =\
1
BUMP...