Comments (3)
when you schedule a function,let say with an interval of 0.10 seconds, it is not
guaranteed what you will be called at that interval, it is possible that the
interval
is bigger, that's why it is important to maintain the elapsed variable.
please, provide an example where code fails, or provide a patch since I think
that I
didn't understand the problem.
Original comment by [email protected]
on 1 Oct 2008 at 2:27
from cocos2d-iphone.
Lets say dt is always 0.1 (10 fps).
Lets say my interval is set to 0.05 (20 fps).
The invocation is passed in the elapsed time which will be:
0.05, 0.1, 0.15, etc, increasing by 0.05 each call.
So, instead of passing in the real delta time, you are passing in how far
behind you
are getting. This is in NO way a delta time.
Ideally you should pass in the delta from the LAST invocation, to this NEW one.
Setting elapsed to 0 each time is one way of keeping track of how much time
elapsed
between invocations.
I have no idea what it is keeping track of now though.
Original comment by [email protected]
on 1 Oct 2008 at 2:55
from cocos2d-iphone.
thanks
fixed in r261
Original comment by [email protected]
on 6 Oct 2008 at 1:54
- Changed state: Fixed
from cocos2d-iphone.
Related Issues (20)
- Improvement: Add assert to catch wrong signature in schedule HOT 3
- [patch] CocosNode tuning & comments for tricky sections HOT 6
- TextureMgr TileMapAtlas cannot use items outside of resource folder suggest FileUtils.m HOT 4
- FastDirector leaks HOT 5
- Enhancement: make Actions taggable HOT 6
- filter by "device id" in cocos live client HOT 1
- Improvement: Add ability to add items to MenuItemToggle (and others) after object has been created HOT 3
- Adjacent sprites have a seam while moving HOT 3
- new Alias/AntiAlias API HOT 3
- cocos live needs to add url encode for spaces in category - stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding HOT 2
- Ribbon is causing NSRangeException HOT 4
- Ribbon has gaps while moving HOT 2
- TextureNode should retain its texture HOT 10
- [defect] remove scale ivar from CocosNode HOT 3
- [defect] memory leak in MenuItemFont HOT 1
- attachInView: will offset the actual drawing area by the view's origin HOT 4
- [patch] Extract RGB properties to a protocol and apply it to AtlasNode HOT 4
- [patch] Add MenuItemAtlasFont HOT 1
- [patch] Time Scaling for Actions HOT 34
- Improving OpenGL ES performance using CATransform3D
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 cocos2d-iphone.