Giter Club home page Giter Club logo

Comments (5)

cristianbote avatar cristianbote commented on May 21, 2024 1

Hey,

Thanks for creating a new issue for it!
So, looking over your code, and then over Phaser's Group prototype for.top (https://github.com/photonstorm/phaser/blob/master/src/core/Group.js#L2771) seems like it might be actually related to Phaser setter of .top. Check it out, there's a call to .getBounds() after which the group's .y is being set.
IMO it's randomly happening, maybe, because whenever the transition didn't finished yet, and the slide it's still animating, the .top setter makes the call to .getBounds() which in turn might catch the overlapping of the slide.

To confirm this, can you use this instead of getRandomStateTransitionIn()

{
    ease: Phaser.Easing.Exponential.InOut,
    duration: 2e3, // 2s
    intro: true,
    props: {
        y: function(game) {
            return game.height;
        }
    }
}

This increases the transition duration and you could notice the scrambled sprites more often.

Cheers!

from phaser-state-transition.

JarLowrey avatar JarLowrey commented on May 21, 2024

Ah ok i thought it might be something like this. That seems probable to me. I'll check it out after work. Thanks man! Good find!

from phaser-state-transition.

JarLowrey avatar JarLowrey commented on May 21, 2024

Yeah that change makes it much more likely. I upped it to 3s and it seems to happen every time. commit Can you clarify what you mean by

.top setter makes the call to .getBounds() which in turn might catch the overlapping of the slide.

Any idea on how we can remedy this? I'm looking over the plugin now for potential solutions. I've updated my repo with the new transitions. Something suspicious that I've noticed is that on the initial rendering game.world has the properties

//on my monitor
centerX:586
centerY:409
x:-0
y:-0

but on all subsequent state transitions when it breaks (remains the same when it does not break):

centerX:586
centerY:-2551
x:-0
y:-0

Since I'm only transitioning on Y, I'd assume game.world would probably break on its X value when you transition horizontally as well.

Also, I noticed some other potential issues.

  1. When my random 'out' transition is null and the 'in' transition is In.SlideTop, no transitions occur. When 'in' is null and 'out' is Out.SlideTop, transitions work.
  2. When the 'out' transition is Out.SlideTop and the 'in' transition is the custom one defined above, it transitions in a disjointed way.
  • store transitions out via SlideTop. It appears that the next state begins simultaneous to the transition, which means by the time it finishes the state has been running game logic for a little while.
  • There is a brief pause as you can see the next state running.
  • The 'In' transition begins & ends, overlapping game state, and you can view the state again.

from phaser-state-transition.

JarLowrey avatar JarLowrey commented on May 21, 2024

K I've fixed some issues but still have not figured out why world/Groups are getting messed up. It seems to somehow be caused by the renderXY call that is drawing world to the ContentSnapshot Image

from phaser-state-transition.

JarLowrey avatar JarLowrey commented on May 21, 2024

OK SO I found a work around. Instead of using ...renderXY(game.world... iterate over all of game.world's children and call renderXY on those instead. I guess game.world is treated different than a generic Phaser.Group or displayObject. But this seems to work well for me! I'll submit a PR.

from phaser-state-transition.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.