User Tag List

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

Thread: Sword-swipe effect: how to do that on ios games?

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)

    Smile Sword-swipe effect: how to do that on ios games?

    Hi,
    I would like to replicate the effect of a sword-swipe effect activated by dragging the finger on the screen (basically, the one seen on fruit ninja, pocket ninjas and so on... see attached screenshot) on my ios game.
    I've browsed the forums and looked at the ios example section but I couldn't find any advice to create the effect.

    Is there any example out there? I would really appreciate some help, so that I could go on with my game

    Thank you!
    Fabrizio.
    Images attachées Images attachées

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,142
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    So, first you need four values, call them MouseX, MouseY, MouseXPrev and MouseYPrev (well, call them whatever you want but these are the examples I'm gonna use here). Perhaps use alterable values of an active object.

    What you need then is this event:

    User is holding down the left mouse button:
    - Set MouseXPrev to MouseX
    - Set MouseYPrev to MouseY
    - Set MouseX to X position of mouse pointer
    - Set MouseY to Y position of mouse pointer

    Be sure the actions are in that order.

    What this does is it stores the X and Y co-ordinates of the mouse and stores the X and Y co-ordinates where the mouse was in the previous frame.

    Then what you can do is join those two positions with an object. So create an object for one part of your sword swoosh and then you can scale and angle it to join those two points together.

    Then when the mouse button isn't held down, you can destroy the objects, or you can have the objects sort of slowly fade out or expire.

    To make it easier to scale them, you can make the object 100 pixels wide and then set the scale to the position between the two points divided by 100. Maybe make the object slightly bigger than 100 and give it faded edges to avoid segmentation. Make sure the hot spot is at one edge.

    This should all work in theory. For a bit more you could talk to DTownTony who used a similar effect in Pocket Ninjas, only I think with fastloops and more separate objects.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thank you DistantJ!
    It seems way more complicated than I thought :P

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    DTownTony's Avatar
    Join Date
    Sep 2010
    Location
    Detroit
    Posts
    429
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's my best effort to capture what DistantJ said with a few tweaks to make it look smooth if you swipe in a circle. I may use this method in a future update

    Slash_Effect.mfa

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    176
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Very nice one! Thanks for sharing!

  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleInstall Creator Pro

    Join Date
    Jul 2006
    Location
    Germany
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I love simple code with such a great effect

  7. #7
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)
    Wow Tony, thanks for sharing.

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export Module

    Join Date
    Dec 2008
    Location
    Italy
    Posts
    404
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Thank you Tony! I bet this will be incredibly useful to a lot for mmf2 developers, thanks for sharing!

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export Module
    DTownTony's Avatar
    Join Date
    Sep 2010
    Location
    Detroit
    Posts
    429
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank DistantJ To be honest I had never really fiddled around with this method for Pocket Ninjas but when DistantJ posted the way he'd do it, I just married his awesome concept with some of the visual scaling stuff I learned in the method I used. I'm definitely going to put this in the next update. Turned out way better than I thought it would.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Tuna's Avatar
    Join Date
    Feb 2008
    Location
    Central Texas
    Posts
    1,853
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    yeah, quite nice! Thanks DJ and DTT!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. argh help me with swipe gesture please!!
    By foyzul2002 in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 16th August 2013, 04:12 PM
  2. argh help! I can't swipe stuff!
    By foyzul2002 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 16th August 2013, 04:11 PM
  3. Multi-touch and swipe?
    By GameMaker2019 in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 22nd January 2013, 09:23 AM
  4. Having trouble implementing swipe movement...
    By Cybert9 in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 1st March 2012, 10:59 PM
  5. How To Get A 3D Effect In Games With MMF2
    By PaulW in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th April 2007, 10:07 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
  •