User Tag List

Results 1 to 5 of 5

Thread: Questions about Sarah Greenlands Jigsaw Puzzle - Conditions and numbers

  1. #1
    Clicker Fusion 2.5

    Join Date
    May 2018
    Location
    Sweden
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Questions about Sarah Greenlands Jigsaw Puzzle - Conditions and numbers

    Hi!

    I'm following the great Jigsaw Puzzle game that Sarah Greenland made and I have a few questions. I made mine with a bigger size and different pieces, so I've changed some of the numbers. There are good explanations for what "we're" doing in the events, but there are a few things I'm wondering about. I'm an artist and definitely no programmer.

    First of all I'd like to know if there is ONE manual to at least find info and explanations for the expressions/conditions in CF? I know that there are thousands of tutorials, but I can't go through every single one of them to find the answer to one question.

    1. "Random(4) * 8" This is to set the jigsaw pieces in 4 random directions. Ok, I understand "Random(4)" but " * 8 " why times 8, why 8? What does the number 8 stand for? Plus my pieces don't rotate, something I have to figure out why....

    2. "( Dir( "Group.Good" ) + 8 ) mod 32" This is where I rotate the pieces by right-clicking. Here's that magic number 8 again and what does "mod 32" mean? 32 is that from the max number of directions, I suppose?

    3. "Random(500) + 70" "Random(70) + 350" This is Set X and Y position of the pieces. I suppose the numbers here is to cover the area of the screen? Where the pieces will be randomly placed at the start. Why are the numbers written like that? And what does 70 stand for here?

    4. In each event, there are one or more conditions, does the of order the conditions matter? This is naturally for events and conditions generally, not just for this game.

    Maybe someone can either point me to a place to find the answers or maybe give a short easy explanation :-) I'm an artist remember :-D

    Thanks for any help!

  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)
    1. The Cf2.5 animation directions use internally assigned values. If you mouse over the dots that represent the directions in the picture/animation editor, you will see the numbers. The default of 4 directions have values of 0 (right), 8 (up), 16 (left) and 24 (down). If you increase the number of directions, you will see more intermittent values applied to the extra directions. So if you have 4 directions in use, you would multiply by 8 since each direction is a multiple of 8.

    2. The 8 is explained in my first answer. The mod operator gives you the "remainder" after dividing two numbers. In this case, it means the result of the equation will never exceed 32.

    3. Not sure the specifics here, since I don't know the example you are referring to. But the random (70) means the y position will always choose a random number between 0 and 70 FIRST and then add 350 to it. You could make this equation many ways, actually. For example, you can use RRandom(350, 420) (which is a random range between two values) instead and get the same thing. Seems like a personal preference.

    4. Yes, most definitely. But it is so case specific, you kind of have to learn the corner cases as you develop things with CF2.5. Just remember that things are executed from top to bottom.

  3. #3
    Clicker Fusion 2.5

    Join Date
    May 2018
    Location
    Sweden
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mobichan View Post
    1. The Cf2.5 animation directions use internally assigned values. If you mouse over the dots that represent the directions in the picture/animation editor, you will see the numbers. The default of 4 directions have values of 0 (right), 8 (up), 16 (left) and 24 (down). If you increase the number of directions, you will see more intermittent values applied to the extra directions. So if you have 4 directions in use, you would multiply by 8 since each direction is a multiple of 8.

    2. The 8 is explained in my first answer. The mod operator gives you the "remainder" after dividing two numbers. In this case, it means the result of the equation will never exceed 32.

    3. Not sure the specifics here, since I don't know the example you are referring to. But the random (70) means the y position will always choose a random number between 0 and 70 FIRST and then add 350 to it. You could make this equation many ways, actually. For example, you can use RRandom(350, 420) (which is a random range between two values) instead and get the same thing. Seems like a personal preference.

    4. Yes, most definitely. But it is so case specific, you kind of have to learn the corner cases as you develop things with CF2.5. Just remember that things are executed from top to bottom.
    Thanks for your quick reply mobichan!

    1. OK, so if I had let's say 8 directions I would multiply it by 4?

    2. Aha, it means that the piece will rotate by 8 increments at each click?

    3. So X pos is random between 0 and 500 first and then add 70? This is for the placement of the various puzzle pieces. Now that I have thought about this for a few minutes, I get it! I get it!! I'm a genius!! Thank you! :-D

    4. I'll have to try and think logically here :-D

    Thanks again!

  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)
    No problem. I came from an art background as well, but I am finally a lot more comfortable after 10 years of making games.

    1. Correct.

    2. Yes, but it also means that when the value goes above 32, it will start back at 0. For example, if you made an equation that increases a rotation variable by 8 using the following event:

    +On mouse click
    - Set var rotationAngle to (rotationAngle+8) mod 32. <--This means that when the (rotationAngle+8) part of the equation finally equals 32, the mod part of the equation will get the remainder of (32 / 32). This will result in 0, which essentially resets the var rotationAngle. This also means any value above 32 will work within a value range of 0 to 32. Hope that isn't more confusing. :P

    3. Glad you got it.

    4. The forums are here to help in case you run into specific issues. Welcome to the community.

  5. #5
    Clicker Fusion 2.5

    Join Date
    May 2018
    Location
    Sweden
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks again mobichan! I can see people get a lot of help from here. And I think I get your other example of rotation too, reading... thinking.... yes I get it!! :-D

Similar Threads

  1. How to make a jigsaw puzzle?
    By cherryblossom in forum Fusion 2.5
    Replies: 1
    Last Post: 12th October 2015, 03:27 PM
  2. Jigsaw puzzle example?
    By Cardium in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th March 2014, 08:56 AM
  3. Replies: 1
    Last Post: 28th February 2014, 05:35 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
  •