Main Menu

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

Started by Glenn, July 28, 2007, 03:45:11 AM

0 Members and 1 Guest are viewing this topic.

Glenn

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

Shot at 2007-07-26






Arrow

You're going to have to type in complete sentences, and be very detailed. We have no clue what you're talking about.

Glenn

...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

Shot at 2007-07-26






Arrow

What is the name of your slashing sprite? Exactly. And if there's more than one, list them all.

Glenn


Shot at 2007-07-26






Arrow

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

iceflame1019

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