User Tag List

Results 1 to 8 of 8

Thread: 2 pretty basic quesions

  1. #1
    No Products Registered

    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    2 pretty basic quesions

    since this is my first post I want to say hi

    Anyway, back to the topic...

    My first question I guess is pretty basic, you know in the Super Mario games? With the invisible blocks that when you touch them, they become visible and a sound plays, only ONCE. I know how to make it appear and how to make the sound play once... But not how to make the sound play just when it appears (The FIRST time the player collides with it). This can't be too hard I guess?

    Second question, might be a little bit harder?

    If you have played "Bonesaw", you have seen the blocks that's fully visible once you are a bit away from it, but as you get closer it gets less and less visible, and when you are standing on it, it is fully invisible.

    Hopefully I posed this in the right section and that anyone of you can answer it :grin:

    Cheers

  2. #2
    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: 2 pretty basic quesions

    Since this is your first post I want to say hi back.

    Anyway, back to the topic...

    1) When the player hits the block set a flag on. Then in the condition for hitting the block, test if the flag is off. Code:

    Code:
    [Player hits block] -
    Internal Flag 0 is Off:
    --[Sound and Hit]
    --Set Internal Flag 0 On
    2) This is much more complicated. Add the "Advanced Direction Object" to your frame, and make the block have ink effect "Semi-Transparent." Add code:

    Code:
    Always:
    --Block: Set Semi-Transparency to Min(0,128-Distance("Advanced Direction Object",X("Player"),Y("Player"),X("Block"),Y("Block")))
    That will probably work.

  3. #3
    No Products Registered

    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 2 pretty basic quesions

    Sorry, I am kind of new, how to I check if a flag is on??

  4. #4
    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: 2 pretty basic quesions

    Object's Conditions -> Alterable Values -> Flags -> Is Flag On/Off

    I am pretty sure that is right, I don't have MMF in front of me.

  5. #5
    No Products Registered

    Join Date
    Oct 2008
    Location
    Germany
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 2 pretty basic quesions

    Hi ThePearl and welcome to the forum.

    1st question:
    This is actually pretty easy. Create an event like this:
    Code:
    * Collision between PLAYER and INVISIBLE_BLOCK
    * INVIBLE_BLOCK is invisible
        play sample...
        make INVISIBLE_BLOCK visible
    2nd question:
    Actives have an action called "Set semi-transparency" in the "visibility" sub-menu. Basically you need to calculate the distance between the player and the block via phytagoras (a² + b² = c²). This could look like this:

    Code:
      * Always (or something better)
          set (Block) distanceToPlayer to
             sqr((X(player) - X(Block)) pow 2 + (Y(player) - Y(Block)) pow 2)
          (Block) Set semi-transparency to
             abs(distanceToPlayer / (400 / 128) - 180)
    This calculation basically calculates the distance between the player and the block (a² + b² = c²) and stores it in the alterable value distanceToPlayer. After that, we set the transparency to a value between 0 and 128, where 0 is opaque and 128 is totally invisible. We divide distanceToPlayer by 400 / 128 = 3.125. This means that the block becomes more and more invisible when the player is not more than 400 pixels away. However, when the player is 400px away we would get a transparency of 128, which means total invisibility, so we have to invert the result of our calculation. thats why we put abs() (the result is always positiv) in there and subtracted 128 so instead of a value of 96 when the player is 300 pixels away, we get 32, which is what you want.

    I hope that was not too difficult to understand. If you need further help, just ask.
    Good night,
    lincore

  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: 2 pretty basic quesions

    Good point on #1, you don't have to use flags.

  7. #7
    No Products Registered

    Join Date
    Oct 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 2 pretty basic quesions

    So, I tried both of the examples you guys gave me of the first question, none worked. See I want it to only play once forever, just one and never ever again.

    I am using MMF2 Developer, does that make any difference? If so, sorry for wasting time (Example 2 now)

    OH MY GOD!! HAHA! I was playing.. And changed
    Min(0, 128-Distance( "Advanced Direction Object", X( "Player" ), Y( "Player" ), X( "Block" ), Y( "Block" )))

    to

    Max(0, 128-Distance( "Advanced Direction Object", X( "Player" ), Y( "Player" ), X( "Block" ), Y( "Block" )))

    And it worked! That is funny...

    But, what if I on example one, change a value to 1 when the sound played once or something?

    Final edit!:

    It's all working! When the Player collides with the invisible wall, it goes visible, and I add 1 to a global value, and when that global value equals 1, the sound plays AND it adds 1 more to it, so it will only play once!

    THANKS FOR THE HELP! I really wouldn't been able to do this without you guys! Great forum!

  8. #8
    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: 2 pretty basic quesions

    Silly me, of course it's "Max". :blush:

Similar Threads

  1. A pretty bad problem.
    By Nusua in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd May 2009, 01:54 PM
  2. Hi, a few quesions about document printing
    By FARAWAY_HELP in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 22nd May 2009, 12:23 PM
  3. Pretty annoying problem.
    By Nusua in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th March 2009, 09:30 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
  •