-
Notifications
You must be signed in to change notification settings - Fork 2
/
Floor.qml
47 lines (40 loc) · 923 Bytes
/
Floor.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* Floor.qml
*
* Copyright (C) 2014 Paulo Pinheiro
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
import QtQuick 2.3
import Bacon2D 1.0
Item{
id:floor
property Scene scene
signal touchedFloor(var other)
visible:true
BoxBody{
id:body
target: floor
world: scene.world
bodyType: Body.Static
width:floor.width; height:floor.height
density:1
friction: 1
sensor:false
onBeginContact: touchedFloor(other)
}
InfiniteScrollItem{
id:scrollItem
Image{
width: floor.width; height: floor.height
source: "img/land.png"
fillMode: Image.Tile
}
}
Timer{
running:scene.running
interval: 16
repeat: true
onTriggered: scrollItem.offsetX +=0.3
}
}