Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: AutoFire ?  (Read 5880 times)

0 Members and 1 Guest are viewing this topic.

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
AutoFire ?
« 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.
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: AutoFire ?
« Reply #1 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.
Logged

BooBoo

  • Amiga Guru
  • A600
  • ****
  • Karma: 3
  • Offline Offline
  • Posts: 168
Re: AutoFire ?
« Reply #2 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?
Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: AutoFire ?
« Reply #3 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.)
Logged

tarantino88

  • A600
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 4
  • Generic Amiga User
    • Purple Viking
Re: AutoFire ?
« Reply #4 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.
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022