so id like to make it so my pistols are shot when you press the button, not a press and hold kinda deal, but i did what seemed logical and it didnt work.
heres what the code looks like...
Object(Guninhand) Is faceing ->
Limit Condition for 0.30secs
+Upon Pressing D key
= Fire bullet
logically that would mean you can only shoot every 0.30 seconds, but what happens is you shoot once, and than it wont let you shoot in that direction again. also, there are each of those events for the other directions as well. the only reason i dont have hte bullet fireing in the direction the guninhand is pointing is because in order to have an arm pointed upward on the left side and on the right side, i had to use the 2 spots on the animation thing to the left and right of the UP slot, if that makes any sense. anyone know what i did incorrectly?
[Game design makes my brain feel like its gonna explode.]
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
26th January, 2011 at 13:10:09 -
Repeat while is pressed "Space"
+ Active.AltA = 0
Then
> Active.AltA = 10
> Fire Bullet
If Active.AltA > 0
Then
> Active.AltA = Active.AltA - 1
I remember reading somewhere that using the Timer to have a set time for events isn't as effective as using an alterable value, as one machine may be able to keep up with the timer, but others might not. As I am not the best at coding, I tend to stick with using Alterable Values in all cases where a timer might do, simply because if there's a sequence of events based upon timers and/or regular intervals, they'll always keep pace with the way the rest of the game is running.
But most of y'all know this already. My point is that I just shy away from using the Timer object unless there are very, very few Active Objects and/or functions/events.
Originally Posted by s-m-r (for all the noobs and fellow novices out there)
I remember reading somewhere that using the Timer to have a set time for events isn't as effective as using an alterable value, as one machine may be able to keep up with the timer, but others might not. As I am not the best at coding, I tend to stick with using Alterable Values in all cases where a timer might do, simply because if there's a sequence of events based upon timers and/or regular intervals, they'll always keep pace with the way the rest of the game is running.
But most of y'all know this already. My point is that I just shy away from using the Timer object unless there are very, very few Active Objects and/or functions/events.
For the perfectionist its also less accurate as you cannot reset the timer.
If you have an event that says
Z is pressed
+ Every 00.05
- Shoot
and you start pressing Z at 0.02 then the object shoots 00.02 seconds earlier
if that makes sense.
Negligible? Probably, but it bothers me. You can reset the alterable value if the player lets go of shoot.
I still have a nasty habit of using timer events. I also have a nasty habit of stopping at a McDonalds and suddenly getting hungry. I know it's horrible for me, and when I think about it long enough, I go for the much better alternative. I think this is a pretty good analogy.