User Tag List

Results 1 to 6 of 6

Thread: frequency / fire rate

  1. #1
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    frequency / fire rate

    Basically I'm making a horizontal shooter in MMF2.

    My first question is how games manage to keep the fire rate constant regardless of the ships movement.
    When I play console and arcade shooters, the shots that emit from the ship are all the same distance from each other regardless of the ship movement.

    At the moment when I move my ship it changes the frequency of the bullets. When moving backwards the space between each bullet becomes bigger and when I move forward the space between the bullet becomes smaller.


    How can I make it so that the bullets are always the same distance apart/have a constant frequency?


    The second problem I have is fine tuning my shots.
    This is how I activate my shots:

    The problem arises when I try and make the frequency less than 25... if i lower it below 26 the bullets come out as a stream (see below)... any ideas how I can raise the frequency without this happening?

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: frequency / fire rate

    The trouble is that physically it makes sense that the bullets spread out when you're moving backwards and bunch up when you're moving forwards - if you're moving backwards, by the time you get to fire the next bullet you've already moved a little away from the last one, so the distance will be greater.

    I can't really think of a solution to this short of slowing down the bullets a little when you're moving forwards, and speeding them up when you're going backwards, to correct the distance as they go... the other suggestion I have is to only allow bullets to be created at certain times so that they'll line up with each other, but I can see that becoming terribly awkward to write.

    For the second problem, try replacing your "Restrict actions" event with a counter/alt value that continually counts upwards when you're holding down Fire and resets when it's above a certain value, and only allow the player to fire when this is zero. This will allow you greater fine-tuning to the point of how many frames are allowed between shots.

    Also, I'd replace that "Repeat while A is pressed" event with either a player button or a Control-X object to allow customizable controls.

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jul 2006
    Location
    Joshua, Texas, Earth, Solar System, Milky Way, Local Group, Unverse 0
    Posts
    96
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: frequency / fire rate

    The fire rate is constant, but when the object doing the firing moves closer or farther at the same time the objects it already shot are still moving, they will become compressed or expand.... it's the Doppler Effect man.

    You would have to make the bullets move in relation to the ship in order to have them look like one unchanging stream... but that would be rather silly since bullets would be moving forward and backward to adjust themselves, lol.

    I can't think of a single game where this happens, just stick with shooting objects normally

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: frequency / fire rate

    Quote Originally Posted by DavidN
    For the second problem, try replacing your "Restrict actions" event with a counter/alt value that continually counts upwards when you're holding down Fire and resets when it's above a certain value, and only allow the player to fire when this is zero. This will allow you greater fine-tuning to the point of how many frames are allowed between shots.

    Also, I'd replace that "Repeat while A is pressed" event with either a player button or a Control-X object to allow customizable controls.
    Do you think you could expand on that first part?
    I'm not sure I grasp the concept totally.

    Also, is it possible to explain the control-x object, as I don't seem to be able to find that.
    My plan was to allow customisable controls, but I haven't figured out how to implement that yet. :]

    Cheers.

  5. #5
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: frequency / fire rate

    OK then. Naming the counter "FireDelay":

    + Repeat while Fire is pressed
    + FireDelay == 0
    -> (Fire)
    -> Set FireDelay to 1

    This allows firing when the counter is 0, and prevents firing by moving the counter away from 0 when a shot is fired.

    + FireDelay > 0
    -> Add 1 to FireDelay

    Keep adding to the delay counter when a delay is on.

    + FireDelay > 20 (Modify this to change the delay)
    -> Set FireDelay to 0

    Once it's reached a certain value, set it back to 0, ready to fire again.

    The Control-X object is in the z33z extension pack. It has the ability to detect whether keys are pressed or not based on their values, and if the values to detect are stored in global variables, then you can change the controls by changing these globals.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2006
    Location
    Virginia, USA
    Posts
    1,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: frequency / fire rate

    One really quick way would be to eliminate the bullet objects altogether, and just make a long flame animation that sets it's position to the ship. That way you could fix your problem like that.

Similar Threads

  1. Samples: Frequency?
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 9th April 2012, 07:38 AM
  2. Touch Joystick, Fire 1 Button, Fire 2 Button
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 13th February 2012, 01:37 AM
  3. Problem with fire 1 and fire button 2 in beta 11
    By Koji_Kabuto in forum iOS Export Module Version 2.0
    Replies: 1
    Last Post: 31st January 2011, 07:51 PM
  4. Sound frequency
    By Horn in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th May 2007, 08:02 PM
  5. Frame rate/frequency issues
    By Ramses in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th February 2007, 08:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •