Add support for Parallax Scrolling

This commit is contained in:
Darren Eberly
2021-03-31 20:26:55 -04:00
parent 9acda39a5d
commit 136af7692f
3 changed files with 19 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ EXPECTED = [
id=1,
size=common_types.Size(8, 6),
offset=common_types.OrderedPair(1, 3),
parallax_factor=common_types.OrderedPair(1.4, 1.3),
properties={
"test": "test property",
},
@@ -81,6 +82,7 @@ EXPECTED = [
opacity=1,
visible=True,
id=4,
parallax_factor=common_types.OrderedPair(2.3, 1.2),
layers=[
layer.ObjectLayer(
name="Object Layer 1",
@@ -115,6 +117,7 @@ EXPECTED = [
opacity=1,
visible=True,
id=5,
parallax_factor=common_types.OrderedPair(1.5, 1.2),
image=Path("../../images/tile_04.png"),
),
]

View File

@@ -10,6 +10,8 @@
"offsetx":1,
"offsety":3,
"opacity":1,
"parallaxx":1.4,
"parallaxy":1.3,
"properties":[
{
"name":"test",
@@ -49,6 +51,8 @@
}],
"name":"Group 1",
"opacity":1,
"parallaxx":2.3,
"parallaxy":1.2,
"type":"group",
"visible":true,
"x":0,
@@ -70,6 +74,8 @@
"image":"..\/..\/images\/tile_04.png",
"name":"Image Layer 2",
"opacity":1,
"parallaxx":1.5,
"parallaxy":1.2,
"type":"imagelayer",
"visible":true,
"x":0,
@@ -79,7 +85,7 @@
"nextobjectid":3,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.4.1",
"tiledversion":"1.5.0",
"tileheight":32,
"tilesets":[
{
@@ -88,6 +94,6 @@
}],
"tilewidth":32,
"type":"map",
"version":1.4,
"version":1.5,
"width":8
}