Flamethrower Help Please


#1

How do I make a flamethrower or something that breaths fire in one direction?


#2

Get an animated flamethrower image (ideally have it so it faces to the right), create it via events action and rotate it to where you want it to face.


#3

Hi, depending on the style of the game a particle emitter with a hidden sprite or a raycast for collision might work as well.


#4

A little more context would be nice, but if I understood you right you want to do something like this: (It’s as simple as can be, you create a Fire object at the desired position with a cooldown, and move it at any angle and speed you need. Also, I’m using a little 6-frame animation for deleting an object, the length of this animation determines a lifetime of an object)


And the result looks like this:


#5

The flamethrower is for a enemy not for the player, how would I do that?


#6

if player distance to enemy = ____ px
change spotted variable of enemy to true
if spotted variable of enemy is true
create flame
add a force towards player