User Tag List

Results 1 to 7 of 7

Thread: Knytt Style Scrolling?

  1. #1
    No Products Registered

    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Knytt Style Scrolling?

    Hey people , Ive been trying to figure out how to achieve Knytt style 'Go to the edge of the screen to move to the next bit' kind of scrolling, but to no prevail.

    Could someone tell me how to do this type of scrolling?

    Thanks , Loving MMF2 btw.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Knytt Style Scrolling?

    Hey. Actually, you could check yourself - Knytt is open-source.
    The idea is pretty simple, though.
    You set the camera's center to an active "Camera".
    The X of "Camera" is [color:#3333FF]PlayerX/Width*Width+Width/2[/color],
    and logically, Camera Y is [color:#3333FF]PlayerY/Height*Height+Height/2[/color]

    So if your window size was 640x480,
    the Camera X is PlayerX/640*640+320,
    the Camera Y is PlayerY/480*480+240

    That's about it. This is the easiest way I can think of.

    If you wonder why this works, since /640*640 seems like not changing anything: if you don't specify decimals, the result won't have decimals either.
    For example,
    13/10*10 = 10
    but 13.0/10*10 = 13

    So basically, the formula sets the camera to the player, then gets the top-left corner of the "screen", and then centers the camera by adding half the size of a screen.

    Good luck, and welcome to the forums!

  3. #3
    No Products Registered

    Join Date
    May 2009
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knytt Style Scrolling?

    Ahh thats excellent! Thank you very much Looki!

  4. #4
    RayMarble
    Guest

    Re: Knytt Style Scrolling?

    Can you elaborate a bit more the

    "If you wonder why this works, since /640*640 seems like not changing anything: if you don't specify decimals, the result won't have decimals either.
    For example,
    13/10*10 = 10
    but 13.0/10*10 = 13"

    part? I don't see how can 13/10*10 be 10. :blush:

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Knytt Style Scrolling?

    "if you don't specify decimals, the result won't have decimals either."

    :P

    MMF doesn't work with decimal numbers unless you specify them.
    Working with 15 is not the same as 15.0.

    If you work with integral numbers, all decimals will be cut off.. see 13/10*10 = 10 -- MMF will calculate it like this:

    => 13/10 = 1 (10 completely fits 1 time in 13)
    => 1*10 = 10

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleMac Export ModuleSWF Export ModuleXNA Export ModuleFirefly 3D Module
    MEHRDAD's Avatar
    Join Date
    Jan 2009
    Location
    Iran
    Posts
    489
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Knytt Style Scrolling?

    Quote Originally Posted by Looki
    Hey. Actually, you could check yourself - Knytt is open-source.
    sorry to bother you. after complete download .when i want extract .zip file.it can not open .mfa file and show this message:! D:\Documents and Settings\MEHRDAD\Desktop\Knytt1.zip: CRC failed in Knytt27.mfa. The file is corrupt
    why?have anyone this problem?is mirror correct link?
    i use winrar 3.71 for exract.please help me



  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    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
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Knytt Style Scrolling?

    Quote Originally Posted by MEHRDAD
    Quote Originally Posted by Looki
    Hey. Actually, you could check yourself - Knytt is open-source.
    sorry to bother you. after complete download .when i want extract .zip file.it can not open .mfa file and show this message:! D:\Documents and Settings\MEHRDAD\Desktop\Knytt1.zip: CRC failed in Knytt27.mfa. The file is corrupt
    why?have anyone this problem?is mirror correct link?
    i use winrar 3.71 for exract.please help me

    Well I just downloaded it and extracted it using WinRar 3.8 and it loaded for me. Can you update your WinRar and try it again? And maybe redownload the zip file, maybe something happened in the download process.

Similar Threads

  1. Scrolling Knytt stories - Super Mario Example
    By JimJam in forum File Archive
    Replies: 9
    Last Post: 4th May 2009, 01:20 AM
  2. Castlevania Style scrolling movement?
    By Atherton in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 7th April 2009, 02:54 AM
  3. scrolling: mario style
    By mexx_admin in forum The Games Factory 2 - Technical Support
    Replies: 9
    Last Post: 24th November 2006, 04: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
  •