Stopping a bullet

Non-platform specific questions.

Stopping a bullet

Postby raptor1313666 » Wed Nov 24, 2004 3:12 pm

Greetings,

I'm currently evaluating the utility of Game Editor by prototyping an upcoming 2D project for my rather small indie company. While most of my time has been spent muddling through the evaluation version, I'm quite pleased so far.

Anyway, I currently have a "game" where you click on a point in the screen and the player fires a projectile at the mouse coordinates. This "bullet" so-to-speak (it will be many different things, in truth), fires and travels to the point just fine. It even stops, as it should, at the specified location (where the mouse was at the time of the firing).

My question is this: How can I destroy the bullet actor once it's reached it point? The bullet does collide with enemies on the screen, but there is also the chance for it to "miss" and merely collide with the ground.

Right now, the bullet just stops and stays persistent until an enemy collides with it. While an interesting effect that I'll keep around for other weapon styles, it's not what I'm aiming for right now (no pun intended).

Is there some sort of "on actor stop" event that I can use to trigger this destroy event? Or is there some other way to achieve what I'm after?

Please note I only start using this thing late last night, so I definitely haven't explored all avenues.

I thank any of you in advance for your responses and your time!
-Richard "Raptor" Powell

"Nice guys may finish last, but, you know,
the company's much better back here."
raptor1313666
 
Posts: 4
Joined: Wed Nov 24, 2004 3:03 pm
Score: 0 Give a positive score

Postby jazz_e_bob » Wed Nov 24, 2004 8:59 pm

pseudocode follows...

On Draw Bullet:
if directionalvelocity is 0
destroy event actor

:wink:

Have fun!
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Postby raptor1313666 » Fri Nov 26, 2004 12:27 am

jazz_e_bob wrote:pseudocode follows...

On Draw Bullet:
if directionalvelocity is 0
destroy event actor

:wink:

Have fun!


Thanks, that did it perfectly!
-Richard "Raptor" Powell

"Nice guys may finish last, but, you know,
the company's much better back here."
raptor1313666
 
Posts: 4
Joined: Wed Nov 24, 2004 3:03 pm
Score: 0 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest