Jump to content


Photo

Dust when my character is running


  • Please log in to reply
4 replies to this topic

#1 Tartine

Tartine

    GMC Member

  • New Member
  • 23 posts
  • Version:GM8

Posted 10 May 2012 - 07:49 PM

Hello !

I would like to know what is the best way to do dust (you know like a little cloud) behind my character when he's running or underneath him when he's jumping ?

Should I use particles ?
Should I do it inside the sprite sheet of my running character ?
Should I do it separately and find a way to match it with my character ?

Do you have an idea ?

Thank you !
  • 0

#2 GreenMeteorTeam

GreenMeteorTeam

    GMC Member

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

Posted 10 May 2012 - 08:19 PM

Since you're a beginner, I suggest just creating an object of dust whenever necessary. Create a small brown (or whatever is appropriate) colored cloud and have that create and fade out at each place where the character's foot hits the ground (and destroy itself after fading out). Then have bigger cloud when the character jumps or lands.

You can use particles too, but for one character it shouldn't make any difference at all in the performance to have dust objects - plus it really adds to the experience, you could even add step sounds and such with the creation of each 'poof' of dust.

And don't do it inside the sprite sheet unless you never want to expand on it. A sprite sheet dust cloud would make it really annoying to say, add a different color dust or effect for different environments.

Good luck!
  • 0

#3 Monstr Gaming

Monstr Gaming

    GMC Member

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

Posted 10 May 2012 - 09:48 PM

copy this into step event:

effect_create_below(ef_smoke,x,y,0,c_ltgrey)

This should work but if it doesn't I might have got the function order wrong :)

This is easier than the first post
i hope you understand it.
  • 0

#4 Monstr Gaming

Monstr Gaming

    GMC Member

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

Posted 10 May 2012 - 09:55 PM

copy this into step event:

effect_create_below(ef_smoke,x,y,0,c_ltgrey)

This should work but if it doesn't I might have got the function order wrong :)

This is easier than the first post
i hope you understand it.


sorry forgot.

to make smoke come out when running i suggest typing:

if x != xprevious and vspeed = 0
(then put my quoted bit here)


if you want it to activate when jumping put this the quoted suggestion it whatever event is your jump button

hope this helps... :) ...i'm a bad explainer
  • 0

#5 decroded

decroded

    GMC Member

  • GMC Member
  • 525 posts
  • Version:GM8

Posted 10 May 2012 - 10:30 PM

copy this into step event:

effect_create_below(ef_smoke,x,y,0,c_ltgrey)

This should work but if it doesn't I might have got the function order wrong :)

This is easier than the first post
i hope you understand it.

Quickest method so try this first, but doesn't give you much control over the look of it.
I say do that first then replace it with GreenMeteor's method.

Since you're a beginner, I suggest just creating an object of dust whenever necessary. Create a small brown (or whatever is appropriate) colored cloud and have that create and fade out at each place where the character's foot hits the ground (and destroy itself after fading out). Then have bigger cloud when the character jumps or lands.

You can use particles too, but for one character it shouldn't make any difference at all in the performance to have dust objects - plus it really adds to the experience, you could even add step sounds and such with the creation of each 'poof' of dust.

And don't do it inside the sprite sheet unless you never want to expand on it. A sprite sheet dust cloud would make it really annoying to say, add a different color dust or effect for different environments.

Good luck!


Here's a bit more info about that.
You need a to make a sprite spr_dust (one frame is fine to start).
The create an obj_effect from your obj_hero whenever you want (e.g. when you land):
ins=instance_create(x,y,obj_effect);
ins.sprite_index=spr_dust;
ins.image_speed=0;
ins.fade_rate=0.05;


obj_effect
CREATE:
fade_rate=0.1;  //just a default to prevent errors
DRAW:
if image_alpha <= 0 {
    instance_destroy();
} else {
    draw_sprite_ext(sprite_index,image_index,x,y,1,1,0,c_white,image_alpha);
    image_alpha -= fade_rate;
}

There are similar methods if your cloud sprite is going to be animated so if you want that let us know...
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users