Here there I am seeing this:
When I run the following code:
import VPlay 1.0
import QtQuick 1.1
import Box2D 1.0
GameWindow {
id:window
EntityManager {
id:entityManager
entityContainer: scene
}
Rectangle {
anchors.fill: parent
color: "black"
}
Scene {
id:scene
PhysicsWorld{
gravity.y: -9.81
z: 10
updatesPerSecondForPhysics: 60
velocityIterations: 5
positionIterations: 5
}
EntityBase {
entityId: "box1"
entityType: "box"
Image {
id: boxImage
source: "img/box.PNG"
width: 32
height: 32
}
BoxCollider{
anchors.fill: boxImage
}
}
}
EntityBase {
entityId: "ground1"
entityType: "ground"
height: 20
anchors {
bottom: scene.bottom
left: scene.left
right: scene.right
}
Rectangle {
anchors.fill: parent
color: "blue"
}
BoxCollider {
anchors.fill: parent
bodyType: Body.Static // the body shouldn't move
}
}
}
I am pretty sure that the blue rectangle should be at the bottom but cannot figure out what I am doing wrong.
- This topic was modified 10 years, 3 months ago by Stan.