From 3576a2e2a09a8d46f22e1de136f82aef92fc2759 Mon Sep 17 00:00:00 2001 From: Mohammad_Hasan Date: Tue, 28 Oct 2025 16:32:18 +0400 Subject: [PATCH] [Add]: Enemies Waves --- assets/Level.fire | 1696 +++++++++++++++++++++++++++++++ assets/Level.fire.meta | 7 + assets/Menu.fire | 314 +++++- assets/Scripts/EnemyShip.ts | 10 +- assets/Scripts/Game.ts | 33 +- assets/Scripts/MenuBg.ts | 1 + assets/Scripts/SwitchScreens.ts | 23 +- assets/play.png | Bin 6235 -> 0 bytes assets/play.png.meta | 34 - 9 files changed, 2042 insertions(+), 76 deletions(-) create mode 100644 assets/Level.fire create mode 100644 assets/Level.fire.meta delete mode 100644 assets/play.png delete mode 100644 assets/play.png.meta diff --git a/assets/Level.fire b/assets/Level.fire new file mode 100644 index 0000000..0d7bdc0 --- /dev/null +++ b/assets/Level.fire @@ -0,0 +1,1696 @@ +[ + { + "__type__": "cc.SceneAsset", + "_name": "", + "_objFlags": 0, + "_native": "", + "scene": { + "__id__": 1 + } + }, + { + "__type__": "cc.Scene", + "_objFlags": 0, + "_parent": null, + "_children": [ + { + "__id__": 2 + } + ], + "_active": true, + "_level": 0, + "_components": [], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_is3DNode": true, + "groupIndex": 0, + "autoReleaseAssets": false, + "_id": "3eba991d-703c-4c11-ac81-b6548a4722ec" + }, + { + "__type__": "cc.Node", + "_name": "Canvas", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 3 + }, + { + "__id__": 5 + }, + { + "__id__": 13 + }, + { + "__id__": 20 + }, + { + "__id__": 27 + } + ], + "_active": true, + "_level": 0, + "_components": [ + { + "__id__": 34 + }, + { + "__id__": 35 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 480, + "y": 320, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1.5, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "6d4xc1O9tBS4K2FKSyFy0A" + }, + { + "__type__": "cc.Node", + "_name": "Main Camera", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 4 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 780.2888888097792 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "432KSKzAtGd6zTgrp6/80v" + }, + { + "__type__": "cc.Camera", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 3 + }, + "_enabled": true, + "_cullingMask": 4294967295, + "_clearFlags": 7, + "_backgroundColor": { + "__type__": "cc.Color", + "r": 0, + "g": 0, + "b": 0, + "a": 255 + }, + "_depth": -1, + "_zoomRatio": 1, + "_targetTexture": null, + "_fov": 60, + "_orthoSize": 10, + "_nearClip": 1, + "_farClip": 4096, + "_ortho": true, + "_rect": { + "__type__": "cc.Rect", + "x": 0, + "y": 0, + "width": 1, + "height": 1 + }, + "_renderStages": 1, + "_id": "c02wZQVdxEEoIr8xYY7o0Z" + }, + { + "__type__": "cc.Node", + "_name": "button", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 6 + } + ], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 11 + }, + { + "__id__": 12 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 150, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 0.66667, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "13N9ltkJ5Iebknk0zh7MLp" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 7 + } + ], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 9 + }, + { + "__id__": 10 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 26, + "g": 26, + "b": 26, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "9b7un7DoFAjLZvYW4T4kHQ" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 6 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 8 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "a9kXSrf3xEvIZnQeu9cU8H" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "Easy", + "_N$string": "Easy", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_isUseVerticalKerning": true, + "_verticalKerning": null, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "93V9JewbtLcbxii2PchDnA" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 6 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "60/S55/YZHwatxCzlOfqUG" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 6 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "f1Q51qGnpJyKH2Do41e4AG" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 6 + }, + "_id": "f0IHoTsa9JbaCKLuhzu4sQ" + }, + { + "__type__": "3a2abJhRaJFyrM9SBg5rWtB", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "_id": "beLSO4FQ9EHpsN/cSPuwIz" + }, + { + "__type__": "cc.Node", + "_name": "button", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 14 + } + ], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 19 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 50, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 0.66667, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "70X3X0avdJBbpRCDgVckwC" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 13 + }, + "_children": [ + { + "__id__": 15 + } + ], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 17 + }, + { + "__id__": 18 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 26, + "g": 26, + "b": 26, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "deYiE1DbFJQ7E39gJPvU80" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 14 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 16 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "fakBT1isJH8ZGI5Un0laDN" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 15 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "Medium", + "_N$string": "Medium", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_isUseVerticalKerning": true, + "_verticalKerning": null, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "64DPyZV/BHo7KZSczqXJdt" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 14 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "cbUXQ9SXxBfrdd+uOeeXZ+" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 14 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "12IcpMuptCcZm2QgttjUH+" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 13 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 14 + }, + "_id": "26wq34PNZHVIy0AG+mYHqX" + }, + { + "__type__": "cc.Node", + "_name": "button", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 21 + } + ], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 26 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": -50, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 0.66667, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "98BRC//SdMYJ318TurvOkH" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 20 + }, + "_children": [ + { + "__id__": 22 + } + ], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 24 + }, + { + "__id__": 25 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 26, + "g": 26, + "b": 26, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "c2gjIVzFlB3YVekoGZL9Dx" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 21 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 23 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "c5hA0EmRxKgbDjEnfFwrFg" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 22 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "Hard", + "_N$string": "Hard", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_isUseVerticalKerning": true, + "_verticalKerning": null, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "69VrW4FQJMTJzLDY+HciHa" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "32phHkN9ZO4aUzVv2QPN1Y" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 21 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "f3c5sTtttN+JnNfo1fwwXp" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 20 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 21 + }, + "_id": "f8is4J+KZG66QUsc4/ge0G" + }, + { + "__type__": "cc.Node", + "_name": "button", + "_objFlags": 0, + "_parent": { + "__id__": 2 + }, + "_children": [ + { + "__id__": 28 + } + ], + "_active": true, + "_level": 1, + "_components": [ + { + "__id__": 33 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": -150, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 0.66667, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "b6NqRVMPFM9IT0S46cYgpb" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 27 + }, + "_children": [ + { + "__id__": 29 + } + ], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 31 + }, + { + "__id__": 32 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 26, + "g": 26, + "b": 26, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 108 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "a2Pa0fKnZKfYWCszhdHr3V" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 28 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 30 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "03MPmszrtDGoC+6GLE4pcT" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 29 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "Nightmare", + "_N$string": "Nightmare", + "_fontSize": 40, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_isUseVerticalKerning": true, + "_verticalKerning": null, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "71IAq89+JPcIlSGHWbNTBI" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_type": 1, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "69J1V1z5hEZpMIvioAun8A" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 28 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "79aUhMJ+JFTrCLkQoTIsj7" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 27 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 28 + }, + "_id": "07Xool7WZN8ovK0H1mRfer" + }, + { + "__type__": "cc.Canvas", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "_designResolution": { + "__type__": "cc.Size", + "width": 960, + "height": 640 + }, + "_fitWidth": true, + "_fitHeight": true, + "_id": "e2gz2maPBOAJm7f/2s7v8j" + }, + { + "__type__": "19aaeSYSZZGULvtl5gcIKyn", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 2 + }, + "_enabled": true, + "protonSM": { + "__uuid__": "59b8f7eb-f327-47e0-aa01-42ecad377557" + }, + "protonMD": { + "__uuid__": "75af4f59-790b-4c40-ba2e-54ffc1cc3c23" + }, + "protonLG": { + "__uuid__": "9c3d7d56-f77a-4e1f-a64c-865e00c80cff" + }, + "_id": "8dK9bnJ2JCt4TbPD5ysSKm" + } +] \ No newline at end of file diff --git a/assets/Level.fire.meta b/assets/Level.fire.meta new file mode 100644 index 0000000..a70d5a5 --- /dev/null +++ b/assets/Level.fire.meta @@ -0,0 +1,7 @@ +{ + "ver": "1.2.1", + "uuid": "3eba991d-703c-4c11-ac81-b6548a4722ec", + "asyncLoadAssets": false, + "autoReleaseAssets": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Menu.fire b/assets/Menu.fire index 6460c9a..b467a94 100644 --- a/assets/Menu.fire +++ b/assets/Menu.fire @@ -69,10 +69,10 @@ "_level": 1, "_components": [ { - "__id__": 8 + "__id__": 14 }, { - "__id__": 9 + "__id__": 15 } ], "_prefab": null, @@ -156,7 +156,7 @@ "__type__": "cc.Vec3", "x": 0, "y": 0, - "z": 876.417708629852 + "z": 780.2888888097792 }, "_scale": { "__type__": "cc.Vec3", @@ -213,20 +213,24 @@ }, { "__type__": "cc.Node", - "_name": "play", + "_name": "button", "_objFlags": 0, "_parent": { "__id__": 2 }, - "_children": [], + "_children": [ + { + "__id__": 6 + } + ], "_active": true, "_level": 2, "_components": [ { - "__id__": 6 + "__id__": 11 }, { - "__id__": 7 + "__id__": 13 } ], "_prefab": null, @@ -241,7 +245,7 @@ "_contentSize": { "__type__": "cc.Size", "width": 416, - "height": 108 + "height": 148 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -257,7 +261,7 @@ "_scale": { "__type__": "cc.Vec3", "x": 1, - "y": 0.66, + "y": 0.44445, "z": 1 }, "_eulerAngles": { @@ -270,14 +274,169 @@ "_skewY": 0, "_is3DNode": false, "groupIndex": 0, - "_id": "9c/kR6zopOCq2Elgf3X+l+" + "_id": "69HYmEC4hC1aoSBRgg0FAJ" + }, + { + "__type__": "cc.Node", + "_name": "Background", + "_objFlags": 0, + "_parent": { + "__id__": 5 + }, + "_children": [ + { + "__id__": 7 + } + ], + "_active": true, + "_level": 2, + "_components": [ + { + "__id__": 9 + }, + { + "__id__": 10 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 26, + "g": 26, + "b": 26, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 416, + "height": 148 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "a3huG/zeRBTLCQROSq3ztB" + }, + { + "__type__": "cc.Node", + "_name": "Label", + "_objFlags": 0, + "_parent": { + "__id__": 6 + }, + "_children": [], + "_active": true, + "_level": 3, + "_components": [ + { + "__id__": 8 + } + ], + "_prefab": null, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 200, + "height": 100 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_position": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_scale": { + "__type__": "cc.Vec3", + "x": 1, + "y": 1, + "z": 1 + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "groupIndex": 0, + "_id": "f7ZK1FmCpCZ5ivVxgV+zW0" + }, + { + "__type__": "cc.Label", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 7 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_useOriginalSize": false, + "_string": "START", + "_N$string": "START", + "_fontSize": 50, + "_lineHeight": 40, + "_enableWrapText": false, + "_N$file": null, + "_isSystemFontUsed": true, + "_isUseVerticalKerning": true, + "_verticalKerning": null, + "_spacingX": 0, + "_batchAsBitmap": false, + "_N$horizontalAlign": 1, + "_N$verticalAlign": 1, + "_N$fontFamily": "Arial", + "_N$overflow": 1, + "_N$cacheMode": 0, + "_id": "e35+dINdxC/49nsWhSHhH3" }, { "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 5 + "__id__": 6 }, "_enabled": true, "_materials": [ @@ -288,10 +447,10 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "983fa58a-66aa-4526-a54d-dc95037f1259" + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" }, - "_type": 0, - "_sizeMode": 1, + "_type": 1, + "_sizeMode": 0, "_fillType": 0, "_fillCenter": { "__type__": "cc.Vec2", @@ -302,7 +461,128 @@ "_fillRange": 0, "_isTrimmedMode": true, "_atlas": null, - "_id": "3bA5w73CpHDrHFTBeG9DGv" + "_id": "6d7ZTBMFxAvrmL5zbdC4vz" + }, + { + "__type__": "cc.Widget", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 6 + }, + "_enabled": true, + "alignMode": 0, + "_target": null, + "_alignFlags": 45, + "_left": 0, + "_right": 0, + "_top": 0, + "_bottom": 0, + "_verticalCenter": 0, + "_horizontalCenter": 0, + "_isAbsLeft": true, + "_isAbsRight": true, + "_isAbsTop": true, + "_isAbsBottom": true, + "_isAbsHorizontalCenter": true, + "_isAbsVerticalCenter": true, + "_originalWidth": 100, + "_originalHeight": 40, + "_id": "65HbE6twJMupjXdRg8qNia" + }, + { + "__type__": "cc.Button", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 5 + }, + "_enabled": true, + "duration": 0.1, + "zoomScale": 1.2, + "clickEvents": [ + { + "__id__": 12 + } + ], + "_N$interactable": true, + "_N$enableAutoGrayEffect": false, + "_N$transition": 2, + "transition": 2, + "_N$normalColor": { + "__type__": "cc.Color", + "r": 230, + "g": 230, + "b": 230, + "a": 255 + }, + "_N$pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "pressedColor": { + "__type__": "cc.Color", + "r": 200, + "g": 200, + "b": 200, + "a": 255 + }, + "_N$hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "hoverColor": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_N$disabledColor": { + "__type__": "cc.Color", + "r": 120, + "g": 120, + "b": 120, + "a": 200 + }, + "_N$normalSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "pressedSprite": { + "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a" + }, + "_N$hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "hoverSprite": { + "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952" + }, + "_N$disabledSprite": { + "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e" + }, + "_N$target": { + "__id__": 6 + }, + "_id": "04Dqh37IRDyLnnoepjmU10" + }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 5 + }, + "component": "", + "_componentId": "3a2abJhRaJFyrM9SBg5rWtB", + "handler": "loadLevelsScene", + "customEventData": "" }, { "__type__": "3a2abJhRaJFyrM9SBg5rWtB", @@ -312,9 +592,7 @@ "__id__": 5 }, "_enabled": true, - "label": null, - "text": "hello", - "_id": "c9ABQ2655OSa44WE6gYPfI" + "_id": "b1l7jFcrZGValOGBcgRpBB" }, { "__type__": "cc.Canvas", diff --git a/assets/Scripts/EnemyShip.ts b/assets/Scripts/EnemyShip.ts index 909d128..31f997b 100644 --- a/assets/Scripts/EnemyShip.ts +++ b/assets/Scripts/EnemyShip.ts @@ -13,8 +13,9 @@ const {ccclass, property} = cc._decorator; @ccclass export default class NewClass extends cc.Component { - duratrion : number = 15; - moveAmountY : number = 25; + duratrion : number = 2.5; + moveAmountX : number = 0; + RTL: boolean = false; moveEnemy : cc.ActionInterval; @@ -26,8 +27,9 @@ export default class NewClass extends cc.Component { playAnimation : Boolean = true; setMovements() { - var moveDown = cc.moveBy(this.duratrion, cc.v2(0, -this.node.parent.getContentSize().height * 0.95)); - this.node.runAction(cc.repeatForever(moveDown)); + var moveLeft = cc.moveBy(this.duratrion, cc.v2(-this.moveAmountX, -this.node.parent.getContentSize().height * 0.32)); + var moveRight = cc.moveBy(this.duratrion, cc.v2(this.moveAmountX, -this.node.parent.getContentSize().height * 0.32)); + this.node.runAction(cc.repeatForever(this.RTL ? cc.sequence(moveRight, moveLeft) : cc.sequence(moveLeft, moveRight))); } shootBullets() { diff --git a/assets/Scripts/Game.ts b/assets/Scripts/Game.ts index e66deb0..8f57843 100644 --- a/assets/Scripts/Game.ts +++ b/assets/Scripts/Game.ts @@ -24,11 +24,32 @@ export default class NewClass extends cc.Component { spawnShips() { var ships = [this.alienship1, this.alienship2, this.alienship3]; - var ship = cc.instantiate(ships[Math.floor(Math.random() * ships.length)]); - const shipX = Math.random() * 800 - 400; + var randomShip = Math.floor(Math.random() * ships.length); + var RTL = Math.random() < 0.5; + var shipPrefab = ships[randomShip]; + + const batchMoveAmountX = Math.random() * 200 + 200; + const shipY = this.node.getContentSize().height * 0.95; - ship.setPosition(shipX, shipY); - this.node.addChild(ship); + + const screenHalfWidth = this.node.getContentSize().width / 2; + const shipMaxMove = batchMoveAmountX; + const margin = 0; + const shipXMin = -screenHalfWidth + shipMaxMove + margin; + const shipXMax = screenHalfWidth - shipMaxMove - margin; + const shipX = Math.random() * (shipXMax - shipXMin) + shipXMin; + + for (let i = 0; i < 12; i++) { + this.scheduleOnce(() => { + const ship = cc.instantiate(shipPrefab); + ship.setPosition(shipX, shipY); + this.node.addChild(ship); + + const shipScript = ship.getComponent('EnemyShip'); + shipScript.moveAmountX = batchMoveAmountX; + shipScript.RTL = RTL; + }, i * 0.5); + } } onLoad () { @@ -37,8 +58,8 @@ export default class NewClass extends cc.Component { } start () { - this.schedule(this.spawnShips, 1, cc.macro.REPEAT_FOREVER, 1); + this.schedule(this.spawnShips, 5, cc.macro.REPEAT_FOREVER, 1); } // update (dt) {} -} +} \ No newline at end of file diff --git a/assets/Scripts/MenuBg.ts b/assets/Scripts/MenuBg.ts index 4ac9a51..af39fb1 100644 --- a/assets/Scripts/MenuBg.ts +++ b/assets/Scripts/MenuBg.ts @@ -30,6 +30,7 @@ export default class NewClass extends cc.Component { const protonX = Math.random() * this.node.getContentSize().width - this.node.getContentSize().width / 2; const protonY = this.node.getContentSize().height; proton.setPosition(protonX, protonY); + proton.zIndex = -1; this.node.addChild(proton); } diff --git a/assets/Scripts/SwitchScreens.ts b/assets/Scripts/SwitchScreens.ts index 0412077..ea45a72 100644 --- a/assets/Scripts/SwitchScreens.ts +++ b/assets/Scripts/SwitchScreens.ts @@ -13,20 +13,15 @@ const {ccclass, property} = cc._decorator; @ccclass export default class NewClass extends cc.Component { - @property(cc.Label) - label: cc.Label = null; + loadLevelsScene() { + cc.director.preloadScene('Level', () => { + cc.director.loadScene('Level'); + }); + } - @property - text: string = 'hello'; - - // LIFE-CYCLE CALLBACKS: - - // onLoad () {} - - start () { - cc.director.preloadScene('Game'); - this.node.on('touchstart', () => { - cc.director.loadScene('Game'); - }, this); + loadGameScene(event, customData) { + cc.director.preloadScene('Level', () => { + cc.director.loadScene('Level'); + }); } } diff --git a/assets/play.png b/assets/play.png deleted file mode 100644 index 75302ebd2122d2991a95baa6a8b50d3f00a3642f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6235 zcmcI}g;!KvxcAT{t>n-MynwVYf`l-Hh=g>Qa%K2{H)%cO^*l74tvtNV-Cjeyy}kKto$TEa z<}R=KoZYN5cAwHgAk;I@;m@>uGI!?fwX~*Z@%HZon3*w=Fifm__?T17Cscw8d9{yy zBCuJ;Y3|Pz5HnkRe(bvaeo|zHqmP~|6ysg&TkRZ+@+v+aWPS)y=rnUE7aNzGrVN=m z%>pTJK;AQJ(vfswYo8$d3;EM0n`)s)`{S%FCDLc6NmB z?(Q@+$5UH%b)sDN32W-=WJ|O@H#X8L7f_HgK9!M^!`fYJPq@7F)6&*nKHd3MTu~7z zn>%K+%OV%qF)^W)w|W2l#)g&Zh`ps{c&=Pjsb}1)61crR52vq5N>!Dhii(PepQ`aq z(4$9>F5){f`V*M)s;iUsXe#0CDa!umB)PVD`OZFc-6dVX?-Sg@yQvii#rn67YB@Cnsvb1Yf><=|<9v zx$Mk6uBoqgPsM^bEwo%5f9UDl;19kaI^A0w^^Vj1Jk5|87KW9|s~;*KOZAK+$@XL} zGBVP|-90QL;}?oltl(9QVZBpsem?f*Xm!_QXTWDov5HHIdiUlHhLMrc(#i^EaBwhJit_dOYQn(KPxl6 zWar>um5`tZbC@bwK`~)rVfpy@EafFgbur!U6WI1NZxf4kvh}rDD7y04CbV$4|*Zqc|8}T)_C*ZZa&>9Pt z6kVXTwUP|eVw!eaW4Sa>+}IW3XfR^nn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