Quantcast
Channel: cocos2d-x - Cocos Forums
Viewing all articles
Browse latest Browse all 2748

Game is not smooth

$
0
0

@mhmtemnacr wrote:

Im making a game using cocos2dx 3.17.2. The problem is that game doesnt run smoothly and i couldnt find a solution (tried many things). Screen is flickering on both android and win32.

Visual studio profiler tells schedule function is taking time. i have this code in scheduled function:

    void HelloWorld::scrollScene(float dt) {
        .......

        pos1 = sprSceneback1->getPosition();
     	pos2 = sprSceneback2->getPosition();

	    pos1.x -= scrollSpeed*dt;
	    pos2.x -= scrollSpeed*dt;

        sprSceneback1->setPosition(pos1);
        sprSceneback2->setPosition(pos2);
     }

I have 2 background sprites and they are constantly scrolling.

How can i fix this problem, sorry for my bad english

Posts: 4

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 2748

Trending Articles