Platformer with Level Editor
import Felgo 3.0
import QtQuick 2.0
EntityBase {
id: resetSensor
entityType: "resetSensor"
property var player
x: player.x
y: 0
width: player.width
height: 10
visible: !player.inLevelEditingMode
enabled: !player.inLevelEditingMode
signal contact
BoxCollider {
anchors.fill: parent
collisionTestingOnlyMode: true
categories: Box.Category6
collidesWith: Box.Category1
fixture.onBeginContact: {
var otherEntity = other.getBody().target
if(otherEntity.entityType === "player") {
resetSensor.contact()
}
}
}
Rectangle {
visible: false
y: -resetSensor.height
width: parent.width
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
color: "yellow"
opacity: 0.5
Text {
y: -resetSensor.height
anchors.centerIn: parent
text: "reset sensor"
color: "white"
font.pixelSize: 9