User Tag List

Results 1 to 9 of 9

Thread: Use touch instead of joystick for physics platformer

  1. #1
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Use touch instead of joystick for physics platformer

    Hi all,

    I am experimenting with the physics platform movement on iOS, and it's working fine with the on-screen joystick control.

    However, I'd like to use my own touch controls instead of the joystick. Can anyone point me in the right direction?

    The player will simply touch the right-hand side of the screen to make the player-object jump to the right, and touch the left-hand side of the screen to jump left. I know how to detect touches, but I don't know how to 'map' them to the platform movement to replace the joystick.

    Thanks in advance.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    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)
    Wodjanoi's Avatar
    Join Date
    Jun 2015
    Location
    Germany
    Posts
    652
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Do you need your own touch controls just for jumping? Could you perhaps upload a small example?

  3. #3
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thanks for replying.

    Sorry, I mistakenly mentioned the joystick in my original post; I meant to refer to the keyboard! When referring to the joystick, I intended to mention that I specifically do not want to use the on-screen joystick control.

    The game simply requires jump right and jump left; nothing else (currently). My prototype works great with the keyboard (left, right, shift-to-jump) when testing on Windows, but I would like to create my own controls based on where the user touches the screen.

    Is it possible to keep the Physics Platform Movement controls, but somehow replace the use of keypress with screen touches (effectively mouse clicks) - something along the lines of 'If the mouse is clicked in the specified zone, then jump-right'? I have tried making the player movement 'Physics - Static', but the collision detection, jumping, etc requires a lot of manual coding. If the built-in Physics Platform Movement can be used, it will save a lot of work.

    Thanks again.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Use the multitouch extension.

  5. #5
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi mobichan, thanks for replying.

    I won't have a chance to test this on a device for another 9 hours but look forward to trying it.

    I have had a look at the help file, and I'm not sure how the multitouch extension relates to the physics platform movement. i.e. Once I detect a touch, how does it execute, say, a jump-right action? Or, is your suggestion that I should use the multitouch extension to detect the screen-touches, and implement my own physics for jumping?

    Thanks.

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    As with everything in fusion, you make if / then statements. In the case of multitouch it would be something like:

    + if touch was released
    + touch x < screen center
    -- do action that starts physics object

  7. #7
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mobichan, I understand.

    I am fine with various input methods; what I am trying to avoid is manually managing the physics for the player movement. The physics for the physics platform movement are perfect for my requirements; it's just the input method that isn't what I want!

    The physics platform movement does everything that I need in terms of collisions with backdrops and objects, etc, and the mechanics of the jumps are perfect; I'd just like to add my own input methods to trigger the jumps.

    In summary, I'd like to the player to use the physics platform movement, and when I touch the relevant part of the screen (which is the easy bit to manage) I'd like to do the 'physics platform movement' jump, rather than having to use the joystick.

    I hope my explanation makes sense!

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,283
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    I never really touched the Physics Platform movement, but I assume you will need to add an Impulse or some other physics related action on screen touch. I assume there is a way to give inputs through other sources like keyboard or touch (maybe the Clickteam Movement Controller extension?) because no other movements require the in-built player controls.

  9. #9
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi mobichan; I am very grateful for your contribution.

    I thought it would be as easy as applying an impulse when the screen was touched, but enabling the Physics Platform Movement for an actor disables the physics options in the Movement menu in the event editor. I also assumed that I would be able to provide inputs through other sources, but this is what I can't find - perhaps I'm just looking in the wrong place, but i just can't see anything that looks relevant. I had a quick look at the Clickteam Movement controller extension, and it doesn't seem to apply to the physics movements.

Similar Threads

  1. Platformer Touch Control Problems
    By Dowpag in forum Android Export Module 2.5
    Replies: 2
    Last Post: 8th September 2015, 01:21 PM
  2. Physics question! Making AI that uses Physics Platformer/Physics Static movement
    By Krim in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th December 2013, 04:19 AM
  3. Touch based platformer (no on-screen buttons) Has this been done before?
    By Pineapple in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 22nd February 2012, 09:56 AM
  4. How to use the touch joystick?
    By Ls2 in forum Android Export Module Version 2.0
    Replies: 8
    Last Post: 13th February 2012, 04:39 PM
  5. [BUG] Touch Joystick
    By Ls2 in forum Android Export Module Version 2.0
    Replies: 0
    Last Post: 10th November 2011, 07:19 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
  •