diff --git a/assets/fx/chop.mp3 b/assets/fx/chop.mp3 new file mode 100644 index 0000000..38122cf Binary files /dev/null and b/assets/fx/chop.mp3 differ diff --git a/assets/fx/inventory.mp3 b/assets/fx/inventory.mp3 new file mode 100644 index 0000000..5b171f5 Binary files /dev/null and b/assets/fx/inventory.mp3 differ diff --git a/assets/fx/zip.mp3 b/assets/fx/zip.mp3 new file mode 100644 index 0000000..2511304 Binary files /dev/null and b/assets/fx/zip.mp3 differ diff --git a/assets/game-map.json b/assets/game-map.json index 33d9f08..354f031 100644 --- a/assets/game-map.json +++ b/assets/game-map.json @@ -1,440 +1,162 @@ -{ "compressionlevel":-1, - "height":40, - "infinite":true, - "layers":[ - { - "chunks":[ - { - "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, 5, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, 5, 5, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 5, 5, 4, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, 4, 4, 2], - "height":16, - "width":16, - "x":0, - "y":0 - }, - { - "data":[1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 17, 17, 17, 17, 17, - 1, 1, 1, 1, 1, 1, 3, 3, 17, 17, 17, 17, 15, 15, 15, 15, - 1, 1, 1, 1, 1, 3, 3, 17, 17, 17, 17, 17, 17, 17, 15, 15, - 1, 1, 3, 3, 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, - 3, 3, 3, 3, 3, 3, 13, 13, 13, 17, 17, 17, 17, 17, 17, 17, - 3, 3, 3, 3, 13, 13, 13, 13, 13, 2, 2, 2, 2, 17, 17, 17, - 3, 3, 3, 3, 13, 13, 13, 13, 2, 2, 2, 2, 2, 2, 17, 17, - 3, 3, 3, 5, 13, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], - "height":16, - "width":16, - "x":16, - "y":0 - }, - { - "data":[17, 17, 17, 17, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, - 15, 15, 15, 17, 17, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, - 15, 15, 15, 15, 17, 17, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, - 15, 15, 15, 15, 15, 17, 13, 13, 13, 5, 5, 5, 6, 6, 6, 6, - 15, 15, 15, 15, 17, 17, 13, 13, 13, 13, 13, 13, 5, 5, 6, 6, - 17, 17, 17, 17, 17, 17, 13, 2, 2, 2, 2, 13, 13, 5, 5, 6, - 17, 17, 17, 17, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 5, 5, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 5, 5, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 5, 5, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 14, 14, 14, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 14, 14, 15, 15, 14], - "height":16, - "width":16, - "x":32, - "y":0 - }, - { - "data":[7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 0, 0, 0, 0, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 0, 0, 0, 0, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 2, 0, 0, 0, 0, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 2, 0, 0, 0, 0, - 6, 7, 7, 7, 7, 7, 7, 7, 6, 6, 2, 2, 0, 0, 0, 0, - 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 2, 2, 0, 0, 0, 0, - 6, 6, 7, 7, 7, 7, 7, 6, 7, 7, 2, 2, 0, 0, 0, 0, - 6, 6, 6, 6, 7, 7, 6, 6, 7, 7, 2, 2, 0, 0, 0, 0, - 5, 6, 6, 6, 6, 6, 6, 8, 7, 7, 2, 2, 0, 0, 0, 0, - 5, 5, 6, 6, 6, 16, 8, 8, 8, 2, 2, 2, 0, 0, 0, 0, - 5, 5, 16, 16, 16, 16, 8, 8, 8, 2, 2, 2, 0, 0, 0, 0, - 13, 16, 16, 16, 16, 16, 8, 8, 2, 2, 2, 2, 0, 0, 0, 0, - 13, 16, 16, 16, 17, 17, 8, 2, 2, 2, 2, 2, 0, 0, 0, 0, - 13, 13, 16, 17, 17, 15, 15, 2, 2, 2, 2, 2, 0, 0, 0, 0, - 13, 13, 17, 17, 17, 15, 15, 12, 12, 12, 2, 2, 0, 0, 0, 0, - 14, 13, 17, 17, 15, 15, 15, 12, 11, 12, 12, 12, 0, 0, 0, 0], - "height":16, - "width":16, - "x":48, - "y":0 - }, - { - "data":[1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 5, 4, 4, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, 4, 4, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 5, 4, 4, 4, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 3, 5, 4, 4, 4, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, 5, 4, 4, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 5, 5, 4, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 3, 3, 5, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 12, 3, 3, 5, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 12, 12, 3, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 12, 12, 3, - 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 12, 12, 12, - 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, 12, 12, - 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 12, 12, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 11, 11, 11], - "height":16, - "width":16, - "x":0, - "y":16 - }, - { - "data":[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 5, 4, 4, 4, 2, 2, 2, 2, 5, 5, 5, 5, 5, 5, 5, 2, - 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 5, 2, - 3, 5, 5, 5, 5, 3, 3, 3, 12, 12, 12, 12, 12, 3, 5, 5, - 12, 3, 3, 3, 3, 3, 12, 12, 11, 11, 11, 11, 12, 12, 3, 3, - 12, 12, 3, 3, 12, 12, 11, 11, 11, 11, 11, 12, 12, 12, 3, 3, - 12, 12, 12, 12, 12, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 3, - 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, - 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11], - "height":16, - "width":16, - "x":16, - "y":16 - }, - { - "data":[2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, 14, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 14, 14, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 14, 15, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 14, 13, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 14, 14, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 14, 15, 15, 15, 15, - 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 14, 14, 14, 14, 14, - 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 13, 13, 3, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 13, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 13, 13, 3, 3, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 3, 2, 3, 3, 3, 1, 1, 1, 1, 1, - 3, 3, 2, 2, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, - 12, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 3, 11, 11, 11, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 11, 11, 11, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - "height":16, - "width":16, - "x":32, - "y":16 - }, - { - "data":[14, 14, 17, 17, 15, 15, 15, 12, 11, 11, 11, 11, 0, 0, 0, 0, - 15, 14, 14, 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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], - "height":16, - "width":16, - "x":32, - "y":32 - }, - { - "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 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], - "height":16, - "width":16, - "x":48, - "y":32 - }], - "height":48, - "id":1, - "name":"main", - "opacity":1, - "startx":0, - "starty":0, - "type":"tilelayer", - "visible":true, - "width":64, - "x":0, - "y":0 - }], - "nextlayerid":2, - "nextobjectid":1, - "orientation":"orthogonal", - "renderorder":"right-down", +{ "columns":10, + "image":"images\/terrain.png", + "imageheight":1000, + "imagewidth":1000, + "margin":0, + "name":"terrain", + "spacing":0, + "tilecount":100, "tiledversion":"1.11.2", "tileheight":100, - "tilesets":[ + "tiles":[ { - "columns":10, - "firstgid":1, - "image":"images\/terrain.png", - "imageheight":1000, - "imagewidth":1000, - "margin":0, - "name":"terrain", - "spacing":0, - "tilecount":100, - "tileheight":100, - "tiles":[ + "id":0, + "properties":[ { - "id":0, - "properties":[ - { - "name":"collides", - "type":"bool", - "value":true - }] + "name":"collides", + "type":"bool", + "value":true + }] + }, + { + "id":1, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":40 + }] + }, + { + "id":2, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":2 + }] + }, + { + "id":3, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":5 }, { - "id":1, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":40 - }] + "name":"palmTree", + "type":"int", + "value":2 + }] + }, + { + "id":4, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":0 + }] + }, + { + "id":7, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":8 + }] + }, + { + "id":8, + "properties":[ + { + "name":"forestTree", + "type":"int", + "value":15 }, { - "id":2, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":2 - }] + "name":"palmTree", + "type":"int", + "value":2 + }] + }, + { + "id":10, + "properties":[ + { + "name":"fish", + "type":"int", + "value":6 }, { - "id":3, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":5 - }, - { - "name":"palmTree", - "type":"int", - "value":2 - }] + "name":"palmTree", + "type":"int", + "value":15 }, { - "id":4, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":0 - }] + "name":"rock", + "type":"int", + "value":6 }, { - "id":7, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":8 - }] + "name":"seaShell", + "type":"int", + "value":8 + }] + }, + { + "id":11, + "properties":[ + { + "name":"palmTree", + "type":"int", + "value":10 + }] + }, + { + "id":12, + "properties":[ + { + "name":"boulder", + "type":"int", + "value":2 + }] + }, + { + "id":13, + "properties":[ + { + "name":"boulder", + "type":"int", + "value":8 + }] + }, + { + "id":14, + "properties":[ + { + "name":"boulder", + "type":"int", + "value":20 + }] + }, + { + "id":16, + "properties":[ + { + "name":"boulder", + "type":"int", + "value":15 }, { - "id":8, - "properties":[ - { - "name":"forestTree", - "type":"int", - "value":15 - }, - { - "name":"palmTree", - "type":"int", - "value":2 - }] - }, - { - "id":10, - "properties":[ - { - "name":"palmTree", - "type":"int", - "value":15 - }] - }, - { - "id":11, - "properties":[ - { - "name":"palmTree", - "type":"int", - "value":10 - }] - }, - { - "id":12, - "properties":[ - { - "name":"boulder", - "type":"int", - "value":2 - }] - }, - { - "id":13, - "properties":[ - { - "name":"boulder", - "type":"int", - "value":8 - }] - }, - { - "id":14, - "properties":[ - { - "name":"boulder", - "type":"int", - "value":20 - }] - }, - { - "id":16, - "properties":[ - { - "name":"boulder", - "type":"int", - "value":15 - }, - { - "name":"forestTree", - "type":"int", - "value":2 - }] - }], - "tilewidth":100 + "name":"forestTree", + "type":"int", + "value":2 + }] }], "tilewidth":100, - "type":"map", - "version":"1.10", - "width":60 + "type":"tileset", + "version":"1.10" } \ No newline at end of file diff --git a/assets/images/logo.png b/assets/images/logo.png new file mode 100644 index 0000000..c8d3b0d Binary files /dev/null and b/assets/images/logo.png differ diff --git a/assets/images/objects.png b/assets/images/objects.png index 05f7d4b..d7ecea7 100644 Binary files a/assets/images/objects.png and b/assets/images/objects.png differ diff --git a/assets/music/menuMusic.mp3 b/assets/music/menuMusic.mp3 new file mode 100644 index 0000000..23e56aa Binary files /dev/null and b/assets/music/menuMusic.mp3 differ diff --git a/assets/videos/mainMenu.mp4 b/assets/videos/mainMenu.mp4 new file mode 100644 index 0000000..4170db2 Binary files /dev/null and b/assets/videos/mainMenu.mp4 differ diff --git a/index.html b/index.html index 49a97d2..2e77851 100644 --- a/index.html +++ b/index.html @@ -5,20 +5,8 @@ Fablewood - Survival Crafting Game diff --git a/raw/game-map.tmx b/raw/game-map.tmx index 9980f79..5a23e86 100644 --- a/raw/game-map.tmx +++ b/raw/game-map.tmx @@ -44,7 +44,10 @@ + + + diff --git a/raw/objects.psd b/raw/objects.psd index 7b69c0b..d9a1cb7 100644 Binary files a/raw/objects.psd and b/raw/objects.psd differ diff --git a/src/main.js b/src/main.js index 557df2e..30579e4 100644 --- a/src/main.js +++ b/src/main.js @@ -1,11 +1,14 @@ import { Game } from './scenes/Game.js'; +import { MenuScene } from './scenes/MenuScene.js'; const config = { type: Phaser.AUTO, scale: { - mode: Phaser.Scale.RESIZE, + mode: Phaser.Scale.FIT, + autoCenter: Phaser.Scale.CENTER_BOTH, width: 1280, height: 720, + parent: 'game-container' }, physics: { default: 'arcade', @@ -17,7 +20,7 @@ const config = { }, backgroundColor: '#000000', scene: [ - // MenuScene, + MenuScene, // Intro, // Tutorial, Game diff --git a/src/objects.js b/src/objects.js index 8b64c51..5df819e 100644 --- a/src/objects.js +++ b/src/objects.js @@ -32,9 +32,7 @@ export class ObjectManager { const objectType = tile.properties; Object.keys(objectType).forEach(key => { - const rand = Phaser.Math.Between(1,300); - - if (key === 'palmTree' && rand <= objectType[key]) { + if (key === 'palmTree' && Phaser.Math.Between(1,300) <= objectType[key]) { const palmTree = this.scene.physics.add.sprite(x, y, 'objects', 0); this.scene.objects.add(palmTree); palmTree.setImmovable(true).setSize(60,100); @@ -47,7 +45,7 @@ export class ObjectManager { doneSprite: 10 }; this.createHealthBar(palmTree); - } else if (key === 'forestTree' && rand <= objectType[key]) { + } else if (key === 'forestTree' && Phaser.Math.Between(1,300) <= objectType[key]) { const forestRand = Phaser.Math.Between(1,4); const forestTree = this.scene.physics.add.sprite(x, y, 'objects', forestRand); this.scene.objects.add(forestTree); @@ -61,7 +59,7 @@ export class ObjectManager { doneSprite: 11 }; this.createHealthBar(forestTree); - } else if (key === 'boulder' && rand <= objectType[key]) { + } else if (key === 'boulder' && Phaser.Math.Between(1,300) <= objectType[key]) { const boulder = this.scene.physics.add.sprite(x, y, 'objects', 20); this.scene.objects.add(boulder); boulder.setImmovable(true); @@ -74,6 +72,19 @@ export class ObjectManager { doneSprite: null }; this.createHealthBar(boulder); + } else if (key === 'seaShell' && Phaser.Math.Between(1,300) <= objectType[key]) { + const item = this.scene.physics.add.sprite(x, y, 'objects', 5); + this.scene.objects.add(item); + item.setImmovable(true); + item.props = { + type: key, + health: 1, + fullHealth: 1, + yield: 'seaShell', + amount: [1,1], + doneSprite: null + }; + this.createHealthBar(item); } }); @@ -148,9 +159,11 @@ export class ObjectManager { switch (object.props.type){ case 'palmTree': object.props.health -= dmg; + this.scene.sound.play('chop'); break; case 'forestTree': object.props.health -= dmg; + this.scene.sound.play('chop'); break; default: } diff --git a/src/scenes/Game.js b/src/scenes/Game.js index 23a1373..8d3d2d7 100644 --- a/src/scenes/Game.js +++ b/src/scenes/Game.js @@ -26,8 +26,10 @@ export class Game extends Phaser.Scene { this.load.image('terrain-tileset', 'assets/images/terrain.png'); this.load.image('backpack', 'assets/images/backpack.png'); - // Fonts - this.load.font('eraserDust', 'assets/fonts/EraserDust.ttf'); + // FX + this.load.audio('chop', 'assets/fx/chop.mp3'); + this.load.audio('zip', 'assets/fx/zip.mp3'); + this.load.audio('inventory', 'assets/fx/inventory.mp3'); // Music this.load.audio('bgMusic', 'assets/music/bgMusic.mp3'); @@ -76,12 +78,14 @@ export class Game extends Phaser.Scene { player.stop(); this.inventoryManager.addItem(item); const cam = this.cameras.main.worldView; + this.sound.play('zip'); this.tweens.add({ targets: item, x: cam.x+cam.width-150, y: cam.y+cam.height-150, duration: 500, onComplete: () => { + this.sound.play('inventory'); item.destroy(); } }); diff --git a/src/scenes/MenuScene.js b/src/scenes/MenuScene.js new file mode 100644 index 0000000..7be76cf --- /dev/null +++ b/src/scenes/MenuScene.js @@ -0,0 +1,161 @@ +export class MenuScene extends Phaser.Scene { + constructor() { + super({ key: 'MenuScene' }); + } + + preload() { + // Images + this.load.image('logo', 'assets/images/logo.png'); + + // Fonts + this.load.font('eraserDust', 'assets/fonts/EraserDust.ttf'); + + // Videos + this.load.video('mainMenu', 'assets/videos/mainMenu.mp4'); + + // Music + this.load.audio('menuMusic', 'assets/music/menuMusic.mp3'); + } + + create() { + // Add typing text + const fullText = "Yet Another AAA Fertig Game...."; + const typingText = new TypingText(this, + this.game.config.width / 2, + this.game.config.height / 2, + fullText, + { + fontFamily: 'eraserDust, Arial', + fontSize: '32px', + color: '#ffffff', + align: 'center' + } + ); + + // Start typing animation + this.time.delayedCall(1000, () => { + typingText.startTyping(); + }); + + // Maun Menu + this.time.delayedCall(7300, () => { + // Play mainMenu video on loop and stretch to fill background + this.mainMenuVideo = this.add.video(0, 0, 'mainMenu'); + this.mainMenuVideo.setOrigin(0); + this.mainMenuVideo.scaleX = this.scale.width / 1280; + this.mainMenuVideo.scaleY = this.scale.height / 720; + this.mainMenuVideo.play(true); + const logo = this.physics.add.image(610, 225, 'logo').setScale(0).setOrigin(0.5); + this.tweens.add({ + targets: logo, + angle: 360, + scale: .65, + duration: 3500, + ease: 'Bounce', + onComplete: () => { + this.tweens.add({ + targets: logo, + scale: .7, + y: 250, + yoyo: true, + repeat: -1, + duration: 3000 + }); + const typingText2 = new TypingText(this, + this.game.config.width / 2, + this.game.config.height / 2 + 150, + "Use Mouse to Control your Character", + { + fontFamily: 'eraserDust, Arial', + fontSize: '32px', + color: '#ffffff', + align: 'center' + } + ); + typingText2.startTyping(); + const typingText3 = new TypingText(this, + this.game.config.width / 2, + this.game.config.height / 2 + 200, + "Click Here to Start", + { + fontFamily: 'eraserDust, Arial', + fontSize: '32px', + color: '#ffffff', + align: 'center' + } + ); + typingText3.startTyping(); + + // Add click handler to start game + typingText3.typingText.setInteractive({ useHandCursor: true }); + typingText3.typingText.on('pointerdown', () => { + // Stop video and music + if (this.mainMenuVideo) { + this.mainMenuVideo.stop(); + } + if (this.bgMusic) { + this.bgMusic.stop(); + } + + // Start Game scene + this.scene.start('Game'); + }); + } + }); + }); + + // Background Music + this.bgMusic = this.sound.add('menuMusic', { volume: 0.5 }); + this.bgMusic.loop = true; + this.bgMusic.play(); + } + + update(time, delta) { + + } +} + +// Typing text class implementation +class TypingText { + constructor(scene, x, y, text, style = {}) { + this.scene = scene; + this.x = x; + this.y = y; + this.text = text; + this.style = style; + this.fullText = text; + + // Create empty text object + this.typingText = scene.add.text(x, y, '', style).setShadow(3,3, '#333', 5); + this.typingText.setOrigin(0.5); + + // Animation properties + this.currentCharIndex = 0; + this.isTyping = false; + this.typingDelay = 100; // milliseconds per character + } + + startTyping() { + if (this.isTyping) return; + + this.isTyping = true; + this.currentCharIndex = 0; + + // Clear existing text and start typing animation + this.typingText.setText(''); + + const typeCharacter = () => { + if (this.currentCharIndex < this.fullText.length) { + this.typingText.text += this.fullText.charAt(this.currentCharIndex); + this.currentCharIndex++; + + // Schedule next character + setTimeout(typeCharacter, this.typingDelay); + } else { + this.isTyping = false; + } + }; + + typeCharacter(); + } +} \ No newline at end of file