Add animated plant assets and update room configurations: Introduce new animated plant images for enhanced visual effects in the game. Update room JSON and TMJ files to include these assets, ensuring proper integration with the existing room management system. Refactor player effects to trigger animations when interacting with animated plants, improving gameplay dynamics.

This commit is contained in:
Z. Cliffe Schreuders
2025-10-13 11:22:35 +01:00
parent 92d5fb268d
commit ea15e7d2c8
23 changed files with 871 additions and 299 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@@ -24,16 +24,16 @@
"y":0
},
{
"data":[416, 417, 418, 419, 420, 421, 422, 423, 424, 425,
426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
436, 437, 438, 439, 440, 441, 442, 443, 444, 445,
446, 447, 448, 449, 450, 451, 452, 453, 454, 455,
456, 457, 458, 459, 460, 461, 462, 463, 464, 465,
466, 467, 468, 469, 470, 471, 472, 473, 474, 475,
476, 477, 478, 479, 480, 481, 482, 483, 484, 485,
486, 487, 488, 489, 490, 491, 492, 493, 494, 495,
496, 497, 498, 499, 500, 501, 502, 503, 504, 505,
506, 507, 508, 509, 510, 511, 512, 513, 514, 515],
"data":[434, 435, 436, 437, 438, 439, 440, 441, 442, 443,
444, 445, 446, 447, 448, 449, 450, 451, 452, 453,
454, 455, 456, 457, 458, 459, 460, 461, 462, 463,
464, 465, 466, 467, 468, 469, 470, 471, 472, 473,
474, 475, 476, 477, 478, 479, 480, 481, 482, 483,
484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
494, 495, 496, 497, 498, 499, 500, 501, 502, 503,
504, 505, 506, 507, 508, 509, 510, 511, 512, 513,
514, 515, 516, 517, 518, 519, 520, 521, 522, 523,
524, 525, 526, 527, 528, 529, 530, 531, 532, 533],
"height":10,
"id":1,
"name":"room",
@@ -47,12 +47,12 @@
{
"data":[0, 101, 0, 0, 0, 0, 0, 0, 101, 0,
0, 107, 0, 0, 0, 0, 0, 0, 107, 0,
410, 0, 0, 0, 0, 0, 0, 0, 0, 410,
428, 0, 0, 0, 0, 0, 0, 0, 0, 428,
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,
410, 0, 0, 0, 0, 0, 0, 0, 0, 410,
428, 0, 0, 0, 0, 0, 0, 0, 0, 428,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":10,
@@ -71,7 +71,7 @@
"name":"tables",
"objects":[
{
"gid":525,
"gid":543,
"height":61,
"id":96,
"name":"",
@@ -223,18 +223,6 @@
"x":31.5,
"y":163.5
},
{
"gid":347,
"height":88,
"id":74,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":42,
"x":79,
"y":147
},
{
"gid":175,
"height":14,
@@ -330,6 +318,18 @@
"width":48,
"x":133.5,
"y":51.5
},
{
"gid":423,
"height":88,
"id":97,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":67.3333333333333,
"y":147.666666666667
}],
"opacity":1,
"type":"objectgroup",
@@ -493,7 +493,7 @@
"y":0
}],
"nextlayerid":11,
"nextobjectid":97,
"nextobjectid":98,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.2",
@@ -537,7 +537,7 @@
"margin":0,
"name":"objects",
"spacing":0,
"tilecount":278,
"tilecount":296,
"tileheight":359,
"tiles":[
{
@@ -2234,12 +2234,122 @@
"image":"..\/objects\/servers4.png",
"imageheight":47,
"imagewidth":26
},
{
"id":297,
"image":"..\/objects\/chair-white-1.aseprite",
"imageheight":32,
"imagewidth":32
},
{
"id":298,
"image":"..\/objects\/fingerprint_kit.png",
"imageheight":24,
"imagewidth":10
},
{
"id":299,
"image":"..\/objects\/fingerprint_small.png",
"imageheight":24,
"imagewidth":18
},
{
"id":300,
"image":"..\/objects\/notes5.png",
"imageheight":32,
"imagewidth":25
},
{
"id":301,
"image":"..\/objects\/plant-large11-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":302,
"image":"..\/objects\/plant-large11-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":303,
"image":"..\/objects\/plant-large11-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":304,
"image":"..\/objects\/plant-large11-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":305,
"image":"..\/objects\/plant-large12-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":306,
"image":"..\/objects\/plant-large12-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":307,
"image":"..\/objects\/plant-large12-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":308,
"image":"..\/objects\/plant-large12-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":309,
"image":"..\/objects\/plant-large12-top-ani5.png",
"imageheight":75,
"imagewidth":64
},
{
"id":310,
"image":"..\/objects\/plant-large13-top-ani1.png",
"imageheight":88,
"imagewidth":64
},
{
"id":311,
"image":"..\/objects\/plant-large13-top-ani2.png",
"imageheight":88,
"imagewidth":64
},
{
"id":312,
"image":"..\/objects\/plant-large13-top-ani3.png",
"imageheight":88,
"imagewidth":64
},
{
"id":313,
"image":"..\/objects\/plant-large13-top-ani4.png",
"imageheight":88,
"imagewidth":64
},
{
"id":314,
"image":"..\/objects\/workstation.png",
"imageheight":18,
"imagewidth":24
}],
"tilewidth":221
},
{
"columns":6,
"firstgid":410,
"firstgid":428,
"image":"..\/tiles\/door_side_sheet_32.png",
"imageheight":32,
"imagewidth":192,
@@ -2252,7 +2362,7 @@
},
{
"columns":10,
"firstgid":416,
"firstgid":434,
"image":"..\/tiles\/rooms\/room14.png",
"imageheight":320,
"imagewidth":320,
@@ -2265,7 +2375,7 @@
},
{
"columns":0,
"firstgid":516,
"firstgid":534,
"grid":
{
"height":1,

View File

@@ -32,16 +32,16 @@
"y":0
},
{
"data":[416, 417, 418, 419, 420, 421, 422, 423, 424, 425,
426, 427, 428, 429, 430, 431, 432, 433, 434, 435,
436, 437, 438, 439, 440, 441, 442, 443, 444, 445,
446, 447, 448, 449, 450, 451, 452, 453, 454, 455,
456, 457, 458, 459, 460, 461, 462, 463, 464, 465,
466, 467, 468, 469, 470, 471, 472, 473, 474, 475,
476, 477, 478, 479, 480, 481, 482, 483, 484, 485,
486, 487, 488, 489, 490, 491, 492, 493, 494, 495,
496, 497, 498, 499, 500, 501, 502, 503, 504, 505,
506, 507, 508, 509, 510, 511, 512, 513, 514, 515],
"data":[434, 435, 436, 437, 438, 439, 440, 441, 442, 443,
444, 445, 446, 447, 448, 449, 450, 451, 452, 453,
454, 455, 456, 457, 458, 459, 460, 461, 462, 463,
464, 465, 466, 467, 468, 469, 470, 471, 472, 473,
474, 475, 476, 477, 478, 479, 480, 481, 482, 483,
484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
494, 495, 496, 497, 498, 499, 500, 501, 502, 503,
504, 505, 506, 507, 508, 509, 510, 511, 512, 513,
514, 515, 516, 517, 518, 519, 520, 521, 522, 523,
524, 525, 526, 527, 528, 529, 530, 531, 532, 533],
"height":10,
"id":1,
"name":"room",
@@ -55,12 +55,12 @@
{
"data":[0, 101, 0, 0, 0, 0, 0, 0, 101, 0,
0, 107, 0, 0, 0, 0, 0, 0, 107, 0,
410, 0, 0, 0, 0, 0, 0, 0, 0, 410,
428, 0, 0, 0, 0, 0, 0, 0, 0, 428,
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,
410, 0, 0, 0, 0, 0, 0, 0, 0, 410,
428, 0, 0, 0, 0, 0, 0, 0, 0, 428,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":10,
@@ -79,7 +79,7 @@
"name":"tables",
"objects":[
{
"gid":525,
"gid":543,
"height":61,
"id":96,
"name":"",
@@ -231,18 +231,6 @@
"x":31.5,
"y":163.5
},
{
"gid":347,
"height":88,
"id":74,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":42,
"x":79,
"y":147
},
{
"gid":175,
"height":14,
@@ -338,6 +326,18 @@
"width":48,
"x":133.5,
"y":51.5
},
{
"gid":423,
"height":88,
"id":97,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":67.3333333333333,
"y":147.666666666667
}],
"opacity":1,
"type":"objectgroup",
@@ -501,7 +501,7 @@
"y":0
}],
"nextlayerid":11,
"nextobjectid":97,
"nextobjectid":98,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.2",
@@ -536,7 +536,7 @@
"margin":0,
"name":"objects",
"spacing":0,
"tilecount":278,
"tilecount":296,
"tileheight":359,
"tiles":[
{
@@ -2233,19 +2233,129 @@
"image":"..\/objects\/servers4.png",
"imageheight":47,
"imagewidth":26
},
{
"id":297,
"image":"..\/objects\/chair-white-1.aseprite",
"imageheight":32,
"imagewidth":32
},
{
"id":298,
"image":"..\/objects\/fingerprint_kit.png",
"imageheight":24,
"imagewidth":10
},
{
"id":299,
"image":"..\/objects\/fingerprint_small.png",
"imageheight":24,
"imagewidth":18
},
{
"id":300,
"image":"..\/objects\/notes5.png",
"imageheight":32,
"imagewidth":25
},
{
"id":301,
"image":"..\/objects\/plant-large11-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":302,
"image":"..\/objects\/plant-large11-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":303,
"image":"..\/objects\/plant-large11-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":304,
"image":"..\/objects\/plant-large11-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":305,
"image":"..\/objects\/plant-large12-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":306,
"image":"..\/objects\/plant-large12-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":307,
"image":"..\/objects\/plant-large12-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":308,
"image":"..\/objects\/plant-large12-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":309,
"image":"..\/objects\/plant-large12-top-ani5.png",
"imageheight":75,
"imagewidth":64
},
{
"id":310,
"image":"..\/objects\/plant-large13-top-ani1.png",
"imageheight":88,
"imagewidth":64
},
{
"id":311,
"image":"..\/objects\/plant-large13-top-ani2.png",
"imageheight":88,
"imagewidth":64
},
{
"id":312,
"image":"..\/objects\/plant-large13-top-ani3.png",
"imageheight":88,
"imagewidth":64
},
{
"id":313,
"image":"..\/objects\/plant-large13-top-ani4.png",
"imageheight":88,
"imagewidth":64
},
{
"id":314,
"image":"..\/objects\/workstation.png",
"imageheight":18,
"imagewidth":24
}],
"tilewidth":221
},
{
"firstgid":410,
"firstgid":428,
"source":"..\/..\/..\/assets\/rooms\/door_side_sheet_32.tsx"
},
{
"firstgid":416,
"firstgid":434,
"source":"room14.tsx"
},
{
"firstgid":516,
"firstgid":534,
"source":"tables.tsx"
}],
"tilewidth":32,

View File

@@ -47,12 +47,12 @@
{
"data":[0, 101, 0, 0, 0, 0, 0, 0, 101, 0,
0, 107, 0, 0, 0, 0, 0, 0, 107, 0,
420, 0, 0, 0, 0, 0, 0, 0, 0, 420,
438, 0, 0, 0, 0, 0, 0, 0, 0, 438,
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,
420, 0, 0, 0, 0, 0, 0, 0, 0, 420,
438, 0, 0, 0, 0, 0, 0, 0, 0, 438,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":10,
@@ -307,30 +307,6 @@
"x":159,
"y":250
},
{
"gid":361,
"height":79,
"id":20,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":44,
"x":30.5,
"y":302.5
},
{
"gid":362,
"height":76,
"id":21,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":38,
"x":246.5,
"y":301.5
},
{
"gid":173,
"height":17,
@@ -378,31 +354,6 @@
"width":14,
"x":295,
"y":182.333333333333
},
{
"gid":361,
"height":79,
"id":57,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":44,
"x":241,
"y":242
},
{
"gid":362,
"height":76,
"id":58,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":38,
"x":36,
"y":238
},
{
"gid":176,
@@ -427,7 +378,8 @@
"width":21,
"x":168.666666666667,
"y":34.6666666666666
},
},
{
"gid":177,
"height":21,
@@ -451,6 +403,54 @@
"width":16,
"x":89.6666666666667,
"y":42.3333333333333
},
{
"gid":426,
"height":75,
"id":76,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":29.5,
"y":240
},
{
"gid":428,
"height":75,
"id":77,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":27.5,
"y":302.5
},
{
"gid":430,
"height":75,
"id":78,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":225,
"y":239.5
},
{
"gid":424,
"height":75,
"id":79,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":227,
"y":304
}],
"opacity":1,
"type":"objectgroup",
@@ -589,7 +589,7 @@
"y":0
}],
"nextlayerid":11,
"nextobjectid":76,
"nextobjectid":80,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.2",
@@ -686,7 +686,7 @@
"margin":0,
"name":"objects",
"spacing":0,
"tilecount":278,
"tilecount":296,
"tileheight":359,
"tiles":[
{
@@ -2383,12 +2383,122 @@
"image":"..\/objects\/chair-white-1-rotate8.png",
"imageheight":32,
"imagewidth":32
},
{
"id":297,
"image":"..\/objects\/chair-white-1.aseprite",
"imageheight":32,
"imagewidth":32
},
{
"id":298,
"image":"..\/objects\/fingerprint_kit.png",
"imageheight":24,
"imagewidth":10
},
{
"id":299,
"image":"..\/objects\/fingerprint_small.png",
"imageheight":24,
"imagewidth":18
},
{
"id":300,
"image":"..\/objects\/notes5.png",
"imageheight":32,
"imagewidth":25
},
{
"id":301,
"image":"..\/objects\/plant-large11-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":302,
"image":"..\/objects\/plant-large11-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":303,
"image":"..\/objects\/plant-large11-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":304,
"image":"..\/objects\/plant-large11-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":305,
"image":"..\/objects\/plant-large12-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":306,
"image":"..\/objects\/plant-large12-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":307,
"image":"..\/objects\/plant-large12-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":308,
"image":"..\/objects\/plant-large12-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":309,
"image":"..\/objects\/plant-large12-top-ani5.png",
"imageheight":75,
"imagewidth":64
},
{
"id":310,
"image":"..\/objects\/plant-large13-top-ani1.png",
"imageheight":88,
"imagewidth":64
},
{
"id":311,
"image":"..\/objects\/plant-large13-top-ani2.png",
"imageheight":88,
"imagewidth":64
},
{
"id":312,
"image":"..\/objects\/plant-large13-top-ani3.png",
"imageheight":88,
"imagewidth":64
},
{
"id":313,
"image":"..\/objects\/plant-large13-top-ani4.png",
"imageheight":88,
"imagewidth":64
},
{
"id":314,
"image":"..\/objects\/workstation.png",
"imageheight":18,
"imagewidth":24
}],
"tilewidth":221
},
{
"columns":6,
"firstgid":420,
"firstgid":438,
"image":"..\/tiles\/door_side_sheet_32.png",
"imageheight":32,
"imagewidth":192,

View File

@@ -55,12 +55,12 @@
{
"data":[0, 101, 0, 0, 0, 0, 0, 0, 101, 0,
0, 107, 0, 0, 0, 0, 0, 0, 107, 0,
418, 0, 0, 0, 0, 0, 0, 0, 0, 418,
438, 0, 0, 0, 0, 0, 0, 0, 0, 438,
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,
418, 0, 0, 0, 0, 0, 0, 0, 0, 418,
438, 0, 0, 0, 0, 0, 0, 0, 0, 438,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":10,
@@ -102,7 +102,7 @@
"name":"table_items",
"objects":[
{
"gid":356,
"gid":358,
"height":23,
"id":27,
"name":"",
@@ -114,7 +114,7 @@
"y":64.5
},
{
"gid":356,
"gid":358,
"height":23,
"id":28,
"name":"",
@@ -126,7 +126,7 @@
"y":65
},
{
"gid":161,
"gid":163,
"height":23,
"id":33,
"name":"",
@@ -138,7 +138,7 @@
"y":54.6666666666667
},
{
"gid":164,
"gid":166,
"height":20,
"id":34,
"name":"",
@@ -150,7 +150,7 @@
"y":54.6666666666667
},
{
"gid":228,
"gid":230,
"height":17,
"id":47,
"name":"",
@@ -173,7 +173,7 @@
"name":"conditional_table_items",
"objects":[
{
"gid":187,
"gid":189,
"height":14,
"id":45,
"name":"",
@@ -185,7 +185,7 @@
"y":65.25
},
{
"gid":218,
"gid":220,
"height":11,
"id":46,
"name":"",
@@ -197,7 +197,7 @@
"y":65.75
},
{
"gid":225,
"gid":227,
"height":16,
"id":48,
"name":"",
@@ -209,7 +209,7 @@
"y":51
},
{
"gid":310,
"gid":312,
"height":16,
"id":54,
"name":"",
@@ -221,7 +221,7 @@
"y":69.5
},
{
"gid":336,
"gid":338,
"height":12,
"id":55,
"name":"",
@@ -233,7 +233,7 @@
"y":62.1666666666667
},
{
"gid":341,
"gid":343,
"height":18,
"id":56,
"name":"",
@@ -245,7 +245,7 @@
"y":66
},
{
"gid":376,
"gid":378,
"height":28,
"id":69,
"name":"",
@@ -268,7 +268,7 @@
"name":"items",
"objects":[
{
"gid":357,
"gid":359,
"height":37,
"id":16,
"name":"",
@@ -280,7 +280,7 @@
"y":219
},
{
"gid":357,
"gid":359,
"height":37,
"id":17,
"name":"",
@@ -292,7 +292,7 @@
"y":248
},
{
"gid":358,
"gid":360,
"height":37,
"id":18,
"name":"",
@@ -304,7 +304,7 @@
"y":218
},
{
"gid":358,
"gid":360,
"height":37,
"id":19,
"name":"",
@@ -316,31 +316,7 @@
"y":250
},
{
"gid":359,
"height":79,
"id":20,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":44,
"x":30.5,
"y":302.5
},
{
"gid":360,
"height":76,
"id":21,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":38,
"x":246.5,
"y":301.5
},
{
"gid":171,
"gid":173,
"height":17,
"id":35,
"name":"",
@@ -352,7 +328,7 @@
"y":156.333333333333
},
{
"gid":171,
"gid":173,
"height":17,
"id":36,
"name":"",
@@ -364,7 +340,7 @@
"y":185
},
{
"gid":171,
"gid":173,
"height":17,
"id":37,
"name":"",
@@ -376,7 +352,7 @@
"y":152.333333333333
},
{
"gid":171,
"gid":173,
"height":17,
"id":38,
"name":"",
@@ -386,34 +362,9 @@
"width":14,
"x":295,
"y":182.333333333333
},
{
"gid":359,
"height":79,
"id":57,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":44,
"x":241,
"y":242
},
{
"gid":360,
"height":76,
"id":58,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":38,
"x":36,
"y":238
},
{
"gid":174,
"gid":176,
"height":21,
"id":64,
"name":"",
@@ -425,7 +376,7 @@
"y":45.6666666666667
},
{
"gid":176,
"gid":178,
"height":17,
"id":65,
"name":"",
@@ -435,9 +386,10 @@
"width":21,
"x":168.666666666667,
"y":34.6666666666666
},
},
{
"gid":175,
"gid":177,
"height":21,
"id":66,
"name":"",
@@ -449,7 +401,7 @@
"y":44.6666666666667
},
{
"gid":184,
"gid":186,
"height":21,
"id":67,
"name":"",
@@ -459,6 +411,54 @@
"width":16,
"x":89.6666666666667,
"y":42.3333333333333
},
{
"gid":426,
"height":75,
"id":76,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":29.5,
"y":240
},
{
"gid":428,
"height":75,
"id":77,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":27.5,
"y":302.5
},
{
"gid":430,
"height":75,
"id":78,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":225,
"y":239.5
},
{
"gid":424,
"height":75,
"id":79,
"name":"",
"rotation":0,
"type":"",
"visible":true,
"width":64,
"x":227,
"y":304
}],
"opacity":1,
"type":"objectgroup",
@@ -472,7 +472,7 @@
"name":"conditional_items",
"objects":[
{
"gid":121,
"gid":123,
"height":24,
"id":39,
"name":"",
@@ -484,7 +484,7 @@
"y":300
},
{
"gid":131,
"gid":133,
"height":21,
"id":40,
"name":"",
@@ -496,7 +496,7 @@
"y":77
},
{
"gid":242,
"gid":244,
"height":21,
"id":49,
"name":"",
@@ -508,7 +508,7 @@
"y":256
},
{
"gid":236,
"gid":238,
"height":21,
"id":50,
"name":"",
@@ -520,7 +520,7 @@
"y":255.5
},
{
"gid":230,
"gid":232,
"height":21,
"id":51,
"name":"",
@@ -532,7 +532,7 @@
"y":220.75
},
{
"gid":259,
"gid":261,
"height":17,
"id":52,
"name":"",
@@ -544,7 +544,7 @@
"y":221.5
},
{
"gid":308,
"gid":310,
"height":30,
"id":62,
"name":"",
@@ -556,7 +556,7 @@
"y":97.5
},
{
"gid":307,
"gid":309,
"height":33,
"id":63,
"name":"",
@@ -568,7 +568,7 @@
"y":95
},
{
"gid":364,
"gid":366,
"height":27,
"id":72,
"name":"",
@@ -597,7 +597,7 @@
"y":0
}],
"nextlayerid":11,
"nextobjectid":76,
"nextobjectid":80,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.11.2",
@@ -626,7 +626,7 @@
},
{
"columns":0,
"firstgid":121,
"firstgid":123,
"grid":
{
"height":1,
@@ -636,7 +636,7 @@
"margin":0,
"name":"objects",
"spacing":0,
"tilecount":278,
"tilecount":296,
"tileheight":359,
"tiles":[
{
@@ -2333,11 +2333,121 @@
"image":"..\/objects\/chair-white-1-rotate8.png",
"imageheight":32,
"imagewidth":32
},
{
"id":297,
"image":"..\/objects\/chair-white-1.aseprite",
"imageheight":32,
"imagewidth":32
},
{
"id":298,
"image":"..\/objects\/fingerprint_kit.png",
"imageheight":24,
"imagewidth":10
},
{
"id":299,
"image":"..\/objects\/fingerprint_small.png",
"imageheight":24,
"imagewidth":18
},
{
"id":300,
"image":"..\/objects\/notes5.png",
"imageheight":32,
"imagewidth":25
},
{
"id":301,
"image":"..\/objects\/plant-large11-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":302,
"image":"..\/objects\/plant-large11-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":303,
"image":"..\/objects\/plant-large11-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":304,
"image":"..\/objects\/plant-large11-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":305,
"image":"..\/objects\/plant-large12-top-ani1.png",
"imageheight":75,
"imagewidth":64
},
{
"id":306,
"image":"..\/objects\/plant-large12-top-ani2.png",
"imageheight":75,
"imagewidth":64
},
{
"id":307,
"image":"..\/objects\/plant-large12-top-ani3.png",
"imageheight":75,
"imagewidth":64
},
{
"id":308,
"image":"..\/objects\/plant-large12-top-ani4.png",
"imageheight":75,
"imagewidth":64
},
{
"id":309,
"image":"..\/objects\/plant-large12-top-ani5.png",
"imageheight":75,
"imagewidth":64
},
{
"id":310,
"image":"..\/objects\/plant-large13-top-ani1.png",
"imageheight":88,
"imagewidth":64
},
{
"id":311,
"image":"..\/objects\/plant-large13-top-ani2.png",
"imageheight":88,
"imagewidth":64
},
{
"id":312,
"image":"..\/objects\/plant-large13-top-ani3.png",
"imageheight":88,
"imagewidth":64
},
{
"id":313,
"image":"..\/objects\/plant-large13-top-ani4.png",
"imageheight":88,
"imagewidth":64
},
{
"id":314,
"image":"..\/objects\/workstation.png",
"imageheight":18,
"imagewidth":24
}],
"tilewidth":221
},
{
"firstgid":418,
"firstgid":438,
"source":"..\/..\/..\/assets\/rooms\/door_side_sheet_32.tsx"
}],
"tilewidth":32,

View File

@@ -11,6 +11,18 @@ body {
#game-container {
position: relative;
width: 100vw;
height: 100vh;
overflow: hidden;
background: #333;
}
/* Canvas styling for pixel-perfect rendering */
#game-container canvas {
image-rendering: pixelated;
image-rendering: -moz-crisp-edges;
image-rendering: crisp-edges;
display: block;
}
#loading {

View File

@@ -297,6 +297,23 @@ export function preload() {
this.load.image('chair-waiting-left-1', 'assets/objects/chair-waiting-left-1.png');
this.load.image('plant-large12', 'assets/objects/plant-large12.png');
this.load.image('plant-large11', 'assets/objects/plant-large11.png');
// Load animated plant frames
this.load.image('plant-large11-top-ani1', 'assets/objects/plant-large11-top-ani1.png');
this.load.image('plant-large11-top-ani2', 'assets/objects/plant-large11-top-ani2.png');
this.load.image('plant-large11-top-ani3', 'assets/objects/plant-large11-top-ani3.png');
this.load.image('plant-large11-top-ani4', 'assets/objects/plant-large11-top-ani4.png');
this.load.image('plant-large12-top-ani1', 'assets/objects/plant-large12-top-ani1.png');
this.load.image('plant-large12-top-ani2', 'assets/objects/plant-large12-top-ani2.png');
this.load.image('plant-large12-top-ani3', 'assets/objects/plant-large12-top-ani3.png');
this.load.image('plant-large12-top-ani4', 'assets/objects/plant-large12-top-ani4.png');
this.load.image('plant-large12-top-ani5', 'assets/objects/plant-large12-top-ani5.png');
this.load.image('plant-large13-top-ani1', 'assets/objects/plant-large13-top-ani1.png');
this.load.image('plant-large13-top-ani2', 'assets/objects/plant-large13-top-ani2.png');
this.load.image('plant-large13-top-ani3', 'assets/objects/plant-large13-top-ani3.png');
this.load.image('plant-large13-top-ani4', 'assets/objects/plant-large13-top-ani4.png');
this.load.image('pc1', 'assets/objects/pc1.png');
this.load.image('pc3', 'assets/objects/pc3.png');
this.load.image('pc4', 'assets/objects/pc4.png');
@@ -340,9 +357,7 @@ export function preload() {
frameHeight: 64
});
// Load displacement texture for plant sway effect
// Using an existing asset as displacement map for more interesting movement
this.load.image('wind_displacement', 'assets/objects/plant-large-displacement.png');
// Animated plant textures are loaded above
// Load swivel chair rotation images
this.load.image('chair-exec-rotate1', 'assets/objects/chair-exec-rotate1.png');
@@ -429,6 +444,44 @@ export function create() {
repeat: 0
});
// Create plant bump animations
this.anims.create({
key: 'plant-large11-bump',
frames: [
{ key: 'plant-large11-top-ani1' },
{ key: 'plant-large11-top-ani2' },
{ key: 'plant-large11-top-ani3' },
{ key: 'plant-large11-top-ani4' }
],
frameRate: 8,
repeat: 0
});
this.anims.create({
key: 'plant-large12-bump',
frames: [
{ key: 'plant-large12-top-ani1' },
{ key: 'plant-large12-top-ani2' },
{ key: 'plant-large12-top-ani3' },
{ key: 'plant-large12-top-ani4' },
{ key: 'plant-large12-top-ani5' }
],
frameRate: 8,
repeat: 0
});
this.anims.create({
key: 'plant-large13-bump',
frames: [
{ key: 'plant-large13-top-ani1' },
{ key: 'plant-large13-top-ani2' },
{ key: 'plant-large13-top-ani3' },
{ key: 'plant-large13-top-ani4' }
],
frameRate: 8,
repeat: 0
});
// Initialize rooms system after player exists
initializeRooms(this);
@@ -514,9 +567,9 @@ export function update() {
window.createPlayerBumpEffect();
}
// Check for plant sway effect when player walks near plants
if (window.createPlantSwayEffect) {
window.createPlantSwayEffect();
// Check for plant bump effect when player walks near animated plants
if (window.createPlantBumpEffect) {
window.createPlantBumpEffect();
}
// Update swivel chair rotation based on movement

View File

@@ -47,7 +47,7 @@ import { TILE_SIZE, DOOR_ALIGN_OVERLAP, GRID_SIZE, INTERACTION_RANGE_SQ, INTERAC
// Import the new system modules
import { initializeDoors, createDoorSpritesForRoom, checkDoorTransitions, updateDoorSpritesVisibility } from '../systems/doors.js';
import { initializeObjectPhysics, setupChairCollisions, setupExistingChairsWithNewRoom, calculateChairSpinDirection, updateSwivelChairRotation, updateSpriteDepth } from '../systems/object-physics.js';
import { initializePlayerEffects, createPlayerBumpEffect, createPlantSwayEffect } from '../systems/player-effects.js';
import { initializePlayerEffects, createPlayerBumpEffect, createPlantBumpEffect } from '../systems/player-effects.js';
import { initializeCollision, createWallCollisionBoxes, removeTilesUnderDoor, removeWallTilesForDoorInRoom, removeWallTilesAtWorldPosition } from '../systems/collision.js';
export let rooms = {};
@@ -442,7 +442,7 @@ export function createRoom(roomId, roomData, position) {
window.globalLayerCounter++;
const uniqueLayerId = `${roomId}_${layerData.name}_${window.globalLayerCounter}`;
const layer = map.createLayer(index, tilesets, position.x, position.y);
const layer = map.createLayer(index, tilesets, Math.round(position.x), Math.round(position.y));
if (layer) {
layer.name = uniqueLayerId;
// remove tiles under doors
@@ -711,8 +711,8 @@ export function createRoom(roomId, roomData, position) {
// Create sprite using the found item
const imageName = getImageNameFromObject(usedItem);
sprite = gameRef.add.sprite(
position.x + usedItem.x,
position.y + usedItem.y - usedItem.height,
Math.round(position.x + usedItem.x),
Math.round(position.y + usedItem.y - usedItem.height),
imageName
);
@@ -760,7 +760,7 @@ export function createRoom(roomId, roomData, position) {
attempts++;
} while (attempts < maxAttempts && isPositionOverlapping(randomX, randomY, roomId, TILE_SIZE));
sprite = gameRef.add.sprite(randomX, randomY, objType);
sprite = gameRef.add.sprite(Math.round(randomX), Math.round(randomY), objType);
console.log(`Created ${objType} at random position - no matching item found (attempts: ${attempts})`);
}
@@ -1007,10 +1007,10 @@ export function createRoom(roomId, roomData, position) {
if (imageName) {
console.log(`Creating object from ImageCollection: ${imageName} at (${obj.x}, ${obj.y})`);
// Create sprite at the object's position
// Create sprite at the object's position with pixel-perfect coordinates
const sprite = gameRef.add.sprite(
position.x + obj.x,
position.y + obj.y - obj.height, // Adjust for Tiled's coordinate system
Math.round(position.x + obj.x),
Math.round(position.y + obj.y - obj.height), // Adjust for Tiled's coordinate system
imageName
);
@@ -1057,25 +1057,33 @@ export function createRoom(roomId, roomData, position) {
}
// Check if this is a plant that can sway
if (imageName.startsWith('plant-large')) {
sprite.canSway = true;
// Check if this is an animated plant
if (imageName.startsWith('plant-large11-top-ani') ||
imageName.startsWith('plant-large12-top-ani') ||
imageName.startsWith('plant-large13-top-ani')) {
sprite.isAnimatedPlant = true;
sprite.originalScaleX = sprite.scaleX;
sprite.originalScaleY = sprite.scaleY;
sprite.originalX = sprite.x;
sprite.originalY = sprite.y;
sprite.originalWidth = sprite.width;
sprite.originalHeight = sprite.height;
sprite.originalSkewX = 0;
sprite.originalSkewY = 0;
sprite.originalX = Math.round(sprite.x); // Store pixel-perfect position
sprite.originalY = Math.round(sprite.y); // Store pixel-perfect position
sprite.originalWidth = Math.round(sprite.width);
sprite.originalHeight = Math.round(sprite.height);
// Add displacement FX for realistic sway effect
// Use a custom displacement texture for wind-like movement
sprite.preFX.addDisplacement('wind_displacement', 0.01, 0.01);
// Store reference to the displacement FX (it's the last added effect)
sprite.displacementFX = sprite.preFX.list[sprite.preFX.list.length - 1];
// Determine which animation to use based on the plant type
if (imageName.startsWith('plant-large11-top-ani')) {
sprite.animationKey = 'plant-large11-bump';
} else if (imageName.startsWith('plant-large12-top-ani')) {
sprite.animationKey = 'plant-large12-bump';
} else if (imageName.startsWith('plant-large13-top-ani')) {
sprite.animationKey = 'plant-large13-bump';
}
console.log(`Plant ${imageName} can sway with displacement FX`);
// Ensure the sprite is positioned on pixel boundaries
sprite.x = Math.round(sprite.x);
sprite.y = Math.round(sprite.y);
console.log(`Animated plant ${imageName} ready with animation ${sprite.animationKey}`);
}
// Set depth based on world Y position with elevation
@@ -1296,12 +1304,12 @@ export function createRoom(roomId, roomData, position) {
if (obj.name.toLowerCase().includes('collision') || obj.type === 'collision') {
console.log(`Creating collision object: ${obj.name} at (${obj.x}, ${obj.y})`);
// Create invisible collision body
// Create invisible collision body with pixel-perfect coordinates
const collisionBody = gameRef.add.rectangle(
position.x + obj.x + obj.width/2,
position.y + obj.y + obj.height/2,
obj.width,
obj.height
Math.round(position.x + obj.x + obj.width/2),
Math.round(position.y + obj.y + obj.height/2),
Math.round(obj.width),
Math.round(obj.height)
);
// Make it invisible but with collision

View File

@@ -74,12 +74,93 @@ function initializeGame() {
initializeUI();
initializeModals();
// Add window resize handler
window.addEventListener('resize', () => {
const width = window.innerWidth * 0.80;
const height = window.innerHeight * 0.80;
game.scale.resize(width, height);
});
// Calculate optimal integer scale factor for current browser window
const calculateOptimalScale = () => {
const container = document.getElementById('game-container');
if (!container) return 2; // Default fallback
const containerWidth = container.clientWidth;
const containerHeight = container.clientHeight;
// Base resolution
const baseWidth = 640;
const baseHeight = 480;
// Calculate scale factors for both dimensions
const scaleX = containerWidth / baseWidth;
const scaleY = containerHeight / baseHeight;
// Use the smaller scale to maintain aspect ratio
const maxScale = Math.min(scaleX, scaleY);
// Find the best integer scale factor (prefer 2x or higher for pixel art)
let bestScale = 2; // Minimum for good pixel art
// Check integer scales from 2x up to the maximum that fits
for (let scale = 2; scale <= Math.floor(maxScale); scale++) {
const scaledWidth = baseWidth * scale;
const scaledHeight = baseHeight * scale;
// If this scale fits within the container, use it
if (scaledWidth <= containerWidth && scaledHeight <= containerHeight) {
bestScale = scale;
} else {
break; // Stop at the largest scale that fits
}
}
return bestScale;
};
// Setup pixel-perfect rendering with optimal scaling
const setupPixelArt = () => {
if (game && game.canvas && game.scale) {
const canvas = game.canvas;
// Set pixel-perfect rendering
canvas.style.imageRendering = 'pixelated';
canvas.style.imageRendering = '-moz-crisp-edges';
canvas.style.imageRendering = 'crisp-edges';
// Calculate and apply optimal scale
const optimalScale = calculateOptimalScale();
game.scale.setZoom(optimalScale);
console.log(`Applied ${optimalScale}x scaling for pixel art`);
}
};
// Handle orientation changes and fullscreen
const handleOrientationChange = () => {
if (game && game.scale) {
setTimeout(() => {
game.scale.refresh();
const optimalScale = calculateOptimalScale();
game.scale.setZoom(optimalScale);
console.log(`Orientation change: Applied ${optimalScale}x scaling`);
}, 100);
}
};
// Handle window resize
const handleResize = () => {
if (game && game.scale) {
setTimeout(() => {
game.scale.refresh();
const optimalScale = calculateOptimalScale();
game.scale.setZoom(optimalScale);
console.log(`Resize: Applied ${optimalScale}x scaling`);
}, 16);
}
};
// Add event listeners
window.addEventListener('resize', handleResize);
window.addEventListener('orientationchange', handleOrientationChange);
document.addEventListener('fullscreenchange', handleOrientationChange);
// Initial setup
setTimeout(setupPixelArt, 100);
}
// Initialize when DOM is ready

View File

@@ -188,8 +188,8 @@ export function createPlayerBumpEffect() {
});
}
// Create plant sway effect when player walks through
export function createPlantSwayEffect() {
// Create plant animation effect when player bumps into animated plants
export function createPlantBumpEffect() {
if (!window.player) return;
const player = window.player;
@@ -200,64 +200,30 @@ export function createPlantSwayEffect() {
const isMoving = Math.abs(player.body.velocity.x) > 10 || Math.abs(player.body.velocity.y) > 10;
if (!isMoving) return;
// Check all rooms for plants
// Check all rooms for animated plants
Object.entries(rooms).forEach(([roomId, room]) => {
if (!room.objects) return;
Object.values(room.objects).forEach(obj => {
if (!obj.visible || !obj.canSway) return;
if (!obj.visible || !obj.isAnimatedPlant) return;
// Check if player is near the plant (within 40 pixels)
const distance = Phaser.Math.Distance.Between(currentX, currentY, obj.x + obj.width/2, obj.y + obj.height/2);
// Check if player is near the plant (within 40 pixels) with pixel-perfect coordinates
const plantCenterX = Math.round(obj.x + obj.width/2);
const plantCenterY = Math.round(obj.y + obj.height/2);
const distance = Phaser.Math.Distance.Between(Math.round(currentX), Math.round(currentY), plantCenterX, plantCenterY);
if (distance < 40 && !obj.isSwaying) {
obj.isSwaying = true;
if (distance < 40 && !obj.isAnimating) {
obj.isAnimating = true;
// Create sway effect using displacement FX
// This creates a realistic distortion effect while keeping the base stationary
const swayIntensity = 0.05; // Increased intensity for more dramatic motion
const swayDuration = Phaser.Math.Between(400, 600); // Half the time - much faster animation
// Play the plant animation using the stored animation key
obj.play(obj.animationKey);
// Calculate sway direction based on player position relative to plant
const playerDirection = currentX > obj.x + obj.width/2 ? 1 : -1;
const displacementX = playerDirection * swayIntensity;
const displacementY = (Math.random() - 0.5) * swayIntensity * 0.8; // More vertical movement
// Create a complex sway animation using displacement
const swayTween = gameRef.tweens.add({
targets: obj.displacementFX,
x: displacementX,
y: displacementY,
duration: swayDuration / 3,
ease: 'Sine.easeInOut',
yoyo: true,
onComplete: () => {
// Second sway phase with opposite direction
gameRef.tweens.add({
targets: obj.displacementFX,
x: -displacementX * 0.8, // More dramatic opposite movement
y: -displacementY * 0.8,
duration: swayDuration / 3,
ease: 'Sine.easeInOut',
yoyo: true,
onComplete: () => {
// Final settle phase - return to original state
gameRef.tweens.add({
targets: obj.displacementFX,
x: 0.01, // Slightly higher default displacement
y: 0.01, // Slightly higher default displacement
duration: swayDuration / 3,
ease: 'Sine.easeOut',
onComplete: () => {
obj.isSwaying = false;
}
});
}
});
}
// Reset animation flag when animation completes
obj.once('animationcomplete', () => {
obj.isAnimating = false;
});
console.log(`Plant ${obj.name} swaying with intensity ${swayIntensity}, direction ${playerDirection}`);
console.log(`Animated plant ${obj.name} bumped by player, playing ${obj.animationKey}`);
}
});
});
@@ -265,4 +231,4 @@ export function createPlantSwayEffect() {
// Export for global access
window.createPlayerBumpEffect = createPlayerBumpEffect;
window.createPlantSwayEffect = createPlantSwayEffect;
window.createPlantBumpEffect = createPlantBumpEffect;

View File

@@ -31,13 +31,25 @@ export const BLUETOOTH_SCAN_INTERVAL = 200; // Scan every 200ms for more respons
// Game configuration
export const GAME_CONFIG = {
type: Phaser.AUTO,
width: (window.innerWidth * 0.80) / 2, // Divide by 4 for 4x scale
height: (window.innerHeight * 0.80) / 2, // Divide by 4 for 4x scale
width: 640, // Classic pixel art base resolution (scales cleanly: 1x=320, 2x=640, 3x=960, 4x=1280)
height: 480, // Classic pixel art base resolution (scales cleanly: 1x=240, 2x=480, 3x=720, 4x=960)
parent: 'game-container',
pixelArt: true,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH
mode: Phaser.Scale.ENVELOP, // Fill entire container while maintaining aspect ratio
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 640,
height: 480,
// Minimum size to ensure playability
min: {
width: 320,
height: 240
},
// Maximum size to prevent excessive scaling
max: {
width: 2560,
height: 1920
},
},
render: {
pixelArt: true,