User Tag List

Results 1 to 10 of 10

Thread: Center camera between two players?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Center camera between two players?

    I've been trying to search for a solution, but i dunno what exacly to search for in order to find an answer.

    Anyways, I want the camera to be centered in-between two players on the screen without any jerky movement/scrolling, as soon as a second player jumps into the game.

    1 Player = Camera centered on Player1
    2 Players = Camera centered in the middle of Player 1 and 2

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AndyBazooka View Post
    I've been trying to search for a solution, but i dunno what exacly to search for in order to find an answer.

    Anyways, I want the camera to be centered in-between two players on the screen without any jerky movement/scrolling, as soon as a second player jumps into the game.

    1 Player = Camera centered on Player1
    2 Players = Camera centered in the middle of Player 1 and 2
    I think you need to retrieve the average of the two player's positions, and then center the camera on that. Basically, center the X and Y separately, and set them like this:

    X scrolling=(X("Player1")+X("Player2"))/2
    Y scrolling=(Y("Player1")+Y("Player2"))/2

    I have no idea how well this will work, but it should help you get started.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    works flawlessly! thanks again

    gotta love this forum

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    xhedgehogx's Avatar
    Join Date
    Nov 2007
    Location
    NY, USA
    Posts
    726
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm just curious, what do you do if a player walks off screen?

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhedgehogx View Post
    I'm just curious, what do you do if a player walks off screen?
    Simple: Make an invisible border that is just outside of the frame, position it so that it always stays in the same position (or turn off follow the frame, either way works for me), and then check for collisions with it. If need be, you can use 4 different objects (one for each side) instead of 1 object.

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    xhedgehogx's Avatar
    Join Date
    Nov 2007
    Location
    NY, USA
    Posts
    726
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, yeah, that works, wasn't even thinking of that. :P
    It'd be interesting to somehow work in zooming in and out as the players move around. Isn't that going to be a built-in feature of Fusion 2.5?

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module

    Join Date
    Mar 2013
    Posts
    258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xhedgehogx View Post
    Isn't that going to be a built-in feature of Fusion 2.5?
    of what i've heard. yes, it will be built in

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    Fanotherpg's Avatar
    Join Date
    Jul 2006
    Location
    High Wycombe, Buckinghamshire, UK
    Posts
    3,665
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can also block distance between 2 objects that player control in one of directions is ignored if it's too far from other object.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Feb 2007
    Location
    UK
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by happygreenfrog View Post
    I think you need to retrieve the average of the two player's positions, and then center the camera on that. Basically, center the X and Y separately, and set them like this:

    X scrolling=(X("Player1")+X("Player2"))/2
    Y scrolling=(Y("Player1")+Y("Player2"))/2

    I have no idea how well this will work, but it should help you get started.
    Hi, I was wondering how you fix the bug when a player dies. The camera seems to still try and scroll player 1 and player 2 even if the player 2 object is destroyed?

    Many thanks.
    Dave.

  10. #10
    Clicker Fusion 2.5 (Steam)

    Join Date
    May 2018
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by happygreenfrog View Post
    Simple: Make an invisible border that is just outside of the frame, position it so that it always stays in the same position (or turn off follow the frame, either way works for me), and then check for collisions with it. If need be, you can use 4 different objects (one for each side) instead of 1 object.
    I have a question too. How do I make it so the characters are in the middle instead of being in the corner?

Similar Threads

  1. CPU Players
    By WareWolff in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th October 2010, 11:29 PM
  2. IP Camera and Web Camera Extension for MMF2
    By droberson in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd June 2010, 05:37 PM
  3. Players
    By Noctrama in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th December 2008, 06:36 PM
  4. More than 4 players
    By Pleng in forum The Games Factory 2 - Technical Support
    Replies: 11
    Last Post: 27th January 2008, 10:44 PM
  5. 2 players
    By Nate in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 19th January 2008, 07:54 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
  •