Comments (5)
Fixed in 93dd26d (hopefully without other effects)
from flashpunk.
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.
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.
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.
Fixed in b170822.
@danishgoel @kylepulver Can you check this out and see if it fits your expected behaviour now?
from flashpunk.
Related Issues (20)
- Sfx volume not changed when type's global volume is set to zero HOT 2
- onActivate/onDeactivate HOT 1
- PreRotation + Flip = Weird
- Is there a reason Input.update is called after update()? HOT 1
- Draw.text() eats up a LOT of memory. HOT 2
- Text Anti-aliasing through options HOT 2
- World's internal linked lists (as well as Entities') should be made public HOT 12
- Console.log() falls when arg is null
- When Tweens are completed, the target value should be exactly the one provided HOT 4
- FP utils functions need optimisation
- Add zoom function to FP.screen
- Entity.removeGraphic and World.removeGraphic?
- Document workaround for Text class that avoids tinted background color
- Worlds: controlling update sequence. HOT 1
- Fix Tween.tween() and autoStart HOT 5
- using 0 in Tilemap.createGrid() sets empty tiles as solid HOT 4
- We need milestones HOT 13
- recyleList() and collideLineInto()
- Behavior of 'color' and 'alpha' parameters in Draw.as functions inconsistent
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flashpunk.