PeterOEMaeggard
Member
Hiya!
I am making a top-down sci-fi shooter.
I have a lighting layer (instance layer), where all sprites subtracts from a dark surface making a lighting effect. I used a tutorial to create that.
I want my player shots to draw a small sprite or sphere in the lighting room, but still keep the player bullet in the
I really don't want to create an object in the lighting layer to stay untop of the bullet, since it will get hard to control and use extra ressources. Unless there's a really easy way to connect the lighting object with the bullet object, so it destroys when the bullet object destroys.
Atm I create objects from the player, when the player creates a bullet or some sort, and then destroy the objects soon after with an alarm, so the light don't continue when the bullet hits a wall or enemy. But this is really not a good solution and works more like lighting from the weapons rather then the bullets.
I've tested the following code, but it crashes my game and doesn't really seem right:
Screenshot attached. The robot with the light-saber kinda thing to the right is the player. The vast amount of blue/cyan bullets he's firing is what I want to create a small sprite on the Lights layer.
I am making a top-down sci-fi shooter.
I have a lighting layer (instance layer), where all sprites subtracts from a dark surface making a lighting effect. I used a tutorial to create that.
I want my player shots to draw a small sprite or sphere in the lighting room, but still keep the player bullet in the
I really don't want to create an object in the lighting layer to stay untop of the bullet, since it will get hard to control and use extra ressources. Unless there's a really easy way to connect the lighting object with the bullet object, so it destroys when the bullet object destroys.
Atm I create objects from the player, when the player creates a bullet or some sort, and then destroy the objects soon after with an alarm, so the light don't continue when the bullet hits a wall or enemy. But this is really not a good solution and works more like lighting from the weapons rather then the bullets.
I've tested the following code, but it crashes my game and doesn't really seem right:
GML:
layer_add_instance("Lights",self);
draw_rectangle(x,y,x+100,y+100,false);
layer_add_instance("PlayerBullets",self);