Commit f8fd2e42 authored by haiyoucuv's avatar haiyoucuv

上传

parent 520ca91d
This diff is collapsed.
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
"imageUuidOrDatabaseUri": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab", "imageUuidOrDatabaseUri": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,102 +31,10 @@ ...@@ -31,102 +31,10 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@f9941",
"displayName": "1",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@6c48a", "redirect": "5cd68bd9-12b8-4f3a-8561-6f04bee36fab@6c48a",
......
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "mirrored-repeat",
"wrapModeT": "clamp-to-edge", "wrapModeT": "mirrored-repeat",
"imageUuidOrDatabaseUri": "ddac7794-c7a4-48c5-af61-9b423244cd56", "imageUuidOrDatabaseUri": "ddac7794-c7a4-48c5-af61-9b423244cd56",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,104 +31,13 @@ ...@@ -31,104 +31,13 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "ddac7794-c7a4-48c5-af61-9b423244cd56@f9941",
"displayName": "2",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a" "redirect": "ddac7794-c7a4-48c5-af61-9b423244cd56@6c48a",
"flipVertical": false
} }
} }
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "mirrored-repeat",
"wrapModeT": "clamp-to-edge", "wrapModeT": "mirrored-repeat",
"imageUuidOrDatabaseUri": "e2d279b1-9efa-4892-9fda-ec634890607a", "imageUuidOrDatabaseUri": "e2d279b1-9efa-4892-9fda-ec634890607a",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,104 +31,13 @@ ...@@ -31,104 +31,13 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "e2d279b1-9efa-4892-9fda-ec634890607a@f9941",
"displayName": "3",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a" "redirect": "e2d279b1-9efa-4892-9fda-ec634890607a@6c48a",
"flipVertical": false
} }
} }
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "mirrored-repeat",
"wrapModeT": "clamp-to-edge", "wrapModeT": "mirrored-repeat",
"imageUuidOrDatabaseUri": "5f469da0-8050-49f7-b1ee-f0c22b0d417c", "imageUuidOrDatabaseUri": "5f469da0-8050-49f7-b1ee-f0c22b0d417c",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,104 +31,13 @@ ...@@ -31,104 +31,13 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@f9941",
"displayName": "4",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a" "redirect": "5f469da0-8050-49f7-b1ee-f0c22b0d417c@6c48a",
"flipVertical": false
} }
} }
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "mirrored-repeat",
"wrapModeT": "clamp-to-edge", "wrapModeT": "mirrored-repeat",
"imageUuidOrDatabaseUri": "ce62197d-60bb-42b0-9956-41a4dd6d8f02", "imageUuidOrDatabaseUri": "ce62197d-60bb-42b0-9956-41a4dd6d8f02",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,104 +31,13 @@ ...@@ -31,104 +31,13 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@f9941",
"displayName": "5",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a" "redirect": "ce62197d-60bb-42b0-9956-41a4dd6d8f02@6c48a",
"flipVertical": false
} }
} }
...@@ -15,13 +15,13 @@ ...@@ -15,13 +15,13 @@
"id": "6c48a", "id": "6c48a",
"name": "texture", "name": "texture",
"userData": { "userData": {
"wrapModeS": "clamp-to-edge", "wrapModeS": "mirrored-repeat",
"wrapModeT": "clamp-to-edge", "wrapModeT": "mirrored-repeat",
"imageUuidOrDatabaseUri": "69e69ee3-3317-4297-ba6d-9e4689622de0", "imageUuidOrDatabaseUri": "69e69ee3-3317-4297-ba6d-9e4689622de0",
"isUuid": true, "isUuid": true,
"visible": false, "visible": false,
"minfilter": "linear", "minfilter": "nearest",
"magfilter": "linear", "magfilter": "nearest",
"mipfilter": "none", "mipfilter": "none",
"anisotropy": 0 "anisotropy": 0
}, },
...@@ -31,104 +31,13 @@ ...@@ -31,104 +31,13 @@
".json" ".json"
], ],
"subMetas": {} "subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "69e69ee3-3317-4297-ba6d-9e4689622de0@f9941",
"displayName": "6",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 8583,
"height": 2112,
"rawWidth": 8583,
"rawHeight": 2112,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-4291.5,
-1056,
0,
4291.5,
-1056,
0,
-4291.5,
1056,
0,
4291.5,
1056,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
2112,
8583,
2112,
0,
0,
8583,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-4291.5,
-1056,
0
],
"maxPos": [
4291.5,
1056,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
} }
}, },
"userData": { "userData": {
"type": "sprite-frame", "type": "texture",
"hasAlpha": false, "hasAlpha": false,
"fixAlphaTransparencyArtifacts": false, "fixAlphaTransparencyArtifacts": false,
"redirect": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a" "redirect": "69e69ee3-3317-4297-ba6d-9e4689622de0@6c48a",
"flipVertical": false
} }
} }
{
"__type__": "cc.Material",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
"_effectAsset": {
"__uuid__": "c8f66d17-351a-48da-a12c-0212d28575c4",
"__expectedType__": "cc.EffectAsset"
},
"_techIdx": 0,
"_defines": [
{
"USE_INSTANCING": true
},
{},
{},
{},
{},
{}
],
"_states": [
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
},
{
"rasterizerState": {},
"depthStencilState": {},
"blendState": {
"targets": [
{}
]
}
}
],
"_props": [
{
"roughness": 1,
"specularIntensity": 0,
"emissive": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"emissiveScale": {
"__type__": "cc.Vec3",
"x": 0.025,
"y": 0.025,
"z": 0.025
}
},
{},
{},
{},
{},
{}
]
}
\ No newline at end of file
{"ver":"1.0.21","importer":"material","imported":true,"uuid":"70aede3c-4375-42c6-abc9-54a869f7adba","files":[".json"],"subMetas":{},"userData":{}}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "50650cb7-af92-4041-93d7-e8d9a7fa446d",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "Wall2"
}
}
...@@ -22,8 +22,8 @@ export class Bg extends Component { ...@@ -22,8 +22,8 @@ export class Bg extends Component {
} }
update(dt: number) { update(dt: number) {
this.node.setPosition(0, -this.camera.position.y, this.initZ); this.camera.position && this.node.setPosition(0, -this.camera.position.y, this.initZ);
this.material.setProperty( this.player.position && this.material.setProperty(
'tilingOffset', 'tilingOffset',
v4(1, 1, -this.player.position.z / 100, 0) v4(1, 1, -this.player.position.z / 100, 0)
); );
......
import { color, Color } from "cc";
export const MainColor = [
new Color().fromHEX(0x0022D1),
new Color().fromHEX(0x17328c),
];
let mainColor = MainColor.splice(0, 1)[0];
export function randomManColor() {
const index = Math.floor(Math.random() * MainColor.length);
mainColor = MainColor.splice(index, 1, mainColor)[0];
return mainColor;
}
export enum PROP_TYPE {
LIGHT,
RING,
}
\ No newline at end of file
...@@ -9,27 +9,36 @@ import { ...@@ -9,27 +9,36 @@ import {
instantiate, instantiate,
ITriggerEvent, ITriggerEvent,
Label, lerp, Label, lerp,
Light, Light, MeshRenderer,
Node, Node,
ParticleSystem, ParticleSystemComponent, ParticleSystem, ParticleSystemComponent,
PhysicsSystem, PhysicsSystem,
PointToPointConstraint, PointToPointConstraint,
Prefab, Prefab,
RigidBody, RigidBody, Texture2D,
Tween, Tween,
tween, tween,
v3, v3,
Vec3, Vec3,
} from "cc"; } from "cc";
import Scene from "db://assets/Module/Scene"; import Scene from "db://assets/Module/Scene";
import { ImprovedNoise } from "../../Utils/ImprovedNoise";
import { Wall } from "./Wall"; import { Wall } from "./Wall";
import { sleep } from "../../Utils/Utils"; import { sleep } from "../../Utils/Utils";
import { randomManColor } from "./Config";
import GameMgr from "../../GameMgr"; import GameMgr from "../../GameMgr";
const {ccclass, property} = _decorator; const {ccclass, property} = _decorator;
@ccclass(`BgAndColor`)
class BgAndColor {
@property({type: Texture2D})
bg: Texture2D = null;
@property({type: Color})
color: Color = Color.clone(Color.WHITE);
}
@ccclass("MainGame") @ccclass("MainGame")
export class MainGame extends Scene { export class MainGame extends Scene {
static bundle: string = "MainGame"; static bundle: string = "MainGame";
...@@ -47,6 +56,7 @@ export class MainGame extends Scene { ...@@ -47,6 +56,7 @@ export class MainGame extends Scene {
@property(Node) initWall: Node = null; @property(Node) initWall: Node = null;
@property(Prefab) wallPrefab: Prefab = null; @property(Prefab) wallPrefab: Prefab = null;
@property(Prefab) wallPrefab2: Prefab = null;
@property(Prefab) crushPrefab: Prefab = null; @property(Prefab) crushPrefab: Prefab = null;
...@@ -55,6 +65,11 @@ export class MainGame extends Scene { ...@@ -55,6 +65,11 @@ export class MainGame extends Scene {
@property({type: Label, group: "UI"}) scoreLabel: Label = null; @property({type: Label, group: "UI"}) scoreLabel: Label = null;
@property({type: Node, group: "UI"}) hitTip: Node = null; @property({type: Node, group: "UI"}) hitTip: Node = null;
@property({type: Node}) bg: Node = null;
@property({type: [BgAndColor], visible: true, displayName: `背景和颜色`})
private bgAndColor: BgAndColor[] = [];
private _propScore: number = 0; private _propScore: number = 0;
set propScore(value: number) { set propScore(value: number) {
this._propScore = value; this._propScore = value;
...@@ -78,8 +93,6 @@ export class MainGame extends Scene { ...@@ -78,8 +93,6 @@ export class MainGame extends Scene {
isTouch = false; isTouch = false;
pNoise: ImprovedNoise = new ImprovedNoise();
wallArr: Node[] = []; wallArr: Node[] = [];
maxZ = 0; maxZ = 0;
...@@ -100,7 +113,10 @@ export class MainGame extends Scene { ...@@ -100,7 +113,10 @@ export class MainGame extends Scene {
playerCollider.on("onCollisionEnter", this.onPlayerCollision, this); playerCollider.on("onCollisionEnter", this.onPlayerCollision, this);
playerCollider.on('onTriggerEnter', this.onTriggerEnter, this); playerCollider.on('onTriggerEnter', this.onTriggerEnter, this);
this.lightColor = Color.clone(this.light.color); this.mainColor = this.bgAndColor.splice(0, 1)[0];
this.bg.getComponent(MeshRenderer).material.setProperty("mainTexture", this.mainColor.bg);
this.light.color = Color.clone(this.mainColor.color);
this.lightColor = Color.clone(this.mainColor.color);
this.playerBody = this.player.getComponent(RigidBody); this.playerBody = this.player.getComponent(RigidBody);
this.playerConstraint = this.linkPoint.getComponent(PointToPointConstraint); this.playerConstraint = this.linkPoint.getComponent(PointToPointConstraint);
...@@ -113,14 +129,24 @@ export class MainGame extends Scene { ...@@ -113,14 +129,24 @@ export class MainGame extends Scene {
this.wallArr[i] = this.createCube(4 - i); this.wallArr[i] = this.createCube(4 - i);
} }
for (let i = 5; i <= 10; i++) { for (let i = 5; i <= 11; i++) {
this.wallArr[i] = this.createCube(); this.wallArr[i] = this.createCube();
} }
} }
onDestroy() { onDestroy() {
this.playerConstraint.connectedBody = null; this.linkPoint.destroy();
this.playerConstraint.enabled = false; // this.playerConstraint.connectedBody = null;
// this.playerConstraint.enabled = false;
}
mainColor: BgAndColor = null;
randomMainColor() {
const index = Math.floor(Math.random() * this.bgAndColor.length);
this.mainColor = this.bgAndColor.splice(index, 1, this.mainColor)[0];
return this.mainColor;
} }
isOver: boolean = false; isOver: boolean = false;
...@@ -141,8 +167,7 @@ export class MainGame extends Scene { ...@@ -141,8 +167,7 @@ export class MainGame extends Scene {
if (otherName == "光幕") { if (otherName == "光幕") {
otherCollider.node.active = false; otherCollider.node.active = false;
const color = randomManColor(); this.changeMainColor();
this.changeMainColor(color);
} else if (otherName == "圆环") { } else if (otherName == "圆环") {
otherCollider.node.active = false; otherCollider.node.active = false;
this.propScore += 10; this.propScore += 10;
...@@ -174,7 +199,7 @@ export class MainGame extends Scene { ...@@ -174,7 +199,7 @@ export class MainGame extends Scene {
if (otherGroup === PhysicsSystem.PhysicsGroup['Wall']) { if (otherGroup === PhysicsSystem.PhysicsGroup['Wall']) {
// 死了 // 死了
this.playerBody.enabled = false; this.playerBody.enabled = false;
this.player.destroy(); this.player.active = false;
const crushNode = instantiate(this.crushPrefab); const crushNode = instantiate(this.crushPrefab);
this.node.addChild(crushNode); this.node.addChild(crushNode);
...@@ -193,7 +218,11 @@ export class MainGame extends Scene { ...@@ -193,7 +218,11 @@ export class MainGame extends Scene {
lightTween: Tween<any> = null; lightTween: Tween<any> = null;
lightColor: Color = null; lightColor: Color = null;
changeMainColor(color: Color) { changeMainColor() {
this.randomMainColor();
const {bg, color} = this.mainColor;
this.bg.getComponent(MeshRenderer).material.setProperty("mainTexture", bg);
this.lightTween?.removeSelf(); this.lightTween?.removeSelf();
this.lightTween = tween({radio: 0}) this.lightTween = tween({radio: 0})
.to(1, {radio: 1}, { .to(1, {radio: 1}, {
...@@ -207,7 +236,8 @@ export class MainGame extends Scene { ...@@ -207,7 +236,8 @@ export class MainGame extends Scene {
} }
createCube(z = this.wallArr[this.wallArr.length - 1].position.z - 1) { createCube(z = this.wallArr[this.wallArr.length - 1].position.z - 1) {
const newGroup = instantiate(this.wallPrefab); const singular = z % 2 == 0;
const newGroup = instantiate(singular ? this.wallPrefab : this.wallPrefab2);
this.node.addChild(newGroup); this.node.addChild(newGroup);
newGroup.setPosition(v3(0, Math.random(), z)); newGroup.setPosition(v3(0, Math.random(), z));
return newGroup; return newGroup;
...@@ -244,6 +274,7 @@ export class MainGame extends Scene { ...@@ -244,6 +274,7 @@ export class MainGame extends Scene {
const linear = v3(); const linear = v3();
this.playerBody.getLinearVelocity(linear); this.playerBody.getLinearVelocity(linear);
console.log(linear)
linear.multiplyScalar(velocityMultiplier); linear.multiplyScalar(velocityMultiplier);
this.playerBody.setLinearVelocity(linear); this.playerBody.setLinearVelocity(linear);
...@@ -355,6 +386,8 @@ export class MainGame extends Scene { ...@@ -355,6 +386,8 @@ export class MainGame extends Scene {
this.line.setScale(1, lineScale / 2, 1); this.line.setScale(1, lineScale / 2, 1);
this.playerBody.applyForce(v3(0, 0, -10)); this.playerBody.applyForce(v3(0, 0, -10));
} else {
// this.playerBody.applyForce(v3(0, 0, -10));
} }
} }
......
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "ebdf37fe-a429-4125-b997-440e3fa269ab",
"files": [],
"subMetas": {},
"userData": {}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment