Creating many levels?

  • Freddiew
    Likes 0

    Problem Description

    Hello, my question is how can I create many levels without having to use a single script for each of the levels.

    This video I view that you use only one script called GameScene.h and other GameScene.cpp but in the game you have 50 different levels.

    I am very new to cocos2d-x so I do not really understand how it works.

  • Sonar Systems admin
    Likes 0

    We have several level files which are .plist files. The GameScene loads them in using a common format for positioning and properties.


    This reply has been verified.
  • Freddiew
    Likes 1

    So are plist files which stores the position of objects for each level?


    This reply has been verified.
  • Sonar Systems admin
    Likes 0

    We made them store an array which had number identifying what type of object. 

    Then our code traversed the array and when it found something at an array place it populated the corresponding grid space on the screen.

Login to reply