x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Fully automatic weapon?

Hey :)

I have managed to get a fully working weapon system for my game, however I have encountered a few problems. The main one is, how I can get my function to be called as long as the mouse button is pressed. Anyone know how I could do that?

Cheers, and thank you in advance for any help or advice.

Product Version: Not Selected
Tags:
more ▼

asked Nov 04 '14 at 08:00 PM in C++ Programming

avatar image

Borzi
174 44 39 49

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

Hello there :) I implemented my automatic weapon system by having a StartFire and StopFire methods. When you press your mouse down you call StartFire, which spawns the projectile and then i set a SetTimer that calls StartFire again after the time interval between shots. When you release the mouse you call StopFire which clears the SetTimer used to create the loop.

more ▼

answered Nov 04 '14 at 08:49 PM

avatar image

xlar8or
6k 163 130 305

avatar image Borzi Nov 04 '14 at 08:53 PM

That makes perfect sense, thanks man :)

avatar image xlar8or Nov 05 '14 at 10:33 AM

You're welcome :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Check out the ShooterGame example.

more ▼

answered Nov 04 '14 at 09:24 PM

avatar image

Camron
21 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question