GithubHelp home page GithubHelp logo

Comments (5)

Draknek avatar Draknek commented on August 25, 2024

Fixed in 93dd26d (hopefully without other effects)

from flashpunk.

Draknek avatar Draknek commented on August 25, 2024

Discussion in 93dd26d:

  • Changing an entity's position and removing it in the same frame makes it appear for one frame at the new position.
  • Expectation: once an entity is removed, it should no longer be rendered.

My proposed change: both add and remove at the start of the frame, and remove but not add between update and render.

from flashpunk.

danishgoel avatar danishgoel commented on August 25, 2024

Though your suggestion solves the immediate issue, but it may cause more confusion. As entities will now be removed in the same frame but added in the next one. If I would try to swap out an entity it would still flicker as there would be now no entity to render in the current frame.

Only real solution (as far as I can see) would be with a mechanism that does both add and remove at the same point in the loop.

Maybe we can have an optional argument to both add and remove functions that specifies whether to wait till frame end to add/remove, or add/remove immediately. e.g.

public function add(e:Entity, immediate:Boolean = false):Entity { ... }

public function remove(e:Entity, immediate:Boolean = false):Entity { ... }

this way we can use the optional argument in the special cases where we want the change to be effective immediately. Or we can have it the other way around and use the old method by default.

from flashpunk.

kylepulver avatar kylepulver commented on August 25, 2024

When changing the layer of an entity during its update you can get some pretty wacky results. For example I have an entity on layer -100, and an entity on layer 0. If I set the entity on layer 0 to -200, the entity on layer -100 will disappear for a frame. If I switch that -200 entity back to 0, the entity itself will disappear for a frame.

from flashpunk.

Draknek avatar Draknek commented on August 25, 2024

Fixed in b170822.

@danishgoel @kylepulver Can you check this out and see if it fits your expected behaviour now?

from flashpunk.

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.