View Single Post
Posts: n/a
Default 03-28-2010, 11:16 AM

Originally Posted by Down with duke View Post
Wow thanks, that worked great. But let me see if I can't explain myself a bit better on the first part...

From what I understand the "On Click" event loop captures mouse clicks and points them to a method, however, if the method the "On click" event was told to preform takes longer than it takes for the player to click agian then the event loop will make a list of that method to preform sequentially. This is bad for me because if you continuously click, the gun I have positioned wont stop shooting until it finishes playing through all of them.

If you want to see the problem for yourself I attached what I have so far:
Are you using "bullets"? If so, you could have one bullet that returns to the gun after every shot. Then set up a function so that the bullet has to be "in" the gun before the gun will shoot. That way if the bullet is "down range" and you click again nothing will happen.

1) you would need a boolean variable set to false. Then create event: When "object" is clicked on set "variable" to "true"

2) Create another event: When "variable" is "true" and "bullet" is within 1 meter of "gun" do: "gunShoot" and "setVariableFalse"

Here is a world where I'm using the tennis ball as "bullets". See if this helps you out.
Attached Files
File Type: a2w gunShoot.a2w (466.6 KB, 7 views)

Last edited by rankhornjp; 03-28-2010 at 12:20 PM.
Reply With Quote