User Tag List

Results 1 to 3 of 3

Thread: Shooting While Looping

  1. #1
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Shooting While Looping

    I have a question if I may.

    How would you code the character shooting inside a loop that makes the character move.

    What I have is:

    On loop horiz
    +User pushes the B key
    +Character:Flag 1 is on

    Character launch bullet at speed 50 (action point, located, oriented

    Thanks for any thoughts, beliefs, coding.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    658
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting While Looping

    First, I wouldn't use the Shoot Object function, I'd use the Create Object function and separately code the bullet's movement by triggering a Movement variable once it's created and then coding the movement based on that.

    Second, unless the character has to be moving in order to shoot, there's no real reason to keep the On Loop function or even the Movement Flag condition.

    For instance:

    +Upon Pressing the B Key

    - Create Object Bullet at Action Point (Player)
    - Set Bullet "Move" variable to 1.
    - Set Bullet "Direction" variable to Current Direction Value Direction(Player) (under Animation).

    If Bullet "Move" Variable = 1
    + Direction of Bullet = Right Direction Value
    - Set X position of Bullet to X ("Bullet") + 10

    If Bullet "Move" Variable = 1
    + Direction of Bullet = Left Direction Value
    - Set X position of Bullet to X ("Bullet") - 10

    The only time I would worry about the character shooting while moving and shooting while standing still is how that affects the character's animations, and I usually control those separately from the rest of the code for that very reason.

    That's just the simple version of it, and of course only works if you're only worried about affecting the bullets on the X-Plane. However, you could store X and Y directional values in separate alterable values in the bullet and move them based on those. If the bullets were being fired left and right, the Y value would not be added to the movement speed, and same for up and down.

  3. #3
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting While Looping

    Thanks dsilvers. Your suggestion was the same as steven1980 via pm. This solved my problem. Appreciated.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

Similar Threads

  1. MP3 seamless looping
    By Olivier in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 11th September 2011, 03:48 AM
  2. Sound Looping
    By variant in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 23rd November 2009, 06:03 PM
  3. MCI - Looping a wav?
    By Dines in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 15th July 2008, 11:53 AM
  4. for ... next looping
    By delusan in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 6th April 2007, 07:35 PM
  5. Bug: F2 and Sample that is looping ...
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 26th February 2007, 08:31 AM

Posting Permissions

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