User Tag List

Results 1 to 4 of 4

Thread: Understanding variables/flags?

  1. #1
    No Products Registered

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

    Understanding variables/flags?

    Ive read the "manual" and done alot of the tutorials section, but still have problems figuring out how to use them or if theres another way to do what im trying to do.
    Let me show a real example on the game im working on and maybe someone can tell me how to go about making it happen.
    Im at work now and dont have the MFA, but can post it later if need be.
    To set the stage, im making a Yars Revenge clone (just to see whats all involved in it). Ive got the movement down good, i have it so he can shoot fine and even have the enemies fort set up. He can shoot it, but he can also eat it. That part doesnt work so well lol, but thats not what im working on yet.
    Once he does eat some of it, a missle appears back on his side of the screen at his invisible base. Once this missle appears, he should stop shooting his little pellet and be able to shoot the missle. I am unable to get that to work. The big missle appears fine but I cant get him to shoot the missle without shooting the pellet too. Is this something I would need to have a variable or flag set for? Like if no missle, then the variable or flag is set off and he just shoots pellets, but once the missle appears a variable or flag is set to on which stops him shooting pellets and then makes him shoot the missle?
    If thats the case, how do I set that?
    At the same time, I have the enemy missle that appears upon start of the game and follows the player slowly, at first and then in later stages he gets faster and faster. What type of conditions would I need for the missle to chase the players ship?
    Sorry if this stuff is really basic, but I think once Im able to get this basic stuff down I will be able to build on top of it and make the games that I really want to make.
    If anyone could give me an idea on this or even better explain in a real game example how I would use the flags and variables, that would be great.
    Thanks for your time.

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Understanding variables/flags?

    You seem to be on the right track. For your player missile, you can set a flag in your player object that toggles between normal firing and missile firing. You would do this as such:

    +Player Flag 0 is OFF
    - (code that shoots bullets)

    +Player Flag 0 is ON
    - (code that shoots missiles)

    Just make sure to set the Flag 0 to ON when you eat the enemy shield/earn a missile. And set Flag 0 to OFF when you fire the missile, so the player can fire bullets again. Flags are basically just on/off switches you set with actions.

    As for the homing missile, MMF has a simple way to do this. Set the missile's movement type to Bouncing Ball and have a condition that Always sets the direction of the homing missile to face the player. As your difficulty increases, you just set the speed of the homing missile to a higher value.

    Hope that helps,

    mobichan

  3. #3
    No Products Registered

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

    Re: Understanding variables/flags?

    Mobichan, thanks alot for taking your time to answer my questions.
    I was able to get the missle tracking system working, so thanks for that tip. Still working on the missle part. I will keep at it.
    Heres a new problem im having. The bullets work great shooting one little piece off at a time, but the eating of the fortress is totally wrong. He just rips it to shreds in seconds. Its only supposed to be his little fangs at the front of the ship that can eat it, but the whole ship destroys the fort as well when it touches it (which its programmed to do I guess, but thats not what I want).
    I'd like for a small spot at the front of the ship to be the feeder. Not the whole ship. I also dont want it to be eaten so fast. Im thinking you should have to be pressed against for a few seconds before the piece is chewed off. Any way to make this happen?
    I was thnking it would have to be on some sort of timer in a condition where the feeder is pressed against the block, but Im not sure.
    Im stuck on how to make the feeder tho. Would it be an invisible active object that is programmed to always be positioned at the front fangs of my player ship?
    I think Im on the right track, but programming is hard, lol.
    Any help would be appreciated.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: Understanding variables/flags?

    Everything you said is correct. I would use an invisible object that you always position at the front of the player's ship as the object you detect against the enemy shield. You can make the eating work on a delay (as you said) by using an alterable variable as an "eat timer." You could try a setup where you set your "eat timer" variable to 50 when you aren't eating (when the collision object is NOT overlapping the shield). Then, if the collision object overlaps the shield, subtract 1 from your eat timer variable. When your timer variable reaches zero, then destroy the shield block.

    This should get you started, but it is up to you to work out the kinks. That is part of the fun of game making, IMHO.

Similar Threads

  1. Understanding Events
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 21st April 2013, 03:29 PM
  2. help understanding the sprite editor
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 25th April 2010, 01:26 AM
  3. Groups, flags, variables: I´m stuck, please help
    By Leander in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 8th August 2008, 03:58 PM
  4. Need help understanding how to read an array
    By TripletDad in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 1st April 2008, 06:54 PM
  5. Very new to this - need help with flags/variables
    By beannie in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 14th October 2007, 11:37 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
  •