User Tag List

Results 1 to 3 of 3

Thread: 360 direction crosshair with joystick

  1. #1
    Clicker Fusion 2.5Android 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)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2013
    Posts
    85
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    360 direction crosshair with joystick

    Hi,

    I'm making a physics platformer of sorts and I need a crosshair at a set distance from the player that you control with the left stick of a joystick/gamepad that points in the direction you aim. I'm not sure which extension to use to achieve this because there are a number of different ones and I'm not sure which is the best, and I'm having trouble finding examples of how to achieve this.

    I'd also like the crosshair radius to "shrink" in when you hold the A button if that makes sense. Any pointers?

  2. #2
    Clicker

    Fusion 2.5Android Export Module

    Join Date
    Jan 2007
    Posts
    258
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Kritter View Post
    Hi,

    I'm making a physics platformer of sorts and I need a crosshair at a set distance from the player that you control with the left stick of a joystick/gamepad that points in the direction you aim. I'm not sure which extension to use to achieve this because there are a number of different ones and I'm not sure which is the best, and I'm having trouble finding examples of how to achieve this.

    I'd also like the crosshair radius to "shrink" in when you hold the A button if that makes sense. Any pointers?
    No extensions needed.

    3 Alterable Values needed inside your crosshair
    XPos
    YPos
    Distance

    Keep in mind that XPOS is an alterable value and X Position is the X Position of the object in fusion

    Start of Frame
    Set Alterable Value XPos of Crosshair to X of Crosshair
    Set Alterable Value YPos of Crosshair to Y of Crosshair

    Always
    Set X position of Crosshair to XPos
    Set Y Position of Crosshair to YPos

    Always
    Set XPos to X of Player + cos(Aiming angle) * Distance
    Set YPos to Y of Player - sin(Aiming angle) * Distance

    *******Distance needs to be an alterable value or a counter that you set to the number of pixels in distance you want the crosshair to maintain away from the player.

    Player Holds A
    + Distance > 0
    Subtract one from distance

    Player is NOT holding A
    + Distance < Max Distance
    Add one to distance

    I think that should take care of you. Have to cut this short as my lunch at work just ended. Sorry I can't post an example at this time.

    Oh yeah don't forget to make it so that you can adjust the angle up or down (EG: Player holds left add 1 to angle, player holds right subtract one from angle)

  3. #3
    Clicker Fusion 2.5Android 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)Universal Windows Platform Export Module (Steam)

    Join Date
    Dec 2013
    Posts
    85
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sorry I meant which Joystick extension should I use mainly because I want to be able to play it with a joystick as well, rather than just keyboard or mouse. I basically want to achieve how dual stick shooters feel, only with just one stick because you only control the crosshair and not the player.

Similar Threads

  1. Crosshair from Gun
    By Corlen in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 19th June 2012, 03:10 AM
  2. Rotate crosshair around player
    By Yikes in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th December 2011, 06:45 PM
  3. move away from crosshair
    By nick_Peoples in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 27th July 2011, 01:04 AM
  4. Crosshair and player
    By hawk1281 in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 21st August 2009, 05:02 PM
  5. Crosshair positioning
    By PengeyPenguin in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 8th August 2009, 08:03 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
  •