Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arcade/tilemap/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ def _process_object_layer(
# center_x = width / 2
# center_y = height / 2
if cur_object.rotation:
rotation = -math.radians(cur_object.rotation)
rotation = math.radians(cur_object.rotation)
else:
rotation = 0

Expand Down
271 changes: 266 additions & 5 deletions tests/fixtures/tilemaps/rotation.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
"infinite":false,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 2147483654, 0, 2684354566, 3758096390, 0, 3221225478, 1073741830, 0, 1610612742, 536870918],
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
6, 2147483654, 0, 2684354566, 3758096390, 0, 3221225478, 1073741830, 0, 1610612742, 536870918],
"height":10,
"id":1,
"name":"Blocking Sprites",
Expand All @@ -13,12 +22,264 @@
"width":11,
"x":0,
"y":0
},
{
"draworder":"topdown",
"id":2,
"name":"Objects Sprites",
"objects":[
{
"gid":6,
"height":128,
"id":1,
"name":"not",
"rotation":0,
"type":"",
"visible":true,
"width":128,
"x":0,
"y":1024
},
{
"gid":2147483654,
"height":128,
"id":2,
"name":"h",
"rotation":0,
"type":"",
"visible":true,
"width":128,
"x":128,
"y":1024
},
{
"gid":6,
"height":128,
"id":3,
"name":"90",
"rotation":90,
"type":"",
"visible":true,
"width":128,
"x":384,
"y":896
},
{
"gid":2147483654,
"height":128,
"id":9,
"name":"h90",
"rotation":90,
"type":"",
"visible":true,
"width":128,
"x":512,
"y":896
},
{
"gid":6,
"height":128,
"id":5,
"name":"180",
"rotation":180,
"type":"",
"visible":true,
"width":128,
"x":896,
"y":896
},
{
"gid":2147483654,
"height":128,
"id":6,
"name":"h180",
"rotation":180,
"type":"",
"visible":true,
"width":128,
"x":1024,
"y":896
},
{
"gid":6,
"height":128,
"id":7,
"name":"-90",
"rotation":-90,
"type":"",
"visible":true,
"width":128,
"x":1280,
"y":1024
},
{
"gid":2147483654,
"height":128,
"id":8,
"name":"h-90",
"rotation":-90,
"type":"",
"visible":true,
"width":128,
"x":1408,
"y":1024
},
{
"gid":1073741830,
"height":128,
"id":10,
"name":"v",
"rotation":0,
"type":"",
"visible":true,
"width":128,
"x":0,
"y":768
},
{
"gid":3221225478,
"height":128,
"id":11,
"name":"hv",
"rotation":0,
"type":"",
"visible":true,
"width":128,
"x":128,
"y":768
},
{
"gid":1073741830,
"height":128,
"id":13,
"name":"v90",
"rotation":90,
"type":"",
"visible":true,
"width":128,
"x":384,
"y":640
},

{
"gid":3221225478,
"height":128,
"id":14,
"name":"hv90",
"rotation":90,
"type":"",
"visible":true,
"width":128,
"x":512,
"y":640
},
{
"gid":1073741830,
"height":128,
"id":15,
"name":"v180",
"rotation":180,
"type":"",
"visible":true,
"width":128,
"x":896,
"y":640
},
{
"gid":3221225478,
"height":128,
"id":16,
"name":"hv180",
"rotation":180,
"type":"",
"visible":true,
"width":128,
"x":1024,
"y":640
},
{
"gid":1073741830,
"height":128,
"id":17,
"name":"v-90",
"rotation":-90,
"type":"",
"visible":true,
"width":128,
"x":1280,
"y":768
},
{
"gid":3221225478,
"height":128,
"id":18,
"name":"hv-90",
"rotation":-90,
"type":"",
"visible":true,
"width":128,
"x":1408,
"y":768
},
{
"gid":90,
"height":128,
"id":19,
"name":"r0",
"rotation":0,
"type":"",
"visible":true,
"width":128,
"x":0,
"y":512
},
{
"gid":90,
"height":128,
"id":20,
"name":"r1",
"rotation":-90,
"type":"",
"visible":true,
"width":128,
"x":384,
"y":512
},
{
"gid":90,
"height":128,
"id":21,
"name":"r2",
"rotation":-180,
"type":"",
"visible":true,
"width":128,
"x":640,
"y":384
},
{
"gid":90,
"height":128,
"id":22,
"name":"r3",
"rotation":90,
"type":"",
"visible":true,
"width":128,
"x":768,
"y":384
}],
"opacity":1,
"type":"objectgroup",
"visible":true,
"x":0,
"y":0
}],
"nextlayerid":2,
"nextobjectid":1,
"nextlayerid":3,
"nextobjectid":25,
"orientation":"orthogonal",
"renderorder":"left-up",
"tiledversion":"1.4.3",
"tiledversion":"1.10.1",
"tileheight":128,
"tilesets":[
{
Expand All @@ -27,6 +288,6 @@
}],
"tilewidth":128,
"type":"map",
"version":1.4,
"version":"1.10",
"width":11
}
Loading