Page 1 of 1

How to use 'on step' with bullet movement?

PostPosted: Fri Feb 08, 2008 10:51 pm
by Arima
I'm trying to set up an instant-hit shot, but it doesn't seem to work. The event is currently:

If leftmouse is down, create object 'laser', set angle to mouse location

On step and on collision between laser and enemy, destroy enemy

Thoughts?

Re: How to use 'on step' with bullet movement?

PostPosted: Sun Feb 24, 2008 5:36 am
by kpbotbot
the mouse location cannot become an angle ( coz mouse location = (x,y) and angle is (0-360)..)

hope this helps..

but u could have a "dummy sprite" that is very very invisible. that way, u could have your object point towards that dummy sprite and you could launch you laser object towards that dummy sprite.

also, the bullet movement for the laser is useful..

Re: How to use 'on step' with bullet movement?

PostPosted: Sun Feb 24, 2008 5:43 am
by Maev
couldn't you have the object actually spawn at mouse location, and have that object do what you want it to do?

Re: How to use 'on step' with bullet movement?

PostPosted: Sun Feb 24, 2008 6:24 am
by deadeye
[quote="kpbotbot":3nynpigl]the mouse location cannot become an angle ( coz mouse location = (x,y) and angle is (0-360)..)

hope this helps..

but u could have a "dummy sprite" that is very very invisible. that way, u could have your object point towards that dummy sprite and you could launch you laser object towards that dummy sprite.

also, the bullet movement for the laser is useful..[/quote:3nynpigl]

What in the world are you talking about? "bullet: Set angle towards (mouseX, mouseY)" works just fine.

Re: How to use 'on step' with bullet movement?

PostPosted: Sun Feb 24, 2008 11:23 am
by kpbotbot
hehehe... i didnt see some words.. i was being stupid.. :D i didnt know u used "towards".

Re: How to use 'on step' with bullet movement?

PostPosted: Sun Feb 24, 2008 4:44 pm
by Ashley
BTW in regards to the original problem I think you should use 'Is overlapping' instead of 'On collision':

+ On step
+ Is overlapping Object
: Destroy bullet etc.