User Tag List

Results 1 to 2 of 2

Thread: Click to switch directions

  1. #1
    Clicker Fusion 2.5 (Steam)HTML5 Export Module (Steam)

    Join Date
    Jan 2017
    Location
    Minnesota USA
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Click to switch directions

    Hi there, I've been trying to figure this out for awhile and finally decided to ask for help.

    Im working on a game where there is only one button.
    Once you press the button to start, the ship would pick left or right, fire a bullet and move that direction.
    If the player clicked again it would fire and switch directions.

    I thought this would be simple, but I cant seem to figure it out, tried some of the included movement types to no avail.

    Does anyone have a solution, event or code that is similar to this?

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    523
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Essentially you'll want to create a Flag on the player object called something like "Move Direction." Then, you'll assign a direction to each Flag state, like:

    0 = Right
    1 = Left

    When you click, Toggle the flag, create a bullet relative to the player, and set a flag on it based on the direction the player is facing (call it "Fire Direction", and if the player's "Move Direction" flag is off, keep it off; if the move direction flag is on, turn the Fire Direction flag on). Then create separate events for the bullet to move in the desired direction based on its Fire Direction flag states.

    For the bullet, I would just use the Set X-Position function, and set it to X("Bullet")+10 for when it goes right, and X("Bullet")-10 for when it goes left. Or whatever speed you like. This will constantly set it to 10 pixels from its previous position.

Similar Threads

  1. How do I switch sound?
    By C4PRO in forum Fusion 2.5
    Replies: 1
    Last Post: 15th December 2014, 01:18 AM
  2. Replies: 4
    Last Post: 30th November 2014, 05:07 PM
  3. after the first click, the system waits for a second before accepting the next click
    By kikiriki in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 9th August 2013, 01:45 PM
  4. 8 way hat switch movement
    By reptilezero in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st April 2012, 11:54 PM
  5. Can't switch from the Pan
    By PimeX in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th August 2010, 11:11 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
  •