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
You're going to have to type in complete sentences, and be very detailed. We have no clue what you're talking about.
...Thx arrow
... here it is
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg443.imageshack.us%2Fimg443%2F8578%2Fhellpxj8.png&hash=f49e2a2d999f49b78771f97b6e9e9d1c99593763) (http://img443.imageshack.us/img443/8578/hellpxj8.png)
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
What is the name of your slashing sprite? Exactly. And if there's more than one, list them all.
Spr_atl_left
sprite_attack_right
3 frames each
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
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.