User Tag List

Results 1 to 4 of 4

Thread: Platforms with Sine/Cosine Movement

  1. #1
    Clicker Fusion 2.5

    Join Date
    Jul 2022
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Platforms with Sine/Cosine Movement

    So I've seen a lot of AlmightyZenTaco's YouTube videos on CF2.5. They're great, especially for a noob like myself, but I'm interested in making a hybrid of two of his tutorials: Moving Platforms and Sine/Cosine Movement. What I'm trying to do for my game is have moving platforms that follow sine/cosine movement. I have succeeded in making them animate properly in left/right, up/down, diagonal, and circular motions; however, I can't get the collisions or movement right with the Platform Movement Object. In AZT's moving platform tutorial, he shows how to achieve proper PMO movement with a "platform indicator" object that's attached to the PMO. My only guess is I need something like this for these new platforms. If so, I just don't know how to do it. If anyone could help me out with this endeavor, I'd greatly appreciate it.

    For reference, here is the behavior of the circular "platform":
    Start of Frame, platform
    -> Set CenterX to X("platform")
    -> Set CenterY to Y("platform")
    Always, platform
    -> Set X position to CenterX("platform") + Cos(timer / Time("platform")) * Amp("platform")
    -> Set Y position to CenterY("platform") + Sin(timer / Time("platform")) * Amp("platform")

    And here is the behavior of a diagonal "platform":
    Start of Frame, platform
    -> Set CenterX to X("platform")
    -> Set CenterY to Y("platform")
    Always, platform
    -> Set X position to CenterX("platform") + Sin(timer / Time("platform")) * Amp("platform")
    -> Set Y position to CenterY("platform") + Sin(timer / Time("platform")) * Amp("platform")

    AZT tutorials:
    Moving Platforms - https://www.youtube.com/watch?v=qrwiebuo8Us
    Sin & Cos Movements - https://www.youtube.com/watch?v=9EgONu44Sn0

  2. #2
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform 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)
    DaveC's Avatar
    Join Date
    Jun 2007
    Location
    Perth, Australia
    Posts
    2,158
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    I would expect the PMO will stay on there in the example I posted here? Give it a whirl - https://community.clickteam.com/threads/94567-Kid-Icarus-Style-Game

  3. #3
    Clicker

    Fusion 2.5Fusion 2.5+ DLCAndroid Export Module

    Join Date
    Jan 2007
    Posts
    292
    Mentioned
    8 Post(s)
    Tagged
    1 Thread(s)
    If I am understanding properly I think I was able to accomplish something like this quite a while ago, but not using PMO.

    I can't post gifs so go here to see it in action. https://gamejolt.com/p/castle-fade-update-3-i2gkfjew

    Read the difference and X and Y between the current frame and previous frame and apply that to the player. This may introduce a 1 frame delay causing desync between the player and the platform - if it does then you will need have one invisible platform and one visible platform for each platform in your game. Have the invisible be the one that you directly apply the movement to and have the visible one be the one you can collide with. Apply the difference to both the player AND the visible platform and that should resolve the desync. There may be other workarounds

  4. #4
    Clicker Fusion 2.5

    Join Date
    Jul 2022
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey fellas, thank you for your replies.

    DaveC - That's a very good Kid Icarus clone. Since I'm still new to CF, I've been combing through all the conditions to gain an understanding of what they are and what they do. I also didn't know what qualifiers were before checking it out so that's some useful information I've acquired. I tried a few times to transfer the appropriate actions over to my test application but haven't succeeded yet. For someone of my skill level, this is a lot to absorb. I'll keep trying though.

    GamesterX23 - I think I see what you were talking about in that gif, the swinging action on the chandelier. That game looks great, by the way. I don't actually know how to read the differences nor apply them to the player, sadly. I believe the one frame delay is already present in my current moving platforms (the AZT ones) since the player sprite is 1-2 pixels lower then the platform when it goes up and 1-2 pixels higher when going down. I was ready to accept it as it was, but with what you told me and DaveC's KI mfa I may be able to fix it.

    I'm going to keep at it. I'm sure I can get it working properly eventually. Should only take a few "Aha!" moments. Thanks again!

Similar Threads

  1. Sine and Cosine questions. Need some formulas/
    By RetIva in forum Fusion 2.5
    Replies: 21
    Last Post: 31st March 2021, 01:08 AM
  2. Vertical platform sine movement?
    By Storsorgen in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 20th August 2016, 11:59 AM
  3. Replies: 13
    Last Post: 13th August 2016, 10:47 AM
  4. 360 degree movement with Sin/Cosine 'wobble'
    By RobertRule in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 27th August 2011, 11:48 AM
  5. Custome sine movement.
    By DJFuego in forum Widgets
    Replies: 3
    Last Post: 28th July 2009, 02:37 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
  •