Level1.qml Example File

demos/Platformer/qml/levels/Level1.qml
 import Felgo 3.0
 import QtQuick 2.0
 import "../entities"
 import "." as Levels

 Levels.LevelBase {
   id: level
   // we need to specify the width to get correct debug draw for our physics
   // the PhysicsWorld component fills it's parent by default, which is the viewPort Item of the gameScene and this item uses the size of the level
   // NOTE: thy physics will also work without defining the width here, so no worries, you can ignore it untill you want to do some physics debugging
   width: 42 * gameScene.gridSize // 42 because our last tile is a size 30 Ground at row 12

   // you could draw your level on a graph paper and then add the tiles here only by defining their row, column and size
   Ground {
     row: 0
     column: 0
     size: 6
   }
   Ground {
     row: 8
     column: 0
     size: 2
   }
   Platform {
     row: 3
     column: 3
     size: 4
   }
   Platform {
     row: 7
     column: 6
     size: 4
   }
   Platform {
     row: 11
     column: 3
     size: 2
   }
   Ground {
     row: 12
     column: 0
     size: 30
   }
   Platform {
     row: 17
     column: 3
     size: 10
   }
 }

Voted #1 for:

  • Easiest to learn
  • Most time saving
  • Best support

Develop Cross-Platform Apps and Games 50% Faster!

  • Voted the best supported, most time-saving and easiest to learn cross-platform development tool
  • Based on the Qt framework, with native performance and appearance on all platforms including iOS and Android
  • Offers a variety of plugins to monetize, analyze and engage users
FREE!
create apps
create games
cross platform
native performance
3rd party services
game network
multiplayer
level editor
easiest to learn
biggest time saving
best support