Posts Tagged bow maker as seen on tv

Bow Maker

Posted in Ribbons | No Comments »

game maker help{attacks}?

hello
ok well 1st i wanna no.
how would i make it so the enimie loses health every time ur right next to it and by pressing z or some thing (for sword)
{for bow} how would you make it so u press "x" it fires a arrow
{for emimie} how would i make is so when i press "X" or "Z" {attacks} it lowers its health and when it dies?

And i dont want web sites with movies or that only explanes 1 thing
i want info plz

OK, Here's how I did it back in the GM6 days:
You make in key press (x) it creates object arrow at position (0,0) relative (might want to tweak it a little bit to make it look like it's coming out of the bow and not the centre of the guy).

In the create event of arrow set the horizontal speed to 5 or 10 or something.

In the enemy event, on create, set the variable health to 5 or whatever.
On collision with arrow, set health (the variable you created, not the in-built "health" function in GM!) to -1 (relative). Then below that add destroy object (other).
In step, if health=0, detroy self.

For the sword, just do the same thing but don't make the sword object move, and also make it delete itself on an alarm.

To shoot the other way, just reverse all the co-ordinates from the last time. You can easily use variables (which change on key presses) to check which way the character is facing.

And there you have it!

Read the rest of this entry »