Stack With Friends Demo
import QtQuick 2.0
import Felgo 3.0
EntityBase {
id: box
entityType: "box"
width: 30
height: 30
transformOrigin: Item.TopLeft
Component.onCompleted: {
boxImage.width = box.width
boxImage.height = box.height
}
Image {
id: boxImage
source: "../../assets/img/crate.png"
x: boxCollider.x
y: boxCollider.y
width: 1
height: 1
Behavior on width {
NumberAnimation {duration: 200}
}
Behavior on height {
NumberAnimation {duration: 200}
}
}
BoxCollider {
id: boxCollider
x: -width/2
y: -height/2
friction: 1.6
restitution: 0
density: 0.2
categories: Box.Category1
angularVelocity: utils.generateRandomValueBetween(-4, 4);
EditableComponent {
editableType: "Balancing"
defaultGroup: "Box"
properties: {
"friction": {"min": 0, "max": 10, "stepsize": 0.1 },
"restitution": {"min": 0, "max": 1,"stepsize": 0.1 },
"density": {"min": 200, "max": 1000, "stepsize": 10 }
}