Ultimate Amiga

Network Boards => AMOS Language Discussion => AMOS Factory => AMOS The Creator Forum => Topic started by: BooBoo on October 22, 2008, 11:59:58 AM

Title: AutoFire ?
Post by: BooBoo on October 22, 2008, 11:59:58 AM
Hi - Im trying to write a little game and not sure if im gonna use KeyBoard or Joystick but weather I use Inkey$ or Fire(1) holding down the button results in an autofire afect that i dont want is there a way around this Ive tryed Key Speed but this throws my Left and Right controls out and is keyboard only.
Title: Re: AutoFire ?
Post by: SamuraiCrow on October 22, 2008, 04:16:02 PM
Some game that I have played just wait until the fire button on the joystick is released before it actually does anything.  Maybe that might be an easier approach.

Relying on key repeating doesn't seem like a reliable way to do it.
Title: Re: AutoFire ?
Post by: BooBoo on October 22, 2008, 06:26:36 PM
Thanks for your reply Well its a beat em up so Fire results in contious punches or punch once the buttons released?
Title: Re: AutoFire ?
Post by: SamuraiCrow on October 27, 2008, 09:30:51 PM
Wow, I didn't know that about Amos.  I'd only seen the fi command on UNIX shell scripts so I didn't expect it here.

BTW, the code tags are activated by a button with a '#' symbol on it.  (Whatever that means.)
Title: Re: AutoFire ?
Post by: tarantino88 on August 12, 2018, 04:50:32 PM
If you only want 1 fire to happen you should check for a flag around your fire (1) check, I would be lazy and make this a integer.
E.g.
If flag =0
flag=1 : rem this stops us coming in on next loop
If fire(1) = true
...
...
Rem your code
...
...
End if
End if

Initialise flag=0
You then need to set flag back to 0 when your animation or movement has finished (I'm assuming you are checking for this somewhere)

I've not tested the code in AMOS so there may be syntax errors, but hopefully you understand the principal behind it.