User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Reverse vertical direction

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Jul 2010
    Location
    Italy
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reverse vertical direction

    Hi all!

    How can I reverse only horizontal or only vertical direction of an active object?

    At the moment I'm using the Bounce movement, but I'd prefer to use a custom way, because I'm making a breakout game, and I want the player to be able to choose with precision the direction to give to the ball, hitting it more to left or to the right.

    Thank you in advance for your help!

  2. #2
    Clicker Fusion 2.5
    Warmachine's Avatar
    Join Date
    Nov 2009
    Location
    Charleston, WV
    Posts
    664
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    this may or may not be of help to you since it is a bit off topic, but i had an issue with the parallaxer object going in the wrong direction on the y axis. when assigning your coordinates for the object(x,y) assign the y with a negative number. Example would be -20,-30. if that works just adjust the number until you find one that is to your liking. hope that helped! :grin:

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Mar 2010
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    Here's what I came up with. You can easily tweak things to suit your taste and this way you can still use the bounce movement's features.

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Jul 2010
    Location
    Italy
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    Thank you for your replies!
    @clean_citrus: Thank you for your source file, it's a smart way to give the player more control over the ball. But I need something a little different: I want the ball, when it collides with the bat, to adjust its direction in base of where it collided on the bat. I mean, if the bat's sprite's width is 64, and the ball collides exactly in the center (32), it must go in the direction up (8). If it collides a bit on the right, for example 50, it must go on the right in a direction like 5, I don't know exactly.
    In particular, I want the ball's direction to be a value between 3 and 13. My bat's sprite's width is 64, the ball's width is 16, and both have the action point in the center.
    I thought of something like this:
    direction = 3 + x

    x : 11 = collision point : bat width
    x = 11 * collision point / bat width

    collision point = ball.x - bat.x + 32 (+32 because of the action point in the center)

    So in the collision between ball and bat event, I added the action "Set direction to 3+11*(X( "Ball" )-X( "Bat" )+32)/64", but it doesn't work, because the ball always go on the right.

    Could you help me again, please? Thank you very much for your help!

  5. #5
    No Products Registered

    Join Date
    Nov 2009
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    First, make sure the hot spots are in the middle of the objects. If the bat's hot spot is on the far left, change X( "Bat" ) to X( "Bat" )+32.

    Set direction to: (((X( "Ball" )-X( "Bat" ))*5)/32)+8

    If that doesn't work, it's probably because MMF can't deal with floats in the middle of the expression evaluator. In that case, go (((X( "Ball" )-X( "Bat" ))+51)*5)/32

    If that still doesn't work you may need to force it to a whole number: ((((X( "Ball" )-X( "Bat" ))*5)-(((X( "Ball" )-X( "Bat" ))*5) mod 32))/32)+8

  6. #6
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    Set direction to: (((X( "Ball" )-X( "Bat" ))*5)/32)+8

    should be

    Set direction to: (((X( "Ball" )-X( "Bat" ))*5.0)/32.0)+8

    if you want floats.

  7. #7
    No Products Registered

    Join Date
    Nov 2009
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    You can just add a .0 if you want floats? I never knew that!

  8. #8
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    Well now you know

    There's also some other stuff, such as division will come before multiplication

  9. #9
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Jul 2010
    Location
    Italy
    Posts
    368
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Reverse vertical direction

    Thank you very much!
    Now it works.

  10. #10
    mojofltr
    Guest

    Re: Reverse vertical direction

    I have a silly, and probably less accurate way, to do this. Set your hotspot in the middle of your bat and have an event for the bat to ALWAYS look in the direction of the ball. Then on collision, change the direction of the ball to the direction of the bat. xD Silly, but it works in its own little way.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. strage bug: doing reverse?
    By Chokito in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 10th August 2011, 09:02 AM
  2. Reverse Division
    By izac in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th April 2009, 01:29 PM
  3. Reverse Text
    By Atom in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th March 2009, 06:56 PM
  4. reverse starfield?
    By ayejes in forum File Archive
    Replies: 4
    Last Post: 29th February 2008, 01:41 PM
  5. Reverse keys
    By the_raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th October 2006, 02:31 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
  •