Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Platformer with Level Editor

 import QtQuick 2.0
 import Felgo 3.0
 import "../editorElements"

 PlatformerEntityBaseDraggable {
   id: spikeball
   entityType: "spikes"
   variationType: "ball"

   // set the size to the sprite's size
   width: image.width
   height: image.height

   // define colliderComponent for collision detection while dragging
   colliderComponent: collider

   // set image
   image.source: "../../assets/spikeball/spikeball.png"

   CircleCollider {
     id: collider

     // make the collider a little smaller than the sprite
     radius: parent.width / 2 - 2
     x: 2
     y: 2

     // the bodyType is static
     bodyType: Body.Static

     // the collider should not be active in edit mode
     active: !inLevelEditingMode

     // Category5: solids
     categories: Box.Category5
     // Category1: player body, Category2: player feet sensor,
     // Category3: opponent body, Category4: opponent sensor
Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded