diff --git a/assets/Data/GameSettings.json b/assets/Data/GameSettings.json index 2092852..558dbc2 100644 --- a/assets/Data/GameSettings.json +++ b/assets/Data/GameSettings.json @@ -14,17 +14,24 @@ 20 ], "regenerationDelay": 5, - "collisionDelay": 0.5 - }, - "weapon": { - "strikeDelay": 2, - "damage": 1 + "collisionDelay": 0.5, + "weapon": { + "strikeDelay": 2, + "damage": 1 + }, + "haloLauncher": { + "projectileLifetime": 2, + "projectileSpeed": 150, + "projectilesToSpawn": 24, + "cooldown": 10 + } }, "upgrades": { "maxWeaponLengthUpgrades": 5, "maxWeaponDamageUpgrades": 5, "maxHorizontalProjectileUpgrades": 0, "maxVerticalProjectileUpgrades": 0, + "maxHaloProjectileUpgrades": 5, "maxRegenerationUpgrades": 5 } } \ No newline at end of file diff --git a/assets/Media/Prefabs/PlayerProjectile.prefab b/assets/Media/Prefabs/PlayerProjectile.prefab new file mode 100644 index 0000000..6b1a3a9 --- /dev/null +++ b/assets/Media/Prefabs/PlayerProjectile.prefab @@ -0,0 +1,194 @@ +[ + { + "__type__": "cc.Prefab", + "_name": "PlayerProjectile", + "_objFlags": 0, + "_native": "", + "data": { + "__id__": 1 + }, + "optimizationPolicy": 0, + "persistent": false, + "asyncLoadAssets": false + }, + { + "__type__": "cc.Node", + "_name": "PlayerProjectile", + "_objFlags": 0, + "__editorExtras__": {}, + "_parent": null, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 2 + }, + { + "__id__": 4 + }, + { + "__id__": 6 + }, + { + "__id__": 8 + } + ], + "_prefab": { + "__id__": 10 + }, + "_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": "" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 3 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 26, + "height": 26 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "baF+RbIRdMqqYdGWVAqM48" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 5 + }, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 197, + "g": 35, + "b": 35, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "f12a23c4-b924-4322-a260-3d982428f1e8@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 1, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "46qOXlbU5GmbOpfjiX4jGV" + }, + { + "__type__": "cc.CircleCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 7 + }, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_radius": 13, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "7cR5oa68RG/oqkiwJ9HQ3X" + }, + { + "__type__": "6a24eYAhmtMDZo5Wb8iLC5Q", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 1 + }, + "_enabled": true, + "__prefab": { + "__id__": 9 + }, + "_id": "" + }, + { + "__type__": "cc.CompPrefabInfo", + "fileId": "a81ki8NjhA4KniWAiobzy2" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "26opAI9A5IGabbGPZh6QDI" + } +] \ No newline at end of file diff --git a/assets/Media/Prefabs/PlayerProjectile.prefab.meta b/assets/Media/Prefabs/PlayerProjectile.prefab.meta new file mode 100644 index 0000000..5b83570 --- /dev/null +++ b/assets/Media/Prefabs/PlayerProjectile.prefab.meta @@ -0,0 +1,13 @@ +{ + "ver": "1.1.40", + "importer": "prefab", + "imported": true, + "uuid": "ff0be112-7028-424c-87b8-fc54a106015a", + "files": [ + ".json" + ], + "subMetas": {}, + "userData": { + "syncNodeName": "PlayerProjectile" + } +} diff --git a/assets/Scenes/scene.scene b/assets/Scenes/scene.scene index 27facd7..cec10e3 100644 --- a/assets/Scenes/scene.scene +++ b/assets/Scenes/scene.scene @@ -21,11 +21,11 @@ "_active": true, "_components": [], "_prefab": { - "__id__": 114 + "__id__": 116 }, "autoReleaseAssets": false, "_globals": { - "__id__": 115 + "__id__": 117 }, "_id": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f" }, @@ -41,28 +41,28 @@ "__id__": 3 }, { - "__id__": 33 + "__id__": 5 }, { - "__id__": 53 + "__id__": 55 }, { - "__id__": 59 + "__id__": 61 } ], "_active": true, "_components": [ - { - "__id__": 110 - }, - { - "__id__": 111 - }, { "__id__": 112 }, { "__id__": 113 + }, + { + "__id__": 114 + }, + { + "__id__": 115 } ], "_prefab": null, @@ -96,27 +96,23 @@ }, { "__type__": "cc.Node", - "_name": "Weapon", + "_name": "HaloProjectileLauncher", "_objFlags": 0, "_parent": { "__id__": 2 }, - "_children": [ + "_children": [], + "_active": true, + "_components": [ { "__id__": 4 } ], - "_active": true, - "_components": [ - { - "__id__": 32 - } - ], "_prefab": null, "_lpos": { "__type__": "cc.Vec3", - "x": -78, - "y": -42, + "x": 0, + "y": 0, "z": 0 }, "_lrot": { @@ -139,962 +135,10 @@ "y": 0, "z": 0 }, - "_id": "36M1oczB9EsY/fO80ilIoc" + "_id": "61KOckV1dET5kaFFrJFLGb" }, { - "__type__": "cc.Node", - "_name": "AnimatedWeapon", - "_objFlags": 0, - "_parent": { - "__id__": 3 - }, - "_children": [ - { - "__id__": 5 - }, - { - "__id__": 9 - }, - { - "__id__": 13 - }, - { - "__id__": 17 - }, - { - "__id__": 21 - }, - { - "__id__": 25 - } - ], - "_active": true, - "_components": [ - { - "__id__": 29 - }, - { - "__id__": 30 - }, - { - "__id__": 31 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 0, - "y": 4, - "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": "9dFcDHQYpKPLaHRfcVfzbw" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 6 - }, - { - "__id__": 7 - }, - { - "__id__": 8 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 72, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "30JLIsPm9Bb5mbnNzOWMbF" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 5 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 60 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "04AsIDggNGcr/2cm9cxQBw" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 5 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "74WVjJijpEiZ0CypIoh8+P" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 5 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 60 - }, - "_id": "3aF6QUKjlBv6hc4EtxRzck" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-001", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 10 - }, - { - "__id__": 11 - }, - { - "__id__": 12 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 77, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "6a4ptKRuFNDJPobiRKOM5O" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 70 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "deYd2NbJtCe5Df9jK8tU7c" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "f1vMaltlxDK53V7eyR5nAI" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 9 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 70 - }, - "_id": "bd1VBaovZHT4m/3826DnjC" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-002", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 14 - }, - { - "__id__": 15 - }, - { - "__id__": 16 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 82, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "01/mwfVYBMkqZJrFYIKj5A" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 13 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 80 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "65frUzl7VMc6qGQAW/k65x" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 13 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "677VqCBdlNRKuT0qWrhDW0" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 13 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 80 - }, - "_id": "2fLL+SLUlFjIhyArlZE8wX" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-003", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 18 - }, - { - "__id__": 19 - }, - { - "__id__": 20 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 87, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "6aq2En3uVONrTOfKJ9LKws" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 17 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 90 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "d7yUBTwDlNdo0SxocYm4c0" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 17 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "b4/f+2GRFCcbeuc1d6BI3B" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 17 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 90 - }, - "_id": "cdJ3b7a79PJKD7PsVLTLRz" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-004", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 22 - }, - { - "__id__": 23 - }, - { - "__id__": 24 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 92, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "5cy6b2p75Ec5CNmUYN4v3U" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 21 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "90G2/JRPxCuLF/YltaOE6x" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 21 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "1anCpabENOgYx59yUp3QpE" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 21 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 100 - }, - "_id": "87IzyLtZJPxJsgbhFP75PZ" - }, - { - "__type__": "cc.Node", - "_name": "WeaponCollider-005", - "_objFlags": 0, - "_parent": { - "__id__": 4 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 26 - }, - { - "__id__": 27 - }, - { - "__id__": 28 - } - ], - "_prefab": null, - "_lpos": { - "__type__": "cc.Vec3", - "x": 97, - "y": 0, - "z": 0 - }, - "_lrot": { - "__type__": "cc.Quat", - "x": 0, - "y": 0, - "z": 0.7071067811865475, - "w": 0.7071067811865476 - }, - "_lscale": { - "__type__": "cc.Vec3", - "x": 1, - "y": 1, - "z": 1 - }, - "_layer": 33554432, - "_euler": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 90 - }, - "_id": "f2gu31xvpKaZ8O6R46LaWo" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 25 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 20, - "height": 110 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "f8LpyOdKdH/Z9hJlfUyKg1" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 25 - }, - "_enabled": true, - "__prefab": null, - "_customMaterial": null, - "_srcBlendFactor": 2, - "_dstBlendFactor": 4, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 10, - "b": 10, - "a": 255 - }, - "_spriteFrame": { - "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", - "__expectedType__": "cc.SpriteFrame" - }, - "_type": 0, - "_fillType": 0, - "_sizeMode": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_useGrayscale": false, - "_atlas": null, - "_id": "5aIBtQGwRH5JO5FJwmtM2U" - }, - { - "__type__": "cc.BoxCollider2D", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 25 - }, - "_enabled": true, - "__prefab": null, - "tag": 0, - "_group": 8, - "_density": 1, - "_sensor": false, - "_friction": 0.2, - "_restitution": 0, - "_offset": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_size": { - "__type__": "cc.Size", - "width": 20, - "height": 110 - }, - "_id": "0aG49hWrZCa686F6VVqqCL" - }, - { - "__type__": "cc.UITransform", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 4 - }, - "_enabled": true, - "__prefab": null, - "_contentSize": { - "__type__": "cc.Size", - "width": 100, - "height": 100 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_id": "adf8M2uCJM14jcRu9ve0i6" - }, - { - "__type__": "cc.Animation", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 4 - }, - "_enabled": true, - "__prefab": null, - "playOnLoad": false, - "_clips": [ - { - "__uuid__": "5022a9c8-7d40-4759-a10c-ce914b4b3fec", - "__expectedType__": "cc.AnimationClip" - } - ], - "_defaultClip": { - "__uuid__": "5022a9c8-7d40-4759-a10c-ce914b4b3fec", - "__expectedType__": "cc.AnimationClip" - }, - "_id": "3cAaPvthdElK2Tk7R8V3xz" - }, - { - "__type__": "bba49sAP+VAQoXzfR8BfXXT", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 4 - }, - "_enabled": true, - "__prefab": null, - "colliders": [ - { - "__id__": 8 - }, - { - "__id__": 12 - }, - { - "__id__": 16 - }, - { - "__id__": 20 - }, - { - "__id__": 24 - }, - { - "__id__": 28 - } - ], - "_id": "efTecDVf5IyZOD5/n+1DG7" - }, - { - "__type__": "2391bi3+fpCqLBGVf9XsH0C", + "__type__": "422b4bsPhVDfZf8f0Sid8O+", "_name": "", "_objFlags": 0, "node": { @@ -1102,13 +146,11 @@ }, "_enabled": true, "__prefab": null, - "weaponAnimation": { - "__id__": 30 + "projectilePrefab": { + "__uuid__": "ff0be112-7028-424c-87b8-fc54a106015a", + "__expectedType__": "cc.Prefab" }, - "upgradableCollider": { - "__id__": 31 - }, - "_id": "femtdMmA5Ax5K78hjELCcD" + "_id": "02VMV6hX5L5pm3W9sOTjZt" }, { "__type__": "cc.Node", @@ -1119,22 +161,25 @@ }, "_children": [ { - "__id__": 34 + "__id__": 6 + }, + { + "__id__": 21 } ], "_active": true, "_components": [ - { - "__id__": 49 - }, - { - "__id__": 50 - }, { "__id__": 51 }, { "__id__": 52 + }, + { + "__id__": 53 + }, + { + "__id__": 54 } ], "_prefab": null, @@ -1171,20 +216,20 @@ "_name": "PlayerUI", "_objFlags": 0, "_parent": { - "__id__": 33 + "__id__": 5 }, "_children": [ { - "__id__": 35 + "__id__": 7 } ], "_active": true, "_components": [ { - "__id__": 47 + "__id__": 19 }, { - "__id__": 48 + "__id__": 20 } ], "_prefab": null, @@ -1221,23 +266,23 @@ "_name": "PlayerHealthUI", "_objFlags": 0, "_parent": { - "__id__": 34 + "__id__": 6 }, "_children": [ { - "__id__": 36 + "__id__": 8 }, { - "__id__": 39 + "__id__": 11 } ], "_active": true, "_components": [ { - "__id__": 45 + "__id__": 17 }, { - "__id__": 46 + "__id__": 18 } ], "_prefab": null, @@ -1274,16 +319,16 @@ "_name": "Background", "_objFlags": 0, "_parent": { - "__id__": 35 + "__id__": 7 }, "_children": [], "_active": true, "_components": [ { - "__id__": 37 + "__id__": 9 }, { - "__id__": 38 + "__id__": 10 } ], "_prefab": null, @@ -1320,7 +365,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 36 + "__id__": 8 }, "_enabled": true, "__prefab": null, @@ -1341,7 +386,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 36 + "__id__": 8 }, "_enabled": true, "__prefab": null, @@ -1379,20 +424,20 @@ "_name": "HpBar", "_objFlags": 0, "_parent": { - "__id__": 35 + "__id__": 7 }, "_children": [ { - "__id__": 40 + "__id__": 12 } ], "_active": true, "_components": [ { - "__id__": 43 + "__id__": 15 }, { - "__id__": 44 + "__id__": 16 } ], "_prefab": null, @@ -1429,16 +474,16 @@ "_name": "MovableBar", "_objFlags": 0, "_parent": { - "__id__": 39 + "__id__": 11 }, "_children": [], "_active": true, "_components": [ { - "__id__": 41 + "__id__": 13 }, { - "__id__": 42 + "__id__": 14 } ], "_prefab": null, @@ -1475,7 +520,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 40 + "__id__": 12 }, "_enabled": true, "__prefab": null, @@ -1496,7 +541,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 40 + "__id__": 12 }, "_enabled": true, "__prefab": null, @@ -1534,7 +579,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 39 + "__id__": 11 }, "_enabled": true, "__prefab": null, @@ -1555,12 +600,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 39 + "__id__": 11 }, "_enabled": true, "__prefab": null, "_barSprite": { - "__id__": 42 + "__id__": 14 }, "_mode": 0, "_totalLength": 80, @@ -1573,7 +618,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 35 + "__id__": 7 }, "_enabled": true, "__prefab": null, @@ -1594,12 +639,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 35 + "__id__": 7 }, "_enabled": true, "__prefab": null, "healthBar": { - "__id__": 44 + "__id__": 16 }, "_id": "8doWxm45ZCKLqr0rVRHJa2" }, @@ -1608,7 +653,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 34 + "__id__": 6 }, "_enabled": true, "__prefab": null, @@ -1629,21 +674,1037 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 34 + "__id__": 6 }, "_enabled": true, "__prefab": null, "healthUI": { - "__id__": 46 + "__id__": 18 }, "_id": "49hVDAypRMuoVp+F+IPkXM" }, + { + "__type__": "cc.Node", + "_name": "Weapon", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 22 + } + ], + "_active": true, + "_components": [ + { + "__id__": 50 + } + ], + "_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": "36M1oczB9EsY/fO80ilIoc" + }, + { + "__type__": "cc.Node", + "_name": "AnimatedWeapon", + "_objFlags": 0, + "_parent": { + "__id__": 21 + }, + "_children": [ + { + "__id__": 23 + }, + { + "__id__": 27 + }, + { + "__id__": 31 + }, + { + "__id__": 35 + }, + { + "__id__": 39 + }, + { + "__id__": 43 + } + ], + "_active": true, + "_components": [ + { + "__id__": 47 + }, + { + "__id__": 48 + }, + { + "__id__": 49 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 0, + "y": 4, + "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": "9dFcDHQYpKPLaHRfcVfzbw" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 24 + }, + { + "__id__": 25 + }, + { + "__id__": 26 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 72, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "30JLIsPm9Bb5mbnNzOWMbF" + }, { "__type__": "cc.UITransform", "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 23 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 60 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "04AsIDggNGcr/2cm9cxQBw" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 23 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "74WVjJijpEiZ0CypIoh8+P" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 23 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 60 + }, + "_id": "3aF6QUKjlBv6hc4EtxRzck" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-001", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 28 + }, + { + "__id__": 29 + }, + { + "__id__": 30 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 77, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "6a4ptKRuFNDJPobiRKOM5O" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 70 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "deYd2NbJtCe5Df9jK8tU7c" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "f1vMaltlxDK53V7eyR5nAI" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 70 + }, + "_id": "bd1VBaovZHT4m/3826DnjC" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-002", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 32 + }, + { + "__id__": 33 + }, + { + "__id__": 34 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 82, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "01/mwfVYBMkqZJrFYIKj5A" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 31 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 80 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "65frUzl7VMc6qGQAW/k65x" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 31 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "677VqCBdlNRKuT0qWrhDW0" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 31 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 80 + }, + "_id": "2fLL+SLUlFjIhyArlZE8wX" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-003", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 36 + }, + { + "__id__": 37 + }, + { + "__id__": 38 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 87, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "6aq2En3uVONrTOfKJ9LKws" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 90 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "d7yUBTwDlNdo0SxocYm4c0" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "b4/f+2GRFCcbeuc1d6BI3B" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 90 + }, + "_id": "cdJ3b7a79PJKD7PsVLTLRz" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-004", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 40 + }, + { + "__id__": 41 + }, + { + "__id__": 42 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 92, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "5cy6b2p75Ec5CNmUYN4v3U" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "90G2/JRPxCuLF/YltaOE6x" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "1anCpabENOgYx59yUp3QpE" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 39 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 100 + }, + "_id": "87IzyLtZJPxJsgbhFP75PZ" + }, + { + "__type__": "cc.Node", + "_name": "WeaponCollider-005", + "_objFlags": 0, + "_parent": { + "__id__": 22 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 44 + }, + { + "__id__": 45 + }, + { + "__id__": 46 + } + ], + "_prefab": null, + "_lpos": { + "__type__": "cc.Vec3", + "x": 97, + "y": 0, + "z": 0 + }, + "_lrot": { + "__type__": "cc.Quat", + "x": 0, + "y": 0, + "z": 0.7071067811865475, + "w": 0.7071067811865476 + }, + "_lscale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_layer": 33554432, + "_euler": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 90 + }, + "_id": "f2gu31xvpKaZ8O6R46LaWo" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 20, + "height": 110 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "f8LpyOdKdH/Z9hJlfUyKg1" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "_customMaterial": null, + "_srcBlendFactor": 2, + "_dstBlendFactor": 4, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 10, + "b": 10, + "a": 255 + }, + "_spriteFrame": { + "__uuid__": "20835ba4-6145-4fbc-a58a-051ce700aa3e@f9941", + "__expectedType__": "cc.SpriteFrame" + }, + "_type": 0, + "_fillType": 0, + "_sizeMode": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_useGrayscale": false, + "_atlas": null, + "_id": "5aIBtQGwRH5JO5FJwmtM2U" + }, + { + "__type__": "cc.BoxCollider2D", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 43 + }, + "_enabled": true, + "__prefab": null, + "tag": 0, + "_group": 8, + "_density": 1, + "_sensor": false, + "_friction": 0.2, + "_restitution": 0, + "_offset": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_size": { + "__type__": "cc.Size", + "width": 20, + "height": 110 + }, + "_id": "0aG49hWrZCa686F6VVqqCL" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "_contentSize": { + "__type__": "cc.Size", + "width": 100, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_id": "adf8M2uCJM14jcRu9ve0i6" + }, + { + "__type__": "cc.Animation", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "playOnLoad": false, + "_clips": [ + { + "__uuid__": "5022a9c8-7d40-4759-a10c-ce914b4b3fec", + "__expectedType__": "cc.AnimationClip" + } + ], + "_defaultClip": { + "__uuid__": "5022a9c8-7d40-4759-a10c-ce914b4b3fec", + "__expectedType__": "cc.AnimationClip" + }, + "_id": "3cAaPvthdElK2Tk7R8V3xz" + }, + { + "__type__": "bba49sAP+VAQoXzfR8BfXXT", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 22 + }, + "_enabled": true, + "__prefab": null, + "colliders": [ + { + "__id__": 26 + }, + { + "__id__": 30 + }, + { + "__id__": 34 + }, + { + "__id__": 38 + }, + { + "__id__": 42 + }, + { + "__id__": 46 + } + ], + "_id": "efTecDVf5IyZOD5/n+1DG7" + }, + { + "__type__": "2391bi3+fpCqLBGVf9XsH0C", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "__prefab": null, + "weaponAnimation": { + "__id__": 48 + }, + "upgradableCollider": { + "__id__": 49 + }, + "_id": "femtdMmA5Ax5K78hjELCcD" + }, + { + "__type__": "cc.UITransform", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 }, "_enabled": true, "__prefab": null, @@ -1664,7 +1725,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 5 }, "_enabled": true, "__prefab": null, @@ -1702,16 +1763,19 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 5 }, "_enabled": true, "__prefab": null, "speed": 100, "collider": { - "__id__": 52 + "__id__": 54 }, "playerUI": { - "__id__": 48 + "__id__": 20 + }, + "weapon": { + "__id__": 50 }, "_id": "5aDEGDNWpIaL+U2iIxK4vA" }, @@ -1720,7 +1784,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 33 + "__id__": 5 }, "_enabled": true, "__prefab": null, @@ -1751,16 +1815,16 @@ }, "_children": [ { - "__id__": 54 + "__id__": 56 }, { - "__id__": 56 + "__id__": 58 } ], "_active": true, "_components": [ { - "__id__": 58 + "__id__": 60 } ], "_prefab": null, @@ -1797,13 +1861,13 @@ "_name": "XPSpawner", "_objFlags": 0, "_parent": { - "__id__": 53 + "__id__": 55 }, "_children": [], "_active": true, "_components": [ { - "__id__": 55 + "__id__": 57 } ], "_prefab": null, @@ -1840,7 +1904,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 54 + "__id__": 56 }, "_enabled": true, "__prefab": null, @@ -1855,13 +1919,13 @@ "_name": "EnemySpawner", "_objFlags": 0, "_parent": { - "__id__": 53 + "__id__": 55 }, "_children": [], "_active": true, "_components": [ { - "__id__": 57 + "__id__": 59 } ], "_prefab": null, @@ -1898,7 +1962,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 56 + "__id__": 58 }, "_enabled": true, "__prefab": null, @@ -1915,15 +1979,15 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 53 + "__id__": 55 }, "_enabled": true, "__prefab": null, "enemySpawner": { - "__id__": 57 + "__id__": 59 }, "xpSpawner": { - "__id__": 55 + "__id__": 57 }, "_id": "1ffjazmm5IkZwKInsSIULY" }, @@ -1936,28 +2000,28 @@ }, "_children": [ { - "__id__": 60 + "__id__": 62 }, { - "__id__": 83 + "__id__": 85 }, { - "__id__": 97 + "__id__": 99 }, { - "__id__": 100 + "__id__": 102 }, { - "__id__": 103 + "__id__": 105 }, { - "__id__": 106 + "__id__": 108 } ], "_active": true, "_components": [ { - "__id__": 109 + "__id__": 111 } ], "_prefab": null, @@ -1994,20 +2058,20 @@ "_name": "GameUI", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [ { - "__id__": 61 + "__id__": 63 }, { - "__id__": 73 + "__id__": 75 } ], "_active": true, "_components": [ { - "__id__": 82 + "__id__": 84 } ], "_prefab": null, @@ -2044,20 +2108,20 @@ "_name": "TopUI", "_objFlags": 0, "_parent": { - "__id__": 60 + "__id__": 62 }, "_children": [ { - "__id__": 62 + "__id__": 64 } ], "_active": true, "_components": [ { - "__id__": 71 + "__id__": 73 }, { - "__id__": 72 + "__id__": 74 } ], "_prefab": null, @@ -2094,23 +2158,23 @@ "_name": "XpBar", "_objFlags": 0, "_parent": { - "__id__": 61 + "__id__": 63 }, "_children": [ { - "__id__": 63 + "__id__": 65 }, { - "__id__": 66 + "__id__": 68 } ], "_active": true, "_components": [ { - "__id__": 69 + "__id__": 71 }, { - "__id__": 70 + "__id__": 72 } ], "_prefab": null, @@ -2147,16 +2211,16 @@ "_name": "Background", "_objFlags": 0, "_parent": { - "__id__": 62 + "__id__": 64 }, "_children": [], "_active": true, "_components": [ { - "__id__": 64 + "__id__": 66 }, { - "__id__": 65 + "__id__": 67 } ], "_prefab": null, @@ -2193,7 +2257,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 63 + "__id__": 65 }, "_enabled": true, "__prefab": null, @@ -2214,7 +2278,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 63 + "__id__": 65 }, "_enabled": true, "__prefab": null, @@ -2252,16 +2316,16 @@ "_name": "MovableBar", "_objFlags": 0, "_parent": { - "__id__": 62 + "__id__": 64 }, "_children": [], "_active": true, "_components": [ { - "__id__": 67 + "__id__": 69 }, { - "__id__": 68 + "__id__": 70 } ], "_prefab": null, @@ -2298,7 +2362,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 66 + "__id__": 68 }, "_enabled": true, "__prefab": null, @@ -2319,7 +2383,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 66 + "__id__": 68 }, "_enabled": true, "__prefab": null, @@ -2357,7 +2421,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 62 + "__id__": 64 }, "_enabled": true, "__prefab": null, @@ -2378,12 +2442,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 62 + "__id__": 64 }, "_enabled": true, "__prefab": null, "_barSprite": { - "__id__": 68 + "__id__": 70 }, "_mode": 0, "_totalLength": 600, @@ -2396,7 +2460,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 61 + "__id__": 63 }, "_enabled": true, "__prefab": null, @@ -2417,7 +2481,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 61 + "__id__": 63 }, "_enabled": true, "__prefab": null, @@ -2446,17 +2510,17 @@ "_name": "UI", "_objFlags": 0, "_parent": { - "__id__": 60 + "__id__": 62 }, "_children": [ { - "__id__": 74 + "__id__": 76 } ], "_active": true, "_components": [ { - "__id__": 81 + "__id__": 83 } ], "_prefab": null, @@ -2493,23 +2557,23 @@ "_name": "VirtualJoystic", "_objFlags": 0, "_parent": { - "__id__": 73 + "__id__": 75 }, "_children": [ { - "__id__": 75 + "__id__": 77 } ], "_active": true, "_components": [ - { - "__id__": 78 - }, - { - "__id__": 79 - }, { "__id__": 80 + }, + { + "__id__": 81 + }, + { + "__id__": 82 } ], "_prefab": null, @@ -2546,16 +2610,16 @@ "_name": "Knob", "_objFlags": 0, "_parent": { - "__id__": 74 + "__id__": 76 }, "_children": [], "_active": true, "_components": [ { - "__id__": 76 + "__id__": 78 }, { - "__id__": 77 + "__id__": 79 } ], "_prefab": null, @@ -2592,7 +2656,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 75 + "__id__": 77 }, "_enabled": true, "__prefab": null, @@ -2613,7 +2677,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 75 + "__id__": 77 }, "_enabled": true, "__prefab": null, @@ -2651,7 +2715,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 76 }, "_enabled": true, "__prefab": null, @@ -2672,7 +2736,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 76 }, "_enabled": true, "__prefab": null, @@ -2710,13 +2774,13 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 76 }, "_enabled": true, "__prefab": null, "maxDistance": 50, "knob": { - "__id__": 75 + "__id__": 77 }, "_id": "50ceZG62tGlYXvZWEvSDKl" }, @@ -2725,7 +2789,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 73 + "__id__": 75 }, "_enabled": true, "__prefab": null, @@ -2746,12 +2810,12 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 60 + "__id__": 62 }, "_enabled": true, "__prefab": null, "xpBar": { - "__id__": 70 + "__id__": 72 }, "_id": "bau/7eItRFrKKoAZZb/uYL" }, @@ -2760,20 +2824,20 @@ "_name": "ModalWindowManager", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [ { - "__id__": 84 + "__id__": 86 } ], "_active": true, "_components": [ { - "__id__": 95 + "__id__": 97 }, { - "__id__": 96 + "__id__": 98 } ], "_prefab": null, @@ -2809,17 +2873,17 @@ "__type__": "cc.Node", "_objFlags": 0, "_parent": { - "__id__": 83 + "__id__": 85 }, "_prefab": { - "__id__": 85 + "__id__": 87 }, "__editorExtras__": {} }, { "__type__": "cc.PrefabInfo", "root": { - "__id__": 84 + "__id__": 86 }, "asset": { "__uuid__": "663674aa-da1c-44b0-8049-49db9b020973", @@ -2827,11 +2891,11 @@ }, "fileId": "32U/bJCUBDlaQxxGFNXZTu", "instance": { - "__id__": 86 + "__id__": 88 }, "targetOverrides": [ { - "__id__": 93 + "__id__": 95 } ] }, @@ -2841,20 +2905,20 @@ "mountedChildren": [], "mountedComponents": [], "propertyOverrides": [ - { - "__id__": 87 - }, { "__id__": 89 }, - { - "__id__": 90 - }, { "__id__": 91 }, { "__id__": 92 + }, + { + "__id__": 93 + }, + { + "__id__": 94 } ], "removedComponents": [] @@ -2862,7 +2926,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 90 }, "propertyPath": [ "_name" @@ -2878,7 +2942,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 90 }, "propertyPath": [ "_lpos" @@ -2893,7 +2957,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 90 }, "propertyPath": [ "_lrot" @@ -2909,7 +2973,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 90 }, "propertyPath": [ "_euler" @@ -2924,7 +2988,7 @@ { "__type__": "CCPropertyOverrideInfo", "targetInfo": { - "__id__": 88 + "__id__": 90 }, "propertyPath": [ "_active" @@ -2941,7 +3005,7 @@ ], "target": null, "targetInfo": { - "__id__": 94 + "__id__": 96 } }, { @@ -2955,7 +3019,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 83 + "__id__": 85 }, "_enabled": true, "__prefab": null, @@ -2976,7 +3040,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 83 + "__id__": 85 }, "_enabled": true, "__prefab": null, @@ -2993,16 +3057,16 @@ "_name": "Sprite", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [], "_active": true, "_components": [ { - "__id__": 98 + "__id__": 100 }, { - "__id__": 99 + "__id__": 101 } ], "_prefab": null, @@ -3039,7 +3103,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 97 + "__id__": 99 }, "_enabled": true, "__prefab": null, @@ -3060,7 +3124,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 97 + "__id__": 99 }, "_enabled": true, "__prefab": null, @@ -3098,16 +3162,16 @@ "_name": "Sprite-001", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [], "_active": true, "_components": [ { - "__id__": 101 + "__id__": 103 }, { - "__id__": 102 + "__id__": 104 } ], "_prefab": null, @@ -3144,7 +3208,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 100 + "__id__": 102 }, "_enabled": true, "__prefab": null, @@ -3165,7 +3229,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 100 + "__id__": 102 }, "_enabled": true, "__prefab": null, @@ -3203,16 +3267,16 @@ "_name": "Sprite-002", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [], "_active": true, "_components": [ { - "__id__": 104 + "__id__": 106 }, { - "__id__": 105 + "__id__": 107 } ], "_prefab": null, @@ -3249,7 +3313,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 103 + "__id__": 105 }, "_enabled": true, "__prefab": null, @@ -3270,7 +3334,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 103 + "__id__": 105 }, "_enabled": true, "__prefab": null, @@ -3308,16 +3372,16 @@ "_name": "Sprite-003", "_objFlags": 0, "_parent": { - "__id__": 59 + "__id__": 61 }, "_children": [], "_active": true, "_components": [ { - "__id__": 107 + "__id__": 109 }, { - "__id__": 108 + "__id__": 110 } ], "_prefab": null, @@ -3354,7 +3418,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 106 + "__id__": 108 }, "_enabled": true, "__prefab": null, @@ -3375,7 +3439,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 106 + "__id__": 108 }, "_enabled": true, "__prefab": null, @@ -3413,7 +3477,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 59 + "__id__": 61 }, "_enabled": true, "__prefab": null, @@ -3482,7 +3546,7 @@ "_enabled": true, "__prefab": null, "_cameraComponent": { - "__id__": 109 + "__id__": 111 }, "_alignCanvasWithScreen": true, "_id": "12O/ljcVlEqLmVm3U2gEOQ" @@ -3526,25 +3590,25 @@ "_enabled": true, "__prefab": null, "virtualJoystic": { - "__id__": 80 - }, - "player": { - "__id__": 51 - }, - "weapon": { - "__id__": 32 - }, - "enemyManager": { - "__id__": 58 - }, - "camera": { - "__id__": 109 - }, - "gameUI": { "__id__": 82 }, + "player": { + "__id__": 53 + }, + "haloProjectiles": { + "__id__": 4 + }, + "enemyManager": { + "__id__": 60 + }, + "camera": { + "__id__": 111 + }, + "gameUI": { + "__id__": 84 + }, "modalWindowManager": { - "__id__": 96 + "__id__": 98 }, "settingsAsset": { "__uuid__": "6828fb79-0a56-437e-b718-9f43bf234fbc", @@ -3557,26 +3621,26 @@ "fileId": "cffa5b19-2043-4cef-8221-1a10ab7a2c1f", "nestedPrefabInstanceRoots": [ { - "__id__": 84 + "__id__": 86 } ] }, { "__type__": "cc.SceneGlobals", "ambient": { - "__id__": 116 - }, - "shadows": { - "__id__": 117 - }, - "_skybox": { "__id__": 118 }, - "fog": { + "shadows": { "__id__": 119 }, - "octree": { + "_skybox": { "__id__": 120 + }, + "fog": { + "__id__": 121 + }, + "octree": { + "__id__": 122 } }, { diff --git a/assets/Scripts/Game/Data/GameSettings.ts b/assets/Scripts/Game/Data/GameSettings.ts index 3004318..22b361f 100644 --- a/assets/Scripts/Game/Data/GameSettings.ts +++ b/assets/Scripts/Game/Data/GameSettings.ts @@ -1,6 +1,5 @@ export class GameSettings { public player: PlayerSettings = new PlayerSettings(); - public weapon: WeaponSettings = new WeaponSettings(); public upgrades: UpgradeSettings = new UpgradeSettings(); } @@ -9,6 +8,8 @@ export class PlayerSettings { public requiredXP: number[] = []; public regenerationDelay = 0; public collisionDelay = 0; + public weapon: WeaponSettings = new WeaponSettings(); + public haloLauncher: HaloLauncherSettings = new HaloLauncherSettings(); } export class WeaponSettings { @@ -16,10 +17,18 @@ export class WeaponSettings { public damage = 0; } +export class HaloLauncherSettings { + public projectileLifetime = 0; + public projectileSpeed = 0; + public projectilesToSpawn = 0; + public cooldown = 0; +} + export class UpgradeSettings { public maxWeaponLengthUpgrades = 0; public maxWeaponDamageUpgrades = 0; public maxHorizontalProjectileUpgrades = 0; public maxVerticalProjectileUpgrades = 0; + public maxHaloProjectileUpgrades = 0; public maxRegenerationUpgrades = 0; } diff --git a/assets/Scripts/Game/GameBootstrapper.ts b/assets/Scripts/Game/GameBootstrapper.ts index 033690a..5ab6ee4 100644 --- a/assets/Scripts/Game/GameBootstrapper.ts +++ b/assets/Scripts/Game/GameBootstrapper.ts @@ -10,8 +10,9 @@ import { GameModalLauncher } from "./ModalWIndows/GameModalLauncher"; import { Pauser } from "./Pauser"; import { GameUI } from "./UI/GameUI"; import { EnemyManager } from "./Unit/Enemy/EnemyManager"; +import { HaloProjectileLauncher } from "./Unit/Player/Halo/HaloProjectileLauncher"; import { Player } from "./Unit/Player/Player"; -import { Weapon } from "./Unit/Player/Weapon/Weapon"; + import { Upgrader } from "./Upgrades/Upgrader"; const { ccclass, property } = _decorator; @@ -20,7 +21,7 @@ const { ccclass, property } = _decorator; export class GameBootstrapper extends Component { @property(VirtualJoystic) private virtualJoystic: VirtualJoystic; @property(Player) private player: Player; - @property(Weapon) private weapon: Weapon; + @property(HaloProjectileLauncher) private haloProjectiles: HaloProjectileLauncher; @property(EnemyManager) private enemyManager: EnemyManager; @property(Camera) private camera: Camera; @property(GameUI) private gameUI: GameUI; @@ -35,20 +36,23 @@ export class GameBootstrapper extends Component { const settings: GameSettings = this.settingsAsset.json; this.virtualJoystic.init(); - this.weapon.init(settings.weapon); + const wasd = new KeyboardInput(KeyCode.KEY_W, KeyCode.KEY_S, KeyCode.KEY_A, KeyCode.KEY_D); const arrowKeys = new KeyboardInput(KeyCode.ARROW_UP, KeyCode.ARROW_DOWN, KeyCode.ARROW_LEFT, KeyCode.ARROW_RIGHT); const dualInput: MultiInput = new MultiInput([this.virtualJoystic, wasd, arrowKeys]); - this.player.init(dualInput, this.weapon, settings.player); + this.player.init(dualInput, settings.player); this.playerCollisionSystem = new PlayerCollisionSystem(this.player, settings.player.collisionDelay); - new WeaponCollisionSystem(this.weapon); + new WeaponCollisionSystem(this.player.Weapon); const upgrader = new Upgrader(this.player, settings.upgrades); new GameModalLauncher(this.modalWindowManager, this.player, this.gamePauser, upgrader); this.enemyManager.init(this.player.node); + this.haloProjectiles.init(this.player.node, settings.player.haloLauncher); + this.haloProjectiles.upgrade(); + this.gameUI.init(this.player); } @@ -58,6 +62,7 @@ export class GameBootstrapper extends Component { this.player.gameTick(deltaTime); this.playerCollisionSystem.gameTick(deltaTime); this.enemyManager.gameTick(deltaTime); + this.haloProjectiles.gameTick(deltaTime); this.camera.node.worldPosition = this.player.node.worldPosition; } diff --git a/assets/Scripts/Game/Unit/Player/Halo.meta b/assets/Scripts/Game/Unit/Player/Halo.meta new file mode 100644 index 0000000..4f2d755 --- /dev/null +++ b/assets/Scripts/Game/Unit/Player/Halo.meta @@ -0,0 +1,12 @@ +{ + "ver": "1.1.0", + "importer": "directory", + "imported": true, + "uuid": "b89dc5a7-3450-47e4-bc36-ae5d08f4bc89", + "files": [], + "subMetas": {}, + "userData": { + "compressionType": {}, + "isRemoteBundle": {} + } +} diff --git a/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts b/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts new file mode 100644 index 0000000..983f73b --- /dev/null +++ b/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts @@ -0,0 +1,97 @@ +import { Component, Prefab, Vec2, Vec3, _decorator, Node } from "cc"; +import { GameTimer } from "../../../../Services/GameTimer"; +import { ObjectPool } from "../../../../Services/ObjectPool"; +import { roundToOneDecimal } from "../../../../Services/Utils/MathUtils"; +import { HaloLauncherSettings } from "../../../Data/GameSettings"; +import { PlayerProjectile } from "./PlayerProjectile"; +const { ccclass, property } = _decorator; + +@ccclass("HaloProjectileLauncher") +export class HaloProjectileLauncher extends Component { + @property(Prefab) private projectilePrefab: Prefab; + private fireTimer: GameTimer; + private lifetimeTimer: GameTimer; + private projectilesToSpawn: number; + private defaultCooldown: number; + private speed: number; + private currentLevel = 0; + + private isFiring = false; + + private projectilePool: ObjectPool; + private projectiles: PlayerProjectile[] = []; + private directions: Vec2[] = []; + + private playerNode: Node; + + public init(playerNode: Node, settings: HaloLauncherSettings): void { + this.playerNode = playerNode; + this.projectilesToSpawn = settings.projectilesToSpawn; + this.projectilePool = new ObjectPool(this.projectilePrefab, this.node, this.projectilesToSpawn, "PlayerProjectile"); + + this.speed = settings.projectileSpeed; + this.defaultCooldown = settings.cooldown; + this.lifetimeTimer = new GameTimer(settings.projectileLifetime); + this.fireTimer = new GameTimer(this.defaultCooldown); + + const angle: number = (2 * Math.PI) / this.projectilesToSpawn; + + for (let i = 0; i < this.projectilesToSpawn; i++) { + const x: number = roundToOneDecimal(Math.sin(angle * i)); + const y: number = roundToOneDecimal(Math.cos(angle * i)); + this.directions.push(new Vec2(x, y).normalize()); + } + } + + public upgrade(): void { + this.currentLevel++; + this.fireTimer = new GameTimer(this.defaultCooldown - this.currentLevel); + } + + public gameTick(deltaTime: number): void { + if (this.currentLevel == 0) return; + + this.fireTimer.gameTick(deltaTime); + if (this.isFiring) { + this.moveAllProjectiles(deltaTime); + this.tryRemoveAllProjectiles(deltaTime); + } else { + if (this.fireTimer.tryFinishPeriod()) { + this.fireProjectiles(); + } + } + } + + private fireProjectiles(): void { + for (let index = 0; index < this.projectilesToSpawn; index++) { + const projectile: PlayerProjectile = this.projectilePool.borrow(); + projectile.node.setWorldPosition(this.playerNode.worldPosition); + projectile.node.active = true; + this.projectiles.push(projectile); + } + + this.isFiring = true; + } + + private moveAllProjectiles(deltaTime: number): void { + for (let i = 0; i < this.projectiles.length; i++) { + const newPosition: Vec3 = this.projectiles[i].node.worldPosition; + newPosition.x += this.directions[i].x * deltaTime * this.speed; + newPosition.y += this.directions[i].y * deltaTime * this.speed; + + this.projectiles[i].node.setWorldPosition(newPosition); + } + } + + private tryRemoveAllProjectiles(deltaTime: number): void { + this.lifetimeTimer.gameTick(deltaTime); + if (this.lifetimeTimer.tryFinishPeriod()) { + for (const projectile of this.projectiles) { + this.projectilePool.return(projectile); + } + + this.projectiles = []; + this.isFiring = false; + } + } +} diff --git a/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts.meta b/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts.meta new file mode 100644 index 0000000..245e007 --- /dev/null +++ b/assets/Scripts/Game/Unit/Player/Halo/HaloProjectileLauncher.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "422b46ec-3e15-437d-97fc-7f44a277c3be", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts b/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts new file mode 100644 index 0000000..43fb2d6 --- /dev/null +++ b/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts @@ -0,0 +1,14 @@ +import { _decorator, Component, Node } from 'cc'; +const { ccclass, property } = _decorator; + +@ccclass('PlayerProjectile') +export class PlayerProjectile extends Component { + start() { + + } + + update(deltaTime: number) { + + } +} + diff --git a/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts.meta b/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts.meta new file mode 100644 index 0000000..0454033 --- /dev/null +++ b/assets/Scripts/Game/Unit/Player/Halo/PlayerProjectile.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "6a24e600-866b-4c0d-9a39-59bf222c2e50", + "files": [], + "subMetas": {}, + "userData": {} +} diff --git a/assets/Scripts/Game/Unit/Player/Player.ts b/assets/Scripts/Game/Unit/Player/Player.ts index c2437b0..378f46e 100644 --- a/assets/Scripts/Game/Unit/Player/Player.ts +++ b/assets/Scripts/Game/Unit/Player/Player.ts @@ -14,22 +14,20 @@ export class Player extends Component { @property private speed = 0; @property(BoxCollider2D) private collider: BoxCollider2D; @property(PlayerUI) private playerUI: PlayerUI; + @property(Weapon) private weapon: Weapon; private input: IInput; - private weapon: Weapon; private health: UnitHealth; private level: UnitLevel; private regeneration: PlayerRegeneration; - public init(input: IInput, weapon: Weapon, settings: PlayerSettings): void { + public init(input: IInput, settings: PlayerSettings): void { this.input = input; - this.weapon = weapon; this.health = new UnitHealth(settings.defaultHP); this.level = new UnitLevel(settings.requiredXP); this.regeneration = new PlayerRegeneration(this.health, settings.regenerationDelay); - this.weapon.node.parent = this.node; - this.weapon.node.setPosition(new Vec3()); + this.weapon.init(settings.weapon); this.playerUI.init(this.health); } diff --git a/assets/Scripts/Services/Utils/MathUtils.ts b/assets/Scripts/Services/Utils/MathUtils.ts new file mode 100644 index 0000000..76a2786 --- /dev/null +++ b/assets/Scripts/Services/Utils/MathUtils.ts @@ -0,0 +1,3 @@ +export function roundToOneDecimal(num: number): number { + return Math.round(num * 10) / 10; +} diff --git a/assets/Scripts/Services/Utils/MathUtils.ts.meta b/assets/Scripts/Services/Utils/MathUtils.ts.meta new file mode 100644 index 0000000..f12440b --- /dev/null +++ b/assets/Scripts/Services/Utils/MathUtils.ts.meta @@ -0,0 +1,9 @@ +{ + "ver": "4.0.23", + "importer": "typescript", + "imported": true, + "uuid": "93ac2648-b208-4662-911a-688684084e2a", + "files": [], + "subMetas": {}, + "userData": {} +}