Jump to content


Photo

Flamethrower Effect


  • Please log in to reply
8 replies to this topic

#1 justbegun

justbegun

    GMC Member

  • New Member
  • 26 posts

Posted 25 September 2011 - 08:39 AM

Hello. I am creating a scrolling shooter, and I need a flame thrower effect for my flame thrower. Like when you move right or left, the flaming bit in the top will follow the player the slowest. I have thought about using different sprites for the object, which change as the player moves, is there a code for this. Say when the player move right, the flame will follow later on.

DIAGRAMS - try to ignore the stripe, the o's are the flame.

MOVE RIGHT

---oooo
oooooooo
---oooooooo
------oooooooo
---------oooooo
-----------oooo
------------oo
-------> (PLAYER)


STAY IN ONE POSITION
----------oooo
--------oooooooo
--------oooooooo
--------oooooooo
---------oooooo
----------oooo
-----------oo
-----> (PLAYER)<-

MOVE LEFT
----------- oooo
---------oooooooo
-------oooooooo
------oooooooo
----oooooo
--- oooo
---oo
(PLAYER)<-

Thanks in advance :)
  • 0

#2 thunderbolta

thunderbolta

    GMC Member

  • New Member
  • 15 posts

Posted 25 September 2011 - 08:56 AM

Does making the flamethrower just move forwards not create the same effect? As the player moves to the side he will spawn the flames in a new place, generating the same(if not similar)effect.
  • 0

#3 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4172 posts
  • Version:GM8

Posted 25 September 2011 - 09:09 AM

Just make the flame individual instances instead of just one object with one sprite. For example:

// CREATION OF FLAME
new_flame=instance_create(x,y,flame)
new_flame.direction=90
new_flame.speed=7
new_flame.alarm[0]=30

// FLAME ALARM0 EVENT
image_alpha-=0.05
alarm[0]=1

if image_alpha<=0
instance_destroy()

The flames will travel upwards while you are still moving, creating the effect you described above. All you have to do is get a good flame(ish) sprite for each instance and voila, fully working flamethrower!

Hope that helps.

Edited by stubbjax02, 25 September 2011 - 09:09 AM.

  • 0

#4 justbegun

justbegun

    GMC Member

  • New Member
  • 26 posts

Posted 25 September 2011 - 11:49 AM

Does making the flamethrower just move forwards not create the same effect? As the player moves to the side he will spawn the flames in a new place, generating the same(if not similar)effect.


I understand what you are trying to say, Im aware of that, however, I want the flame not to move forward and disappear. As if creating a flame that always stays in front of the player's mouth. Though, thank you for the reminding, I will use that for back-up. ;)

Just make the flame individual instances instead of just one object with one sprite. For example:

// CREATION OF FLAME
new_flame=instance_create(x,y,flame)
new_flame.direction=90
new_flame.speed=7
new_flame.alarm[0]=30

// FLAME ALARM0 EVENT
image_alpha-=0.05
alarm[0]=1

if image_alpha<=0
instance_destroy()


The flames will travel upwards while you are still moving, creating the effect you described above. All you have to do is get a good flame(ish) sprite for each instance and voila, fully working flamethrower!

Hope that helps.


Thank you for the code, I will try it, and try to make a good flamish sprite. Thank you very much :)
  • 0

#5 Stubbjax

Stubbjax

    RandomGuy General

  • GMC Member
  • 4172 posts
  • Version:GM8

Posted 25 September 2011 - 12:06 PM


Just make the flame individual instances instead of just one object with one sprite. For example:

// CREATION OF FLAME
new_flame=instance_create(x,y,flame)
new_flame.direction=90
new_flame.speed=7
new_flame.alarm[0]=30

// FLAME ALARM0 EVENT
image_alpha-=0.05
alarm[0]=1

if image_alpha<=0
instance_destroy()


The flames will travel upwards while you are still moving, creating the effect you described above. All you have to do is get a good flame(ish) sprite for each instance and voila, fully working flamethrower!

Hope that helps.


Thank you for the code, I will try it, and try to make a good flamish sprite. Thank you very much :)

Welcome. :)
  • 0

#6 hwasser

hwasser

    GMC Member

  • New Member
  • 19 posts

Posted 25 September 2011 - 05:38 PM

My method for doing sexy looking firebullets and flamethrowers (and even snowthrowers :P) is by making a circle shaped bullet with quite large size (16p or more) and make invincible and make it create special effect around itself: fire (or flare or whatever it is called)
  • 0

#7 sneaky666

sneaky666

    536e65616b79

  • GMC Member
  • 1047 posts
  • Version:GM:Studio

Posted 25 September 2011 - 05:42 PM

why not just use

effect_create_below(ef_smokeup,x,y,0,c_red);

where x,y is the location of your head, 0 is the size (choose 0,1,2 (2 is the largest)), you can change effect_create_below to effect_create_above is you want it to draw above (depthwise) the player.
  • 0

#8 justbegun

justbegun

    GMC Member

  • New Member
  • 26 posts

Posted 25 September 2011 - 07:22 PM

Thank you everyone, all suggestions will be tried next week, when i can resume my work on the game.
  • 0

#9 Shadowrend

Shadowrend

    Master of Shadows

  • GMC Member
  • 3045 posts
  • Version:GM8

Posted 25 September 2011 - 08:14 PM

Search my content in Tutorials and examples. I have a great TDS example.

Here.
http://gmc.yoyogames...pic=472448&st=0

Edited by Shadowrend, 25 September 2011 - 08:20 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users