[GM] How to check if Hero is touching sprite:HELP ME PLZ:

0 Members and 1 Guest are viewing this topic.

**
Banned
Rep:
Level 86
What are you looking at...Yes im a frog.....*Lick*
I dont know hot to set it that If I press enter i slash and if Im touching an enemy when I press Enter It
Kills it
« Last Edit: March 04, 2014, 01:46:41 AM by modern algebra »

Shot at 2007-07-26






********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
You're going to have to type in complete sentences, and be very detailed. We have no clue what you're talking about.

**
Banned
Rep:
Level 86
What are you looking at...Yes im a frog.....*Lick*
...Thx arrow

... here it is

Shot at 2007-07-28


ME *REd haried*
wanna press enter and slash*Got that down*
But don't know how ot make slash kill enemy
« Last Edit: July 28, 2007, 04:38:50 PM by Arrow »

Shot at 2007-07-26






********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
What is the name of your slashing sprite? Exactly. And if there's more than one, list them all.

**
Banned
Rep:
Level 86
What are you looking at...Yes im a frog.....*Lick*
Spr_atl_left

sprite_attack_right

3 frames each

Shot at 2007-07-26






********
Rep:
Level 96
2011 Most Missed Member2010 Zero To Hero
Okay:

Make a collision event in your hero object, and make it a collision with the enemy.

In there, make an if statement. (Control tab in the object window, it's on the right, then right-click the one that looks like a question mark. In there say:

self.sprite_index=Spr_atl_left

Click okay, or confirm, or whatever, then make a destroy event, and apply it to other.

Do this again, in the same event, but this time the question mark says:

self.sprite_index=Spr_attack_right

****
Rep:
Level 88
wrath of winter
I just take a shortcut and create a "killing instance" that kills itself when a certain amount of time is up.  When I press the attack key it makes the object at a certain distance from the hero, and when an enemy touches that object it "dies".  I usually use the Alarm function and set it to about 1-4 steps so the object lasts only as long as the animation.  Very handy.

I like to use the D&D approach but you could also go with Arrow's coding.

Want a personal sig like this? Ask Firerain:
http://rmrk.net/index.php/topic,20203.0.html