The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: Glenn on July 28, 2007, 03:45:11 AM

Title: [GM] How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Glenn on July 28, 2007, 03:45:11 AM
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
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Arrow on July 28, 2007, 04:03:36 AM
You're going to have to type in complete sentences, and be very detailed. We have no clue what you're talking about.
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Glenn on July 28, 2007, 03:23:50 PM
...Thx arrow

... here it is
(http://img443.imageshack.us/img443/8578/hellpxj8.png) (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
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Arrow on July 28, 2007, 04:39:18 PM
What is the name of your slashing sprite? Exactly. And if there's more than one, list them all.
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Glenn on July 29, 2007, 12:17:46 PM
Spr_atl_left

sprite_attack_right

3 frames each
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: Arrow on July 29, 2007, 03:15:06 PM
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
Title: Re: How to check if Hero is touching sprite:HELP ME PLZ:
Post by: iceflame1019 on July 30, 2007, 02:55:27 PM
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.