0

I am new to use cocos 2d python and I face a problem now: I want to limit the FPS below 60, but it seems that the python cocos2d framework doesn't provide the interface to limit the FPS.

My code framework is as follow:

# -*- coding: utf-8 -*-
import cocos
import pyglet
from cocos.actions import *
from cocos.director import *
from cocos.scene import *
from game_controller import *
import common

def main():
    #initialize director
    director.init( width=common.visibleSize["width"], height=common.visibleSize["height"], caption="Flappy Bird")

    #turn off display FPS
    #director.show_FPS = True

    #run
    gameScene = Scene()
    game_start(gameScene)

    if director.scene:
        director.replace(gameScene)
    else:
        director.run(gameScene)

Does anyone know how to solve this problem? Thanx in advance!

Chen YuFan
  • 19
  • 5

1 Answers1

0

You should take a look around pyglet instead cocos2d for fps limitation. Answer example: https://stackoverflow.com/a/14735825/801924

bux
  • 7,087
  • 11
  • 45
  • 86