User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: How do you wrap an object around the play area?

  1. #11
    No Products Registered

    Join Date
    Mar 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you wrap an object around the play area?

    Im pretty sure LB's method did not work for me, even tho I bet its a super way of wraping it. Its just that it kinda mess up my other events.. Try yourself, Ive uploaded my file here.. Maybe you know a way to solve my other issue aswell:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=202944#Post2029 44


  2. #12
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Ryan's Avatar
    Join Date
    Nov 2008
    Location
    Australia
    Posts
    1,279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you wrap an object around the play area?

    There were errors in both mine and LB's logic

    LB's problem was that he didn't allow for -X and -Y values. This messes up the MOD function.

    How do we correct this? We simply add the frame X and frame Y size to the player's X and Y position.

    So now, when a player leaves the left side of the screen, his true position is -20 pixels, but our MMF2 code thinks it's actually 780 pixels. We're adding 800 (the width of the frame) to the player's position for this specific calculation.

    780 MOD 800 = 780 (800 goes into 780 - 0 times, leaving 780 behind) therefore, this place the player at the right side of the screen, essentially wrapping the player around the screen.

    Also my offsets were incorrect, the true code is (drum roll....)

    Always Set X Position to: 0-AnimationWidth+(((X( "Hero Player 1" )+AnimationWidth)+FrameXSize+(2*AnimationWidth)) mod (FrameXSize+(2*AnimationWidth)))

    Always Set Y position to: 0-AnimationHeight+(((Y( "Hero Player 1" )+AnimationHeight)+FrameYSize+(2*AnimationHeight)) mod (FrameYSize+(2*AnimationHeight)))

    But lets not get too caught up on this, basically all were doing is making sure the animation of the player is far enough off screen before we wrap the player to the other side. Because without these offsets, the wrap will occur when the X position is less than 0, which is not neccessarily when your animation has left the screen.

    I've uploaded your example with the changes here.

    Here's a problem for you to solve though, why does the enemy stop chasing the player after a wrap?


  3. #13
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you wrap an object around the play area?

    Quote Originally Posted by Ryan
    Here's a problem for you to solve though, why does the enemy stop chasing the player after a wrap?
    He doesn't seem to stop chasing, he just goes where the player was before the wrap while your moving, but when you stop it works OK. Un-wrapping yourself by going back the way you came fixes it... 0_0
    Working as fast as I can on Fusion 3

  4. #14
    No Products Registered

    Join Date
    Mar 2009
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you wrap an object around the play area?

    Heh, at my MMF-level, this does not make much sense! However, the result works perfectly! Of course it made a new bug, but thats what updates do. Ill take some time and study what all these new expressions do, and maybe I find something useful! Thanks a lot for all help

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Wrap aroud play area clickteam fusion 2.5
    By Carbon_X in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 3rd January 2014, 08:41 AM
  2. Make object go faster in play area
    By Evilized79 in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 31st May 2011, 06:17 AM
  3. If Object is in the Play Area....
    By Bipolar_Games in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 18th September 2010, 11:59 PM
  4. Wrap around play area ignores conditions!
    By LB in forum File Archive
    Replies: 3
    Last Post: 14th March 2010, 03:39 PM
  5. wrap around Play Area Issue
    By Puff_N_Stuff in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th August 2009, 12:46 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
  •