User Tag List

Results 1 to 2 of 2

Thread: how do we make a 180 Degree aiming and shooting?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    UnicornMan's Avatar
    Join Date
    Aug 2013
    Location
    California
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    how do we make a 180 Degree aiming and shooting?

    Hi, I have been trying to make this for a while and found a few tutorials for 360 aim with mouse and tried to modify them to make it 180 aim on the right side of the character. I also tried to modify the 360 degree aiming and shooting to not be following a mouse but instead the up and down arrow keys. I know this is possible but I don't understand how to make it?
    Can someone please help me on this?
    Thanks in advance!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Let's assume your player has an alterable value called AimAngle, and your bullets have alterable values called AimAngle, XOrigin, YOrigin, and Radius.

    Pseudocode:
    Code:
    //Aiming
    //------
    "Up" key held
        --> Add 1 to AimAngle of "Player"
    "Down" key held
        --> Sub 1 to AimAngle of "Player"
    AimAngle of "Player" is greater than 90
        --> Set AimAngle of "Player" to 90
    AimAngle of "Player" is less than -90
        --> Set AimAngle of "player" to -90
    Always
        --> Set Angle of "Player" to AimAngle("Player")
    
    //Shooting
    //--------
    "Space" key pressed
        --> Create "Bullet" at (0,0) from "Player"
        --> Set AimAngle of "Bullet" to AimAngle of "Player"
        --> Set XOrigin of "Bullet" to X("Player")
        --> Set YOrigin of "Bullet" to Y("Player")
    Always
        --> Add 10 to Radius of "Bullet"
        --> Set X Position of "Bullet" to XOrigin("Bullet") + Radius("Bullet") * Cos( AimAngle("Bullet") )
        --> Set Y Position of "Bullet" to YOrigin("Bullet") + Radius("Bullet") * Sin( AimAngle("Bullet") )

Similar Threads

  1. Turret aiming and shooting problem
    By Fishmonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 21st January 2012, 10:33 AM
  2. 360 degree shooting
    By Hayo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 24th March 2010, 02:49 PM
  3. Problem with 360 degree aiming.
    By Watermelon786 in forum File Archive
    Replies: 2
    Last Post: 18th March 2010, 02:41 AM
  4. 360 degree shooting
    By Triclyde in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th March 2010, 07:13 AM
  5. 360 degree shooting
    By willy in forum Multimedia Fusion 2 - Technical Support
    Replies: 31
    Last Post: 23rd July 2006, 03:26 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
  •