User Tag List

Results 1 to 2 of 2

Thread: Loops, Layers and Layer Coefficients

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export Module
    FinalSpecimen's Avatar
    Join Date
    Oct 2011
    Location
    Boston, MA
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loops, Layers and Layer Coefficients

    Many questions regarding layers...

    My first question is about creating a custom background scrolling system. Is it more efficient memory-wise to do this than using layer coefficients? If I, for example, put all the background art on one layer - i.e. a foreground, midground, and background active object - and set them all to scroll manually with different values, would that make any difference in speeding up performance versus using multiple layers?

    Two: If this does make a difference, I'm having some difficulty implementing custom scrolling. I used the example from this thread to set it up, but the background appears to "jump" when the player reaches the edge of the frame and the scrolling stops, which I know doesn't happen when using layer coefficients. This is the link to my MFA for clarification: https://www.dropbox.com/s/w5rsfxp64p...LLING.mfa?dl=1

    Question number three: providing it doesn't make a difference, how exactly does the layer coefficient work? Does it operate with the same precision as a fastloop, i.e. if I wanted to test the precise to the pixel position of an object, would I be able to retrieve that value? The reason I ask is because I'm trying to loop my background objects for scrolling instead of starting the frame with a million duplicate objects side by side. I also want to destroy each object when it leaves the frame. I have events as such:

    1. XPos(Object) = XLeftFrame - ObjectWidth
    +Player is Moving Right
    - Destroy Object

    2. XPos(Object) = XRightFrame - ObjectWidth
    +Player is Moving Right
    - Create Object at (ObjectWidth, 0) from Object

    3. XPos(Object) = XRightFrame + ObjectWidth
    +Player is Moving Left
    - Destroy Object

    4. XPos(Object) = XLeftFrame + ObjectWidth
    +Player is Moving Left
    - Create Object at (-ObjectWidth, 0) from Object

    The result I'm getting doesn't create any new objects on the left side of the screen, and when I move to the right a few paces my object counter sudden reveals I have 1500+ of the objects being created! Any guidance here would be appreciated.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    ah, very nice project,
    city cartoony setting reminds me of "Bart vs The Space Mutants"
    (yours being much more playable though!)

    it's a bit difficult going through all this stuff though,
    if you can point us to the code with scrolling, it would make easier taking a look

    as a general consideration,
    a custom scrolling (loading objects when entering + destroying on exit) could probably be more performant
    IF
    the alternative is stuffing all those objects in different layers
    BUT
    you could try to test anyway with layers and the "load on call" option
    - not sure if that would give similar results than this "custom" load on call?


    If custom scroll has significantly more advantages for you (ease of handling, flexibility..)
    I would stick with that..
    otherwise, I would test performance differences before making a choice.


    Regarding this:

    1. XPos(Object) = XLeftFrame - ObjectWidth
    +Player is Moving Right
    - Destroy Object

    better using <=
    or the object could risk not being destroyed because it's XPos is not *exactly* that
    (unless you use fastloops to scroll 1 px at time AND test this equation on fastloops)

Similar Threads

  1. layer scrolling effecting objects in other layers
    By Benateg in forum Fusion 2.5
    Replies: 0
    Last Post: 14th April 2014, 03:34 PM
  2. Replies: 7
    Last Post: 1st March 2014, 02:12 AM
  3. more known issues with layers and layer object?
    By BrashMonkey in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 4th January 2011, 09:06 AM
  4. Renaming Layers, Layer Obj and action by name ...
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 23rd January 2008, 11:46 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
  •