From 772a5cc7e01976dc9383e069d84110efba3992cc Mon Sep 17 00:00:00 2001 From: Martin Date: Thu, 1 Dec 2022 12:16:52 +0100 Subject: [PATCH] Diagonal projectile launcher --- assets/Data/GameSettings.json | 14 +- assets/Scenes/scene.scene | 618 ++++++++++-------- assets/Scripts/Game/Data/GameSettings.ts | 5 +- assets/Scripts/Game/GameBootstrapper.ts | 26 +- ...eLauncher.ts => WaveProjectileLauncher.ts} | 6 +- ...ts.meta => WaveProjectileLauncher.ts.meta} | 2 +- assets/Scripts/Game/Upgrades/Upgrader.ts | 4 +- 7 files changed, 381 insertions(+), 294 deletions(-) rename assets/Scripts/Game/Unit/Player/ProjectileLauncher/{HorizontalProjectileLauncher.ts => WaveProjectileLauncher.ts} (82%) rename assets/Scripts/Game/Unit/Player/ProjectileLauncher/{HorizontalProjectileLauncher.ts.meta => WaveProjectileLauncher.ts.meta} (70%) diff --git a/assets/Data/GameSettings.json b/assets/Data/GameSettings.json index 4b9e79d..ef92bcb 100644 --- a/assets/Data/GameSettings.json +++ b/assets/Data/GameSettings.json @@ -30,7 +30,17 @@ "cooldown": 10 } }, - "xyLaunchers": { + "horizontalLauncher": { + "wavesToShootPerUpgrade": 1, + "launcher": { + "projectileLifetime": 3, + "projectileSpeed": 300, + "wavesToShoot": 0, + "wavesDelayMs": 100, + "cooldown": 4 + } + }, + "diagonalLauncher": { "wavesToShootPerUpgrade": 1, "launcher": { "projectileLifetime": 20, @@ -45,7 +55,7 @@ "maxWeaponLengthUpgrades": 5, "maxWeaponDamageUpgrades": 5, "maxHorizontalProjectileUpgrades": 0, - "maxVerticalProjectileUpgrades": 0, + "maxDiagonalProjectileUpgrades": 0, "maxHaloProjectileUpgrades": 5, "maxRegenerationUpgrades": 5 } diff --git a/assets/Scenes/scene.scene b/assets/Scenes/scene.scene index 4215b00..0ab852f 100644 --- a/assets/Scenes/scene.scene +++ b/assets/Scenes/scene.scene @@ -21,11 +21,11 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 118 + "__id__": 120 }, "autoReleaseAssets": false, "_globals": { - "__id__": 119 + "__id__": 121 }, "_id": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f" }, @@ -47,25 +47,28 @@ "__id__": 7 }, { - "__id__": 57 + "__id__": 9 }, { - "__id__": 63 + "__id__": 59 + }, + { + "__id__": 65 } ], "_active": true, "_components": [ - { - "__id__": 114 - }, - { - "__id__": 115 - }, { "__id__": 116 }, { "__id__": 117 + }, + { + "__id__": 118 + }, + { + "__id__": 119 } ], "_prefab": null, @@ -157,7 +160,7 @@ }, { "__type__": "cc.Node", - "_name": "VerticalProjectileLauncher", + "_name": "HorizontalProjectileLauncher", "_objFlags": 0, "_parent": { "__id__": 2 @@ -213,6 +216,64 @@ }, "_id": "baKVJ/0StLq68KXHTAnJfR" }, + { + "__type__": "cc.Node", + "_name": "DiagonalProjectileLauncher", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 8 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0, + "w": 1 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_id": "8fYTRtNLhAoZ0sqimC3wAp" + }, + { + "__type__": "e3d066A8exFBaWWn2gx4c4j", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "__prefab": null, + "projectilePrefab": { + "__uuid__": "ff0be112-7028-424c-87b8-fc54a106015a", + "__expectedType__": "cc.Prefab" + }, + "_id": "cb9igS0YNCNqD6RDXRC51W" + }, { "__type__": "cc.Node", "_name": "Player", @@ -222,25 +283,25 @@ }, "_children": [ { - "__id__": 8 + "__id__": 10 }, { - "__id__": 23 + "__id__": 25 } ], "_active": true, "_components": [ - { - "__id__": 53 - }, - { - "__id__": 54 - }, { "__id__": 55 }, { "__id__": 56 + }, + { + "__id__": 57 + }, + { + "__id__": 58 } ], "_prefab": null, @@ -277,20 +338,20 @@ "_name": "PlayerUI", "_objFlags": 0, "_parent": { - "__id__": 7 + "__id__": 9 }, "_children": [ { - "__id__": 9 + "__id__": 11 } ], "_active": true, "_components": [ { - "__id__": 21 + "__id__": 23 }, { - "__id__": 22 + "__id__": 24 } ], "_prefab": null, @@ -327,23 +388,23 @@ "_name": "PlayerHealthUI", "_objFlags": 0, "_parent": { - "__id__": 8 + "__id__": 10 }, "_children": [ { - "__id__": 10 + "__id__": 12 }, { - "__id__": 13 + "__id__": 15 } ], "_active": true, "_components": [ { - "__id__": 19 + "__id__": 21 }, { - "__id__": 20 + "__id__": 22 } ], "_prefab": null, @@ -380,16 +441,16 @@ "_name": "Background", "_objFlags": 0, "_parent": { - "__id__": 9 + "__id__": 11 }, "_children": [], "_active": true, "_components": [ { - "__id__": 11 + "__id__": 13 }, { - "__id__": 12 + "__id__": 14 } ], "_prefab": null, @@ -426,7 +487,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 10 + "__id__": 12 }, "_enabled": true, "__prefab": null, @@ -447,7 +508,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 10 + "__id__": 12 }, "_enabled": true, "__prefab": null, @@ -485,20 +546,20 @@ "_name": "HpBar", "_objFlags": 0, "_parent": { - "__id__": 9 + "__id__": 11 }, "_children": [ { - "__id__": 14 + "__id__": 16 } ], "_active": true, "_components": [ { - "__id__": 17 + "__id__": 19 }, { - "__id__": 18 + "__id__": 20 } ], "_prefab": null, @@ -535,16 +596,16 @@ "_name": "MovableBar", "_objFlags": 0, "_parent": { - "__id__": 13 + "__id__": 15 }, "_children": [], "_active": true, "_components": [ { - "__id__": 15 + "__id__": 17 }, { - "__id__": 16 + "__id__": 18 } ], "_prefab": null, @@ -581,7 +642,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 14 + "__id__": 16 }, "_enabled": true, "__prefab": null, @@ -602,7 +663,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 14 + "__id__": 16 }, "_enabled": true, "__prefab": null, @@ -640,7 +701,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 13 + "__id__": 15 }, "_enabled": true, "__prefab": null, @@ -661,12 +722,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 13 + "__id__": 15 }, "_enabled": true, "__prefab": null, "_barSprite": { - "__id__": 16 + "__id__": 18 }, "_mode": 0, "_totalLength": 80, @@ -679,7 +740,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 9 + "__id__": 11 }, "_enabled": true, "__prefab": null, @@ -700,12 +761,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 9 + "__id__": 11 }, "_enabled": true, "__prefab": null, "healthBar": { - "__id__": 18 + "__id__": 20 }, "_id": "8doWxm45ZCKLqr0rVRHJa2" }, @@ -714,7 +775,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 8 + "__id__": 10 }, "_enabled": true, "__prefab": null, @@ -735,12 +796,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 8 + "__id__": 10 }, "_enabled": true, "__prefab": null, "healthUI": { - "__id__": 20 + "__id__": 22 }, "_id": "49hVDAypRMuoVp+F+IPkXM" }, @@ -749,17 +810,17 @@ "_name": "Weapon", "_objFlags": 0, "_parent": { - "__id__": 7 + "__id__": 9 }, "_children": [ { - "__id__": 24 + "__id__": 26 } ], "_active": true, "_components": [ { - "__id__": 52 + "__id__": 54 } ], "_prefab": null, @@ -796,38 +857,38 @@ "_name": "AnimatedWeapon", "_objFlags": 0, "_parent": { - "__id__": 23 + "__id__": 25 }, "_children": [ { - "__id__": 25 + "__id__": 27 }, { - "__id__": 29 + "__id__": 31 }, { - "__id__": 33 + "__id__": 35 }, { - "__id__": 37 + "__id__": 39 }, { - "__id__": 41 + "__id__": 43 }, { - "__id__": 45 + "__id__": 47 } ], "_active": true, "_components": [ - { - "__id__": 49 - }, - { - "__id__": 50 - }, { "__id__": 51 + }, + { + "__id__": 52 + }, + { + "__id__": 53 } ], "_prefab": null, @@ -864,19 +925,19 @@ "_name": "WeaponCollider", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 26 - }, - { - "__id__": 27 - }, { "__id__": 28 + }, + { + "__id__": 29 + }, + { + "__id__": 30 } ], "_prefab": null, @@ -913,7 +974,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 25 + "__id__": 27 }, "_enabled": true, "__prefab": null, @@ -934,7 +995,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 25 + "__id__": 27 }, "_enabled": true, "__prefab": null, @@ -972,7 +1033,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 25 + "__id__": 27 }, "_enabled": true, "__prefab": null, @@ -999,19 +1060,19 @@ "_name": "WeaponCollider-001", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 30 - }, - { - "__id__": 31 - }, { "__id__": 32 + }, + { + "__id__": 33 + }, + { + "__id__": 34 } ], "_prefab": null, @@ -1048,7 +1109,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 29 + "__id__": 31 }, "_enabled": true, "__prefab": null, @@ -1069,7 +1130,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 29 + "__id__": 31 }, "_enabled": true, "__prefab": null, @@ -1107,7 +1168,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 29 + "__id__": 31 }, "_enabled": true, "__prefab": null, @@ -1134,19 +1195,19 @@ "_name": "WeaponCollider-002", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 34 - }, - { - "__id__": 35 - }, { "__id__": 36 + }, + { + "__id__": 37 + }, + { + "__id__": 38 } ], "_prefab": null, @@ -1183,7 +1244,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1204,7 +1265,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1242,7 +1303,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 35 }, "_enabled": true, "__prefab": null, @@ -1269,19 +1330,19 @@ "_name": "WeaponCollider-003", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 38 - }, - { - "__id__": 39 - }, { "__id__": 40 + }, + { + "__id__": 41 + }, + { + "__id__": 42 } ], "_prefab": null, @@ -1318,7 +1379,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 37 + "__id__": 39 }, "_enabled": true, "__prefab": null, @@ -1339,7 +1400,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 37 + "__id__": 39 }, "_enabled": true, "__prefab": null, @@ -1377,7 +1438,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 37 + "__id__": 39 }, "_enabled": true, "__prefab": null, @@ -1404,19 +1465,19 @@ "_name": "WeaponCollider-004", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 42 - }, - { - "__id__": 43 - }, { "__id__": 44 + }, + { + "__id__": 45 + }, + { + "__id__": 46 } ], "_prefab": null, @@ -1453,7 +1514,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 41 + "__id__": 43 }, "_enabled": true, "__prefab": null, @@ -1474,7 +1535,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 41 + "__id__": 43 }, "_enabled": true, "__prefab": null, @@ -1512,7 +1573,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 41 + "__id__": 43 }, "_enabled": true, "__prefab": null, @@ -1539,19 +1600,19 @@ "_name": "WeaponCollider-005", "_objFlags": 0, "_parent": { - "__id__": 24 + "__id__": 26 }, "_children": [], "_active": true, "_components": [ - { - "__id__": 46 - }, - { - "__id__": 47 - }, { "__id__": 48 + }, + { + "__id__": 49 + }, + { + "__id__": 50 } ], "_prefab": null, @@ -1588,7 +1649,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 45 + "__id__": 47 }, "_enabled": true, "__prefab": null, @@ -1609,7 +1670,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 45 + "__id__": 47 }, "_enabled": true, "__prefab": null, @@ -1647,7 +1708,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 45 + "__id__": 47 }, "_enabled": true, "__prefab": null, @@ -1674,7 +1735,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 24 + "__id__": 26 }, "_enabled": true, "__prefab": null, @@ -1695,7 +1756,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 24 + "__id__": 26 }, "_enabled": true, "__prefab": null, @@ -1717,28 +1778,28 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 24 + "__id__": 26 }, "_enabled": true, "__prefab": null, "colliders": [ { - "__id__": 28 + "__id__": 30 }, { - "__id__": 32 + "__id__": 34 }, { - "__id__": 36 + "__id__": 38 }, { - "__id__": 40 + "__id__": 42 }, { - "__id__": 44 + "__id__": 46 }, { - "__id__": 48 + "__id__": 50 } ], "_id": "efTecDVf5IyZOD5/n+1DG7" @@ -1748,15 +1809,15 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 23 + "__id__": 25 }, "_enabled": true, "__prefab": null, "weaponAnimation": { - "__id__": 50 + "__id__": 52 }, "upgradableCollider": { - "__id__": 51 + "__id__": 53 }, "_id": "femtdMmA5Ax5K78hjELCcD" }, @@ -1765,7 +1826,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 7 + "__id__": 9 }, "_enabled": true, "__prefab": null, @@ -1786,7 +1847,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 7 + "__id__": 9 }, "_enabled": true, "__prefab": null, @@ -1824,19 +1885,19 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 7 + "__id__": 9 }, "_enabled": true, "__prefab": null, "speed": 100, "collider": { - "__id__": 56 + "__id__": 58 }, "playerUI": { - "__id__": 22 + "__id__": 24 }, "weapon": { - "__id__": 52 + "__id__": 54 }, "_id": "5aDEGDNWpIaL+U2iIxK4vA" }, @@ -1845,7 +1906,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 7 + "__id__": 9 }, "_enabled": true, "__prefab": null, @@ -1876,16 +1937,16 @@ }, "_children": [ { - "__id__": 58 + "__id__": 60 }, { - "__id__": 60 + "__id__": 62 } ], "_active": true, "_components": [ { - "__id__": 62 + "__id__": 64 } ], "_prefab": null, @@ -1922,13 +1983,13 @@ "_name": "XPSpawner", "_objFlags": 0, "_parent": { - "__id__": 57 + "__id__": 59 }, "_children": [], "_active": true, "_components": [ { - "__id__": 59 + "__id__": 61 } ], "_prefab": null, @@ -1965,7 +2026,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 58 + "__id__": 60 }, "_enabled": true, "__prefab": null, @@ -1980,13 +2041,13 @@ "_name": "EnemySpawner", "_objFlags": 0, "_parent": { - "__id__": 57 + "__id__": 59 }, "_children": [], "_active": true, "_components": [ { - "__id__": 61 + "__id__": 63 } ], "_prefab": null, @@ -2023,7 +2084,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": null, @@ -2040,15 +2101,15 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 57 + "__id__": 59 }, "_enabled": true, "__prefab": null, "enemySpawner": { - "__id__": 61 + "__id__": 63 }, "xpSpawner": { - "__id__": 59 + "__id__": 61 }, "_id": "1ffjazmm5IkZwKInsSIULY" }, @@ -2061,28 +2122,28 @@ }, "_children": [ { - "__id__": 64 + "__id__": 66 }, { - "__id__": 87 + "__id__": 89 }, { - "__id__": 101 + "__id__": 103 }, { - "__id__": 104 + "__id__": 106 }, { - "__id__": 107 + "__id__": 109 }, { - "__id__": 110 + "__id__": 112 } ], "_active": true, "_components": [ { - "__id__": 113 + "__id__": 115 } ], "_prefab": null, @@ -2119,20 +2180,20 @@ "_name": "GameUI", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [ { - "__id__": 65 + "__id__": 67 }, { - "__id__": 77 + "__id__": 79 } ], "_active": true, "_components": [ { - "__id__": 86 + "__id__": 88 } ], "_prefab": null, @@ -2169,20 +2230,20 @@ "_name": "TopUI", "_objFlags": 0, "_parent": { - "__id__": 64 + "__id__": 66 }, "_children": [ { - "__id__": 66 + "__id__": 68 } ], "_active": true, "_components": [ { - "__id__": 75 + "__id__": 77 }, { - "__id__": 76 + "__id__": 78 } ], "_prefab": null, @@ -2219,23 +2280,23 @@ "_name": "XpBar", "_objFlags": 0, "_parent": { - "__id__": 65 + "__id__": 67 }, "_children": [ { - "__id__": 67 + "__id__": 69 }, { - "__id__": 70 + "__id__": 72 } ], "_active": true, "_components": [ { - "__id__": 73 + "__id__": 75 }, { - "__id__": 74 + "__id__": 76 } ], "_prefab": null, @@ -2272,16 +2333,16 @@ "_name": "Background", "_objFlags": 0, "_parent": { - "__id__": 66 + "__id__": 68 }, "_children": [], "_active": true, "_components": [ { - "__id__": 68 + "__id__": 70 }, { - "__id__": 69 + "__id__": 71 } ], "_prefab": null, @@ -2318,7 +2379,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 67 + "__id__": 69 }, "_enabled": true, "__prefab": null, @@ -2339,7 +2400,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 67 + "__id__": 69 }, "_enabled": true, "__prefab": null, @@ -2377,16 +2438,16 @@ "_name": "MovableBar", "_objFlags": 0, "_parent": { - "__id__": 66 + "__id__": 68 }, "_children": [], "_active": true, "_components": [ { - "__id__": 71 + "__id__": 73 }, { - "__id__": 72 + "__id__": 74 } ], "_prefab": null, @@ -2423,7 +2484,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 70 + "__id__": 72 }, "_enabled": true, "__prefab": null, @@ -2444,7 +2505,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 70 + "__id__": 72 }, "_enabled": true, "__prefab": null, @@ -2482,7 +2543,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 66 + "__id__": 68 }, "_enabled": true, "__prefab": null, @@ -2503,12 +2564,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 66 + "__id__": 68 }, "_enabled": true, "__prefab": null, "_barSprite": { - "__id__": 72 + "__id__": 74 }, "_mode": 0, "_totalLength": 600, @@ -2521,7 +2582,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 65 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2542,7 +2603,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 65 + "__id__": 67 }, "_enabled": true, "__prefab": null, @@ -2571,17 +2632,17 @@ "_name": "UI", "_objFlags": 0, "_parent": { - "__id__": 64 + "__id__": 66 }, "_children": [ { - "__id__": 78 + "__id__": 80 } ], "_active": true, "_components": [ { - "__id__": 85 + "__id__": 87 } ], "_prefab": null, @@ -2618,23 +2679,23 @@ "_name": "VirtualJoystic", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 79 }, "_children": [ { - "__id__": 79 + "__id__": 81 } ], "_active": true, "_components": [ - { - "__id__": 82 - }, - { - "__id__": 83 - }, { "__id__": 84 + }, + { + "__id__": 85 + }, + { + "__id__": 86 } ], "_prefab": null, @@ -2671,16 +2732,16 @@ "_name": "Knob", "_objFlags": 0, "_parent": { - "__id__": 78 + "__id__": 80 }, "_children": [], "_active": true, "_components": [ { - "__id__": 80 + "__id__": 82 }, { - "__id__": 81 + "__id__": 83 } ], "_prefab": null, @@ -2717,7 +2778,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 79 + "__id__": 81 }, "_enabled": true, "__prefab": null, @@ -2738,7 +2799,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 79 + "__id__": 81 }, "_enabled": true, "__prefab": null, @@ -2776,7 +2837,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": null, @@ -2797,7 +2858,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": null, @@ -2835,13 +2896,13 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 80 }, "_enabled": true, "__prefab": null, "maxDistance": 50, "knob": { - "__id__": 79 + "__id__": 81 }, "_id": "50ceZG62tGlYXvZWEvSDKl" }, @@ -2850,7 +2911,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 77 + "__id__": 79 }, "_enabled": true, "__prefab": null, @@ -2871,12 +2932,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 64 + "__id__": 66 }, "_enabled": true, "__prefab": null, "xpBar": { - "__id__": 74 + "__id__": 76 }, "_id": "bau/7eItRFrKKoAZZb/uYL" }, @@ -2885,20 +2946,20 @@ "_name": "ModalWindowManager", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [ { - "__id__": 88 + "__id__": 90 } ], "_active": true, "_components": [ { - "__id__": 99 + "__id__": 101 }, { - "__id__": 100 + "__id__": 102 } ], "_prefab": null, @@ -2934,17 +2995,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 87 + "__id__": 89 }, "_prefab": { - "__id__": 89 + "__id__": 91 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 88 + "__id__": 90 }, "asset": { "__uuid__": "663674aa-da1c-44b0-8049-49db9b020973", @@ -2952,11 +3013,11 @@ }, "fileId": "32U/bJCUBDlaQxxGFNXZTu", "instance": { - "__id__": 90 + "__id__": 92 }, "targetOverrides": [ { - "__id__": 97 + "__id__": 99 } ] }, @@ -2966,20 +3027,20 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 91 - }, { "__id__": 93 }, - { - "__id__": 94 - }, { "__id__": 95 }, { "__id__": 96 + }, + { + "__id__": 97 + }, + { + "__id__": 98 } ], "removedComponents": [] @@ -2987,7 +3048,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 94 }, "propertyPath": [ "_name" @@ -3003,7 +3064,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 94 }, "propertyPath": [ "_lpos" @@ -3018,7 +3079,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 94 }, "propertyPath": [ "_lrot" @@ -3034,7 +3095,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 94 }, "propertyPath": [ "_euler" @@ -3049,7 +3110,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 92 + "__id__": 94 }, "propertyPath": [ "_active" @@ -3066,7 +3127,7 @@ ], "target": null, "targetInfo": { - "__id__": 98 + "__id__": 100 } }, { @@ -3080,7 +3141,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 87 + "__id__": 89 }, "_enabled": true, "__prefab": null, @@ -3101,7 +3162,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 87 + "__id__": 89 }, "_enabled": true, "__prefab": null, @@ -3118,16 +3179,16 @@ "_name": "Sprite", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 102 + "__id__": 104 }, { - "__id__": 103 + "__id__": 105 } ], "_prefab": null, @@ -3164,7 +3225,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 101 + "__id__": 103 }, "_enabled": true, "__prefab": null, @@ -3185,7 +3246,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 101 + "__id__": 103 }, "_enabled": true, "__prefab": null, @@ -3223,16 +3284,16 @@ "_name": "Sprite-001", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 105 + "__id__": 107 }, { - "__id__": 106 + "__id__": 108 } ], "_prefab": null, @@ -3269,7 +3330,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 104 + "__id__": 106 }, "_enabled": true, "__prefab": null, @@ -3290,7 +3351,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 104 + "__id__": 106 }, "_enabled": true, "__prefab": null, @@ -3328,16 +3389,16 @@ "_name": "Sprite-002", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 108 + "__id__": 110 }, { - "__id__": 109 + "__id__": 111 } ], "_prefab": null, @@ -3374,7 +3435,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 107 + "__id__": 109 }, "_enabled": true, "__prefab": null, @@ -3395,7 +3456,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 107 + "__id__": 109 }, "_enabled": true, "__prefab": null, @@ -3433,16 +3494,16 @@ "_name": "Sprite-003", "_objFlags": 0, "_parent": { - "__id__": 63 + "__id__": 65 }, "_children": [], "_active": true, "_components": [ { - "__id__": 111 + "__id__": 113 }, { - "__id__": 112 + "__id__": 114 } ], "_prefab": null, @@ -3479,7 +3540,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 110 + "__id__": 112 }, "_enabled": true, "__prefab": null, @@ -3500,7 +3561,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 110 + "__id__": 112 }, "_enabled": true, "__prefab": null, @@ -3538,7 +3599,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 63 + "__id__": 65 }, "_enabled": true, "__prefab": null, @@ -3607,7 +3668,7 @@ "_enabled": true, "__prefab": null, "_cameraComponent": { - "__id__": 113 + "__id__": 115 }, "_alignCanvasWithScreen": true, "_id": "12O/ljcVlEqLmVm3U2gEOQ" @@ -3651,28 +3712,31 @@ "_enabled": true, "__prefab": null, "virtualJoystic": { - "__id__": 84 + "__id__": 86 }, "player": { - "__id__": 55 + "__id__": 57 }, "haloProjectileLauncherComponent": { "__id__": 4 }, - "verticalProjectileLauncherComponent": { + "horizontalProjectileLauncherComponent": { "__id__": 6 }, + "diagonalProjectileLauncherComponent": { + "__id__": 8 + }, "enemyManager": { - "__id__": 62 + "__id__": 64 }, "camera": { - "__id__": 113 + "__id__": 115 }, "gameUI": { - "__id__": 86 + "__id__": 88 }, "modalWindowManager": { - "__id__": 100 + "__id__": 102 }, "settingsAsset": { "__uuid__": "6828fb79-0a56-437e-b718-9f43bf234fbc", @@ -3685,26 +3749,26 @@ "fileId": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f", "nestedPrefabInstanceRoots": [ { - "__id__": 88 + "__id__": 90 } ] }, { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 120 - }, - "shadows": { - "__id__": 121 - }, - "_skybox": { "__id__": 122 }, - "fog": { + "shadows": { "__id__": 123 }, - "octree": { + "_skybox": { "__id__": 124 + }, + "fog": { + "__id__": 125 + }, + "octree": { + "__id__": 126 } }, { diff --git a/assets/Scripts/Game/Data/GameSettings.ts b/assets/Scripts/Game/Data/GameSettings.ts index 3c160c8..f9ababd 100644 --- a/assets/Scripts/Game/Data/GameSettings.ts +++ b/assets/Scripts/Game/Data/GameSettings.ts @@ -10,7 +10,8 @@ export class PlayerSettings { public collisionDelay = 0; public weapon: WeaponSettings = new WeaponSettings(); public haloLauncher: HaloLauncherSettings = new HaloLauncherSettings(); - public xyLaunchers: WaveLauncherSettings = new WaveLauncherSettings(); + public horizontalLauncher: WaveLauncherSettings = new WaveLauncherSettings(); + public diagonalLauncher: WaveLauncherSettings = new WaveLauncherSettings(); } export class WeaponSettings { @@ -41,7 +42,7 @@ export class UpgradeSettings { public maxWeaponLengthUpgrades = 0; public maxWeaponDamageUpgrades = 0; public maxHorizontalProjectileUpgrades = 0; - public maxHorizontalProjectileUpgrades = 0; + public maxDiagonalProjectileUpgrades = 0; public maxHaloProjectileUpgrades = 0; public maxRegenerationUpgrades = 0; } diff --git a/assets/Scripts/Game/GameBootstrapper.ts b/assets/Scripts/Game/GameBootstrapper.ts index 2349355..80a0040 100644 --- a/assets/Scripts/Game/GameBootstrapper.ts +++ b/assets/Scripts/Game/GameBootstrapper.ts @@ -14,7 +14,7 @@ import { EnemyManager } from "./Unit/Enemy/EnemyManager"; import { Player } from "./Unit/Player/Player"; import { HaloProjectileLauncher } from "./Unit/Player/ProjectileLauncher/HaloProjectileLauncher"; import { ProjectileLauncher } from "./Unit/Player/ProjectileLauncher/ProjectileLauncher"; -import { HorizontalProjectileLauncher } from "./Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher"; +import { WaveProjectileLauncher } from "./Unit/Player/ProjectileLauncher/WaveProjectileLauncher"; import { Upgrader } from "./Upgrades/Upgrader"; const { ccclass, property } = _decorator; @@ -24,7 +24,8 @@ export class GameBootstrapper extends Component { @property(VirtualJoystic) private virtualJoystic: VirtualJoystic; @property(Player) private player: Player; @property(ProjectileLauncher) private haloProjectileLauncherComponent: ProjectileLauncher; - @property(ProjectileLauncher) private verticalProjectileLauncherComponent: ProjectileLauncher; + @property(ProjectileLauncher) private horizontalProjectileLauncherComponent: ProjectileLauncher; + @property(ProjectileLauncher) private diagonalProjectileLauncherComponent: ProjectileLauncher; @property(EnemyManager) private enemyManager: EnemyManager; @property(Camera) private camera: Camera; @property(GameUI) private gameUI: GameUI; @@ -33,7 +34,8 @@ export class GameBootstrapper extends Component { private playerCollisionSystem: PlayerCollisionSystem; private haloProjectileLauncher: HaloProjectileLauncher; - private horizontalProjectileLauncher: HorizontalProjectileLauncher; + private horizontalProjectileLauncher: WaveProjectileLauncher; + private diagonalProjectileLauncher: WaveProjectileLauncher; private gamePauser: Pauser = new Pauser(); @@ -59,14 +61,23 @@ export class GameBootstrapper extends Component { ); this.haloProjectileLauncher.upgrade(); - this.horizontalProjectileLauncher = new HorizontalProjectileLauncher( - this.verticalProjectileLauncherComponent, + this.horizontalProjectileLauncher = new WaveProjectileLauncher( + this.horizontalProjectileLauncherComponent, this.player.node, - settings.player.xyLaunchers + [new Vec2(-1, 0), new Vec2(1, 0)], + settings.player.horizontalLauncher ); this.horizontalProjectileLauncher.upgrade(); - new PlayerProjectileCollisionSystem([this.haloProjectileLauncher, this.horizontalProjectileLauncher]); + this.diagonalProjectileLauncher = new WaveProjectileLauncher( + this.diagonalProjectileLauncherComponent, + this.player.node, + [new Vec2(-0.5, -0.5), new Vec2(0.5, -0.5)], + settings.player.diagonalLauncher + ); + this.diagonalProjectileLauncher.upgrade(); + + new PlayerProjectileCollisionSystem([this.haloProjectileLauncher, this.horizontalProjectileLauncher, this.diagonalProjectileLauncher]); const upgrader = new Upgrader(this.player, this.horizontalProjectileLauncher, this.haloProjectileLauncher, settings.upgrades); new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader); @@ -82,6 +93,7 @@ export class GameBootstrapper extends Component { this.enemyManager.gameTick(deltaTime); this.haloProjectileLauncher.gameTick(deltaTime); this.horizontalProjectileLauncher.gameTick(deltaTime); + this.diagonalProjectileLauncher.gameTick(deltaTime); this.camera.node.worldPosition = this.player.node.worldPosition; } diff --git a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts similarity index 82% rename from assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts rename to assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts index 73cbc23..069728e 100644 --- a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts +++ b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts @@ -5,13 +5,13 @@ import { IProjectileCollisionSignaler } from "../../../Projectile/IProjectileCol import { ProjectileCollision } from "../../../Projectile/ProjectileCollision"; import { ProjectileLauncher } from "./ProjectileLauncher"; -export class HorizontalProjectileLauncher implements IProjectileCollisionSignaler { +export class WaveProjectileLauncher implements IProjectileCollisionSignaler { private currentUpgrade = 0; private wavesToShootPerUpgrade = 0; - public constructor(private launcher: ProjectileLauncher, playerNode: Node, settings: WaveLauncherSettings) { + public constructor(private launcher: ProjectileLauncher, playerNode: Node, directions: Vec2[], settings: WaveLauncherSettings) { this.wavesToShootPerUpgrade = settings.wavesToShootPerUpgrade; - launcher.init(playerNode, [new Vec2(-1, 0), new Vec2(1, 0)], settings.launcher); + launcher.init(playerNode, directions, settings.launcher); } public get ProjectileCollisionEvent(): ISignal { diff --git a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts.meta b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts.meta similarity index 70% rename from assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts.meta rename to assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts.meta index bf39347..34465bb 100644 --- a/assets/Scripts/Game/Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher.ts.meta +++ b/assets/Scripts/Game/Unit/Player/ProjectileLauncher/WaveProjectileLauncher.ts.meta @@ -2,7 +2,7 @@ "ver": "4.0.23", "importer": "typescript", "imported": true, - "uuid": "1e160c96-efda-4b1a-8e21-8c1b525bc7ef", + "uuid": "1ed6eff1-da2e-4727-8f44-2e802848719c", "files": [], "subMetas": {}, "userData": {} diff --git a/assets/Scripts/Game/Upgrades/Upgrader.ts b/assets/Scripts/Game/Upgrades/Upgrader.ts index ae1e1b9..e9bba66 100644 --- a/assets/Scripts/Game/Upgrades/Upgrader.ts +++ b/assets/Scripts/Game/Upgrades/Upgrader.ts @@ -1,7 +1,7 @@ import { UpgradeSettings } from "../Data/GameSettings"; import { Player } from "../Unit/Player/Player"; import { HaloProjectileLauncher } from "../Unit/Player/ProjectileLauncher/HaloProjectileLauncher"; -import { HorizontalProjectileLauncher } from "../Unit/Player/ProjectileLauncher/HorizontalProjectileLauncher"; +import { WaveProjectileLauncher } from "../Unit/Player/ProjectileLauncher/WaveProjectileLauncher"; import { UpgradeType } from "./UpgradeType"; export class Upgrader { @@ -11,7 +11,7 @@ export class Upgrader { public constructor( private player: Player, - private horizontalProjectileLauncher: HorizontalProjectileLauncher, + private horizontalProjectileLauncher: WaveProjectileLauncher, private haloProjectileLauncher: HaloProjectileLauncher, settings: UpgradeSettings ) {