User Tag List

Results 1 to 6 of 6

Thread: Shooting Question

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Shooting Question

    Hi All,

    I wonder if I could ask for some advice..

    I have a baddie shoot a bullet every 0.25 seconds. (he moves as well). However every 5.00 seconds i want him to shoot a bonus item.

    I can do this, BUT i want him then not to shoot the normal bullet at the same time but after he has shot the bonus, i want it to revert back.

    I did this..
    start of frame
    - set flag to 0

    every 0.25
    & flag=0
    -baddie shoots bullet


    every 5.00
    -set flag to 1

    if flag is 1
    baddie shoots bonus
    -set flag to 0

    Im sure im missing something here though..

    any ideas? (or a better way of doing it)

    thanks in advance.

  2. #2
    No Products Registered

    Join Date
    Jan 2011
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting Question

    Looking at what your writing out in pseudo code it looks right and it should work. What is happening instead of the desired outcome?

  3. #3
    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: Shooting Question

    It looks you have sort of the right idea - it would take a small change to get it right:

    Always: Set flag to 0
    Every 5 seconds: Shoot a powerup and set flag to 1
    Every 0.25 AND flag is 0: Shoot a bullet and set flag to 1

    Every time the events are checked, they're run in order from top to bottom. Each time, the flag will start at 0. If the timer is at a five-second mark, then a powerup will be shot and the flag will be set to 1 for this point downwards. If, on the second event, a powerup has already been shot, then the flag will have been set to 1, and the bullet will be prevented from shooting as well (as it will only do so when the flag is still 0).

  4. #4
    No Products Registered

    Join Date
    Jan 2011
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting Question

    Hmm, interesting.
    I was under the falsehood that when something was set to "Always" that it would ALWAYS be set to a certain property. Guess that doesnt really make any sense when I think about it tho. How is the "Always" command best used then?
    Also, Im curious as to the way you put the 5 seconds condition before the 0.25 seconds one. I obviously still have a long way to go.
    Sorry to hi-jack your thread RedSquirrel, just interested in learning all I can about the programming in MMF2.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module

    Join Date
    Jul 2006
    Location
    S.East England
    Posts
    744
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting Question

    no prob!

    I tried out this again, and it didnt seem to really change. However i increased the time from 0.25 to 0.50 and it seems a bit better.

    Maybe the time between each shot causes little issues..

    In a way id prefer to not drop the power up every five second (perhaps make it random) but then again as its a score challenge game it might be somewhat unfair if some times there is more chance to obtain the power up (or score in this case).

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Shooting Question

    This might work a bit better, especially if a power-up drop and a gunshot will not always be perfectly in-sync:

    Every 5 seconds: Shoot a powerup and set flag to 1
    Every 0.25 AND flag is 0: Shoot a bullet and set flag to 1
    Every 0.25 AND flag is 1: Set flag to 0

    That should cause a bullet not to be fired once, anytime after a power-up is dropped. This would allow you to drop power-ups every 5.12 seconds for example and have it still work out OK.

    Quote Originally Posted by Thrawn
    Hmm, interesting.
    I was under the falsehood that when something was set to "Always" that it would ALWAYS be set to a certain property. Guess that doesnt really make any sense when I think about it tho. How is the "Always" command best used then?
    Also, Im curious as to the way you put the 5 seconds condition before the 0.25 seconds one. I obviously still have a long way to go.
    Sorry to hi-jack your thread RedSquirrel, just interested in learning all I can about the programming in MMF2.
    Using the "Always" condition is akin to using a condition such as "1 = 1": It will always be evaluated as true, although it doesn't necessarily always happen. The "Never" condition can be thought of as "1 = 2", and will actually cause an event to never happen (because a single false condition will stop the entire event). Hope that helps.

Similar Threads

  1. another 360 degree shooting question
    By Greasy in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 6th May 2012, 11:21 PM
  2. shooting question
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th November 2009, 02:16 PM
  3. - quick question, jumping and shooting.
    By andrewe in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th September 2009, 06:44 AM
  4. Shooting question
    By Bill in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 15th December 2008, 09:15 PM
  5. 360 Degree Shooting Question
    By Jellyhead365 in forum The Games Factory 2 - Technical Support
    Replies: 7
    Last Post: 29th November 2006, 10:16 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
  •