Commit b734a17d authored by haiyoucuv's avatar haiyoucuv

更改

parent 3cba7dda
declare module "cc" {
export enum PhysicsGroup {
DEFAULT = 1,
Ball = 1 << 1,
Line = 1 << 2,
Wall = 1 << 3
}
}
This diff is collapsed.
......@@ -36,7 +36,7 @@
"_props": [
{
"mainTexture": {
"__uuid__": "9965e7f3-4973-4ff3-b320-0cdb52bfc035@6c48a",
"__uuid__": "39e1e9d6-b461-4c06-81b9-f1ddc09193d7@6c48a",
"__expectedType__": "cc.Texture2D"
}
},
......
......@@ -2,7 +2,7 @@
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "733ec699-4417-4297-acd8-d91def9cd825",
"uuid": "39e1e9d6-b461-4c06-81b9-f1ddc09193d7",
"files": [
".json",
".png"
......@@ -10,8 +10,8 @@
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "733ec699-4417-4297-acd8-d91def9cd825@6c48a",
"displayName": "stone",
"uuid": "39e1e9d6-b461-4c06-81b9-f1ddc09193d7@6c48a",
"displayName": "fire2",
"id": "6c48a",
"name": "texture",
"userData": {
......@@ -22,7 +22,7 @@
"mipfilter": "linear",
"anisotropy": 0,
"isUuid": true,
"imageUuidOrDatabaseUri": "733ec699-4417-4297-acd8-d91def9cd825",
"imageUuidOrDatabaseUri": "39e1e9d6-b461-4c06-81b9-f1ddc09193d7",
"visible": false
},
"ver": "1.0.22",
......@@ -36,7 +36,7 @@
"userData": {
"hasAlpha": true,
"type": "texture",
"redirect": "733ec699-4417-4297-acd8-d91def9cd825@6c48a",
"redirect": "39e1e9d6-b461-4c06-81b9-f1ddc09193d7@6c48a",
"fixAlphaTransparencyArtifacts": false
}
}
import Panel from "../../Module/Panel";
import { _decorator, Button, RichText, UITransform } from "cc";
import { sendWebNet, WebNetName } from "../Utils/WebNet/WebNet";
import { _decorator, Button, RichText, UITransform, Node } from "cc";
import store from "../../store/store";
import { observer, render } from "../../store/decorators";
const {ccclass, property} = _decorator;
@observer
@ccclass('RulePanel')
export default class RulePanel extends Panel {
static skin = "RulePanel";
static group = "RulePanel";
@property(Node) closeBtn: Node = null;
@property(Node) ruleNode: Node = null;
@property(Node) content: Node = null;
async start() {
store.updateRule();
this.closeBtn.on(Button.EventType.CLICK, this.clickClose);
}
clickClose = () => {
this.hidePanel();
}
@render
render() {
const {ruleInfo = ""} = store;
this.setRuleTxt(ruleInfo);
this.view["close"].on(Button.EventType.CLICK, () => {
this.hidePanel();
}, this);
}
setRuleTxt(txt) {
const ruleNode = this.view['ruleBg/ScrollView/view/content/ruleTxt'];
const ruleTxt = ruleNode.getComponent(RichText);
const content = this.view['ruleBg/ScrollView/view/content'];
ruleTxt.maxWidth = content.getComponent(UITransform).width;
const ruleTxt = this.ruleNode.getComponent(RichText);
ruleTxt.maxWidth = this.content.getComponent(UITransform).width;
// this.scheduleOnce(() => {
ruleTxt.string = txt
.replace(/<p\b.*?(?:\>|\/>)/gi, "")
.replace(/<\/p\>/gi, "<br/>")
.replace(/<strong>/gi, "<b>")
.replace(/<\/strong>/gi, "</b>");
content.getComponent(UITransform).height = ruleNode.getComponent(UITransform).height;
ruleTxt.string = txt
.replace(/<p\b.*?(?:\>|\/>)/gi, "")
.replace(/<\/p\>/gi, "<br/>")
.replace(/<strong>/gi, "<b>")
.replace(/<\/strong>/gi, "</b>");
this.content.getComponent(UITransform).height = this.ruleNode.getComponent(UITransform).height;
// }, 0.166);
}
......
import { _decorator, Button, Label, Node, screen, UI, UITransform, Widget } from 'cc';
import Scene from "db://assets/Module/Scene";
import { getWebData, LOG_TYPE, sendLog, sendWebNet, WebNetName } from "db://assets/Scripts/Utils/WebNet/WebNet";
import { MainGame } from "./MainGame/MainGame";
import { changeScene, showPanel, showToast } from "db://assets/Module/UIFast";
import GameMgr from "db://assets/Scripts/GameMgr";
import { changeScene, showPanel } from "db://assets/Module/UIFast";
import store from "../../store/store";
import { observer, render } from "../../store/decorators";
import { PrizeScene } from "./PrizeScene/PrizeScene";
import { _asyncThrottle } from "../Utils/Utils";
import RulePanel from "../Panels/RulePanel";
......
......@@ -3,17 +3,18 @@ import {
Input,
input,
instantiate,
Node, PhysicsGroup, PhysicsSystem,
Node, ParticleSystem, PhysicsGroup, PhysicsSystem,
PointToPointConstraint,
Prefab,
primitives,
RigidBody,
RigidBody, tween,
v3,
Vec3,
} from "cc";
import Scene from "db://assets/Module/Scene";
import { ImprovedNoise } from "../../Utils/ImprovedNoise";
import { Wall } from "./Wall";
import { sleep } from "../../Utils/Utils";
const {ccclass, property} = _decorator;
......@@ -35,6 +36,8 @@ export class MainGame extends Scene {
@property(Prefab) wallPrefab: Prefab = null;
@property(Node) crushNode: Node = null;
isTouch = false;
pNoise: ImprovedNoise = new ImprovedNoise();
......@@ -65,17 +68,40 @@ export class MainGame extends Scene {
async start() {
}
isOver: boolean = false;
async gameOver(success) {
this.isOver = true;
await sleep(3);
}
onPlayerCollision(event: ICollisionEvent) {
console.log(event.type, event)
if (this.isOver) return;
const {otherCollider, selfCollider} = event;
const otherGroup = otherCollider.getGroup();
if (otherGroup === PhysicsSystem.PhysicsGroup.Wall) {
if (otherGroup === PhysicsSystem.PhysicsGroup['Wall']) {
// 死了
console.log("死了");
this.playerBody.enabled = false;
this.player.destroy();
this.crushNode.setPosition(this.player.position);
this.crushNode.getComponent(ParticleSystem)
.play();
this.gameOver(false);
}
}
......@@ -88,6 +114,8 @@ export class MainGame extends Scene {
}
onTouchStart(event: any) {
if (this.isOver) return;
this.isTouch = true;
this.line.active = true;
......@@ -119,6 +147,8 @@ export class MainGame extends Scene {
}
onTouchEnd(event: any) {
if (this.isOver) return;
this.isTouch = false;
this.line.active = false;
this.playerConstraint.enabled = false;
......
......@@ -22,23 +22,23 @@
"__id__": 2
},
{
"__id__": 40
"__id__": 38
}
],
"_active": true,
"_components": [
{
"__id__": 50
"__id__": 48
},
{
"__id__": 52
"__id__": 50
},
{
"__id__": 54
"__id__": 52
}
],
"_prefab": {
"__id__": 56
"__id__": 54
},
"_lpos": {
"__type__": "cc.Vec3",
......@@ -85,17 +85,17 @@
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 31
},
{
"__id__": 35
"__id__": 33
},
{
"__id__": 37
"__id__": 35
}
],
"_prefab": {
"__id__": 39
"__id__": 37
},
"_lpos": {
"__type__": "cc.Vec3",
......@@ -146,18 +146,15 @@
},
{
"__id__": 28
},
{
"__id__": 30
}
],
"_prefab": {
"__id__": 32
"__id__": 30
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 304,
"y": 330,
"z": 0
},
"_lrot": {
......@@ -440,7 +437,7 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 450,
"width": 485,
"height": 0
},
"_anchorPoint": {
......@@ -517,8 +514,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 450,
"height": 690
"width": 485,
"height": 810
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -567,8 +564,8 @@
},
"_alignFlags": 45,
"_target": null,
"_left": 35,
"_right": 35,
"_left": 7.5,
"_right": 7.5,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
......@@ -662,8 +659,8 @@
},
"_contentSize": {
"__type__": "cc.Size",
"width": 520,
"height": 690
"width": 500,
"height": 810
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -707,42 +704,6 @@
"__type__": "cc.CompPrefabInfo",
"fileId": "10n9p8iARDA5rfeLyUD4z8"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 3
},
"_enabled": true,
"__prefab": {
"__id__": 31
},
"_alignFlags": 17,
"_target": null,
"_left": 7,
"_right": 0,
"_top": 110,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "006EM7Id5CWqCux6yUgmgT"
},
{
"__type__": "cc.PrefabInfo",
"root": {
......@@ -766,12 +727,12 @@
},
"_enabled": true,
"__prefab": {
"__id__": 34
"__id__": 32
},
"_contentSize": {
"__type__": "cc.Size",
"width": 534,
"height": 828
"width": 625,
"height": 1114
},
"_anchorPoint": {
"__type__": "cc.Vec2",
......@@ -794,7 +755,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 36
"__id__": 34
},
"_customMaterial": null,
"_srcBlendFactor": 2,
......@@ -839,13 +800,13 @@
},
"_enabled": true,
"__prefab": {
"__id__": 38
"__id__": 36
},
"_alignFlags": 17,
"_target": null,
"_left": 108,
"_right": 0,
"_top": 231.102,
"_top": 88.102,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -889,6 +850,9 @@
"_children": [],
"_active": true,
"_components": [
{
"__id__": 39
},
{
"__id__": 41
},
......@@ -897,18 +861,15 @@
},
{
"__id__": 45
},
{
"__id__": 47
}
],
"_prefab": {
"__id__": 49
"__id__": 47
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": -328.23199999999997,
"y": -482.13200000000006,
"z": 0
},
"_lrot": {
......@@ -940,11 +901,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 42
"__id__": 40
},
"_contentSize": {
"__type__": "cc.Size",
......@@ -968,11 +929,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 44
"__id__": 42
},
"_customMaterial": null,
"_srcBlendFactor": 2,
......@@ -990,7 +951,7 @@
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
......@@ -1013,11 +974,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 46
"__id__": 44
},
"clickEvents": [],
"_interactable": true,
......@@ -1069,17 +1030,17 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 40
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 48
"__id__": 46
},
"_alignFlags": 17,
"_target": null,
"_left": 335,
"_right": 0,
"_top": 1100.232,
"_top": 1254.132,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
......@@ -1122,7 +1083,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 51
"__id__": 49
},
"_contentSize": {
"__type__": "cc.Size",
......@@ -1150,7 +1111,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 53
"__id__": 51
},
"_alignFlags": 45,
"_target": null,
......@@ -1186,7 +1147,16 @@
},
"_enabled": true,
"__prefab": {
"__id__": 55
"__id__": 53
},
"closeBtn": {
"__id__": 38
},
"ruleNode": {
"__id__": 6
},
"content": {
"__id__": 5
},
"_id": ""
},
......
assets/resources/RulePanel/bg.png

48.4 KB | W: | H:

assets/resources/RulePanel/bg.png

146 KB | W: | H:

assets/resources/RulePanel/bg.png
assets/resources/RulePanel/bg.png
assets/resources/RulePanel/bg.png
assets/resources/RulePanel/bg.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -46,10 +46,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 534,
"height": 828,
"rawWidth": 534,
"rawHeight": 828,
"width": 625,
"height": 1114,
"rawWidth": 625,
"rawHeight": 1114,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......@@ -61,17 +61,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-267,
-414,
-312.5,
-557,
0,
267,
-414,
312.5,
-557,
0,
-267,
414,
-312.5,
557,
0,
267,
414,
312.5,
557,
0
],
"indexes": [
......@@ -84,12 +84,12 @@
],
"uv": [
0,
828,
534,
828,
1114,
625,
1114,
0,
0,
534,
625,
0
],
"nuv": [
......@@ -103,13 +103,13 @@
1
],
"minPos": [
-267,
-414,
-312.5,
-557,
0
],
"maxPos": [
267,
414,
312.5,
557,
0
]
},
......
assets/resources/common/close.png

1.32 KB | W: | H:

assets/resources/common/close.png

2.11 KB | W: | H:

assets/resources/common/close.png
assets/resources/common/close.png
assets/resources/common/close.png
assets/resources/common/close.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -46,10 +46,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 80,
"height": 80,
"rawWidth": 80,
"rawHeight": 80,
"width": 65,
"height": 65,
"rawWidth": 65,
"rawHeight": 65,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......@@ -61,17 +61,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-40,
-40,
-32.5,
-32.5,
0,
40,
-40,
32.5,
-32.5,
0,
-40,
40,
-32.5,
32.5,
0,
40,
40,
32.5,
32.5,
0
],
"indexes": [
......@@ -84,12 +84,12 @@
],
"uv": [
0,
80,
80,
80,
65,
65,
65,
0,
0,
80,
65,
0
],
"nuv": [
......@@ -103,13 +103,13 @@
1
],
"minPos": [
-40,
-40,
-32.5,
-32.5,
0
],
"maxPos": [
40,
40,
32.5,
32.5,
0
]
},
......
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