How do I improve performance (vertical scrolling game)?

0 favourites
  • 4 posts
From the Asset Store
All popular touch mechanics - scrolling, zooming, swiping
  • Hi. I'm making a vertical scrolling game, the gameplay is like whenever you're touching the screen, the character moves up and each 3-4 seconds an enemy shows up at the top of the screen, they move right to left and you should not collide with them.

    The way I programmed the movement of character is that it actually goes up (I don't move the background to make an illusion of moving) so the game should create who things: background and enemies (there are 13 kinds of enemies in total).

    And I have all my enemies in the game layout and I destroy them 1 second after start of layout (I did it to avoid jank).Also there are a couple of things the game does at start of layout, ir checks for an item in local storage (high score item), it sets position of an object, it sets two variables and there's a lite tween gesture that starts in the start of layout (it's basically resizing an object). Image memory usage in my phone (Xperia XA1) is about 36 mbs and cpu usage is about 70 at start of layout but after 7-8 seconds decreases to 35-40. Framerate at start is about 45 but after 2-3 seconds increases to 60.

    The problem is I still experience janks! There are no frame rate drops but I experience lag and janks and I have no idea what to do anymore.

    Tagged:

  • Hello Ary_Ary! with this info its really hard to understand why performance it´s jaggy or so slow in your code.

    This up and down on fps its a problem we always faced in construction but there is some workarounds could be applied...

    if you share a CAPX will be more simple to help you.

  • regarding what you indicate:

    1) you don't move the background to make an illusion of moving: must see if you are using a tiled background or sprite and the size of it must impact on performance...

    1) the enemies you do not need to destroy them 1 second after start of layout. do it without a delay of one second, not problem

    2) checks for an item in local storage will not cause any problem in CPU or GPU performance

    3) lite tween gesture??? why gesture?

    4) resizing an object with that plugin may not have also any impact on performance!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hello Ary_Ary! with this info its really hard to understand why performance it´s jaggy or so slow in your code.

    This up and down on fps its a problem we always faced in construction but there is some workarounds could be applied...

    if you share a CAPX will be more simple to help you.

    Well I managed to solve it. Instead of creating and destroying enemies, I changed the system in a way that It creates all enemies only once and then it just repositions them whenever needed. It doesn't create and destroy each object.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)