User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14

Thread: cavestory camera

  1. #1
    No Products Registered

    Join Date
    Jan 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    cavestory camera

    hi!
    okay well I have used mmf2 for a bit now, and am really sick of the generic screen following for platformers. I came here to ask if anyone has any ideas on creating a cavestory like camera.
    I have seen a couple examples of things like one but the main problem is that the cavestory camera speeds up and slows down which stops it from looking jerky, while other examples just move the camera around at a set speed
    thanks for all your help!!!

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    Cave Story has quite an interesting camera - I actually tried to copy it a bit myself in my latest game, without a whole lot of success...

    However, the basic principle is to have a separate "camera" object that stays invisible, and scrolling on this object rather than your player. You can then get the camera to move faster or slower depending on how far away from the player it is, giving you a much more natural-looking scroll than having your player fixed in the middle of the screen.

  3. #3
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    I think I know what you're talking about. What you can do is you can set the camera's position to the average position of the camera and the object. So the formula would look something like this :
    CameraX = ( CameraX + PlayerX )/2

    So that way it always centers on whatever is halfway between the camera and the player, and since that amount gets less every loop, it will be slow when it is close, and fast when it is far.

    But that formula might be a bit too fast. What you can do is weight it for the camera, so you could do something like this:
    CameraX = (CameraX * 4 + Player/5

    That makes it so the camera will always go to the point that is 1/5th of the way to the player.

    This makes for very smooth scrolling. The beauty of this method is that it only takes one line of code, and you don't need any extra objects for it!

  4. #4
    No Products Registered

    Join Date
    Jan 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    thanks lazy coder there's one problem though, I can't get the code to work:S
    I put in "X=(( "Camera" ) + X( "Player" ))/5" but I get cannot understand the expression, :S

    another thing is that if left or right in cavestory is pressed the camera moves slightly to the right or left, but very slowly increasing in speed

  5. #5
    No Products Registered

    Join Date
    Feb 2007
    Location
    Sydney, Australia
    Posts
    1,654
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    Cavestory? I have never heard of this. Is there a video or a game of this so I can see how the camera effect is?

  6. #6
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    head over to www.youtube.com , there are a few of this game

  7. #7
    No Products Registered

    Join Date
    Jan 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    Quote Originally Posted by Dynamite422
    Cavestory? I have never heard of this. Is there a video or a game of this so I can see how the camera effect is?
    best game I've ever played. (and I've played alot) it's also free and 1mb, google it to download it

  8. #8
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    I tried it, quite fun, it looks like there is a invisible object in front of the player, like 100 pixels in front and the camera will slowly move towards that point. That also explains why the camera moves quickly from left to right when you turn.

  9. #9
    No Products Registered

    Join Date
    Jan 2008
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    yeah, I've managed to do something like that with the invisible object, but I can't seem to get it to increase or decrease speeds so it's not jerky

  10. #10
    No Products Registered

    Join Date
    Sep 2006
    Location
    Germany
    Posts
    861
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: cavestory camera

    Always
    -->Center XY on Invisible_Object
    -->X of Invisible_Object = Round(X( "Invisible_Object" )-X( "Player_Object" ))/1.04+X( "Player_Object" )
    -->Y of Invisible_Object = Round(Y( "Invisible_Object" )-Y( "Player_Object" ))/1.04+Y( "Player_Object" )

    That should do the trick

Page 1 of 2 1 2 LastLast

Similar Threads

  1. 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
  2. cavestory style frame transition
    By jamesponds in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 20th February 2008, 06:35 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
  •