User Tag List

Results 1 to 5 of 5

Thread: User defined speed

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2009
    Location
    Louisiana, USA
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    User defined speed

    I know this is probably a simple question but for the life of me my brain cannot figure it out.

    I'm just tinkering around with the initial tutorial game, Choco Block. By default the speed of the ball is 60. My idea is in the beginning (first fram) is to allow the user to choose 1 of 3 levels (Beginner, Novice, Pro). Based upon which menu item they click will determine the speed of the ball.

    Now the only idea I can come up with is create 3 separate frames. Each frame would be identical except I will have the speed of the ball set differently.

    My goal, though, is to figure out a more dynamic way to do this. Something along the lines of an if/then statement. I'm still trying to adjust to the object-oriented system of MMF2.

    For example, if the beginner text is clicked then it would write to an INI file the speed of the ball. Writing/creating/modifying/reading the INI file would not be an issue. It's just how can one get what's read form the INI file change a built-in setting such as the ball speed?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,364
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: User defined speed

    Heh, no you don't need 3 seperate frames
    And you don't need to use ini either.

    MMF2 is actually quite good with this.

    //Use a global value to store the difficulty setting.

    * User clicks on Beginner
    - Global values: Set Global value A to 1.

    * User clicks on Novice
    - Global values: Set Global value A to 2.

    * User clicks on Pro
    - Global values: Set Global value A to 3.

    //In the gameframe, load the difficulty value

    * Start of frame
    + Global values: Global value A = 1
    - Ball: Set speed to 10

    * Start of frame
    + Global values: Global value A = 2
    - Ball: Set speed to 20

    * Start of frame
    + Global values: Global value A = 3
    - Ball: Set speed to 30

    // Or a mroe dynamic way to set the speed
    * Start of frame
    + Global values: Global value A = 1
    - Ball: Set speed to Global Value A * 10


    You can change the name of the global values in the game properties. I would recommend set the name of Global Value A to Difficultylevel or something in that direction

  3. #3
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: User defined speed

    You'd be better setting a global value than using an ini file.

    Then at the start of your game frame(s) set the speed of the ball based on the global value. It would be easiest if you set the global value to speeds instead of 1, 2, or 3. You can rename the global values in the application settings to make things more readable.

    EDIT: Popcorn is faster.

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2009
    Location
    Louisiana, USA
    Posts
    369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: User defined speed

    Thanks Popcorn. The second one was better. If I understood the first one correctly, then I'd have to create three conditions for the buttons and then 3 more conditions for setting the speed in the second frame.

    With the second version I just set the global value of A to the speed I wanted. I did this three times (once for each button). Then, at start of the second frame I had it get the speed via "Retrieve data from an object" and selected A.

    I didn't do the A * 1. Or is the "A * 1" what the program sees? Since there's only a limit of 26 global values, then I can see where INI files could come in. Or is there certain information that is better stored in INI rather than global value and vice versa? I didn't see anything about "specifics" on INI such as that.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,364
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: User defined speed

    Since there's only a limit of 26 global values, then I can see where INI files could come in. Or is there certain information that is better stored in INI rather than global value and vice versa? I didn't see anything about "specifics" on INI such as that.
    Ini files are good when the information has to be stored even when the application is not running. It is good for storing user profiles, scores, statistics, options, applicationsettings etc.

    There is a tutorial on how to use the ini object in the Tutorials section.

    With the second version I just set the global value of A to the speed I wanted. I did this three times (once for each button). Then, at start of the second frame I had it get the speed via "Retrieve data from an object" and selected A.
    Thanks Popcorn. The second one was better. If I understood the first one correctly, then I'd have to create three conditions for the buttons and then 3 more conditions for setting the speed in the second frame.
    Yes you can set the speed directly into the global values if you want, but often you want to have the speed just set in the frame. It doesn't need to be global. The difficulty setting will be the same throughout the entire game, so that's why I would store that instead, and simply load that into the levels. It is just a matter of how you organize your game.

    I didn't do the A * 1. Or is the "A * 1" what the program sees?
    I had a mistake in my last example. You don't need the '+ Global values: Global value A = 1' line.

    'Good luck with your game

Similar Threads

  1. Math question for moving on a defined angle.
    By stannellc in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd January 2014, 11:29 PM
  2. Joystick not on the defined X, Y coordinates
    By ineke in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 6th March 2012, 02:18 PM
  3. Player defined controls
    By Warmachine in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 10th June 2011, 06:51 PM
  4. Bug: User Defined Animation Sequence / Behaviors
    By Tuna in forum Hardware Accelerated Runtime
    Replies: 2
    Last Post: 17th September 2008, 01:34 AM
  5. Triggering samples - user defined possible?
    By neupix in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd July 2008, 03:54 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
  •