About FPS and performance.

52 views
Skip to first unread message

Toni Roca

unread,
Jan 27, 2021, 5:00:02 AM1/27/21
to cocos2d discuss

Hella again, last questions.
1-How i show the fps in the display?
2-I only use a few sprites, and the game its going slow with lagging. How can i solve this and what is the best way to avoid this problem?

Thanks all. :D

claudio canepa

unread,
Jan 27, 2021, 5:22:41 PM1/27/21
to cocos2d discuss
On Wed, Jan 27, 2021 at 7:00 AM Toni Roca <rokan...@gmail.com> wrote:

Hella again, last questions.
1-How i show the fps in the display?

director.init()
...
director.show_FPS = True

 
2-I only use a few sprites, and the game its going slow with lagging. How can i solve this and what is the best way to avoid this problem?

Use batches to group the sprites?

Otherwise, you need to profile to see what is the bottleneck, by example using cProfile (included with python) and some library to analyze the data, by example RunSnakeRun https://github.com/mcfletch/runsnakerun



Thanks all. :D

--
You received this message because you are subscribed to the Google Groups "cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocos-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cocos-discuss/500cd882-8a43-49d5-8641-95b6e8cbbb2fn%40googlegroups.com.

Antoni Rocafort Curia

unread,
Jan 28, 2021, 8:39:48 PM1/28/21
to cocos-...@googlegroups.com
I using cProfile, i see in one update function in Sprite have 35 seconds :O
Any game example for see the correct structure of the code?

Missatge de claudio canepa <ccan...@gmail.com> del dia dc., 27 de gen. 2021 a les 23:22:
Reply all
Reply to author
Forward
0 new messages