Commit 255ed21d authored by haiyoucuv's avatar haiyoucuv

init

parent fdce1062
......@@ -1907,7 +1907,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 7.5,
"x": -7.5,
"y": 0,
"z": 0
},
......@@ -2080,7 +2080,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 5,
"x": -5,
"y": 0,
"z": 0
},
......@@ -2253,7 +2253,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": 2.5,
"x": -2.5,
"y": 0,
"z": 0
},
......@@ -2599,7 +2599,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -2.5,
"x": 2.5,
"y": 0,
"z": 0
},
......@@ -2897,8 +2897,8 @@
},
"_size": {
"__type__": "cc.Vec3",
"x": 0.9,
"y": 0.5,
"x": 0.88,
"y": 0.502,
"z": 0.5
},
"_id": "00q2lBscdLpq5TJlfdQ+Xw"
......@@ -2921,7 +2921,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -5,
"x": 5,
"y": 0,
"z": 0
},
......@@ -3243,7 +3243,7 @@
"_prefab": null,
"_lpos": {
"__type__": "cc.Vec3",
"x": -7.5,
"x": 7.5,
"y": 0,
"z": 0
},
......
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "69a629da-707c-4827-aea1-5e784be2b18b",
"files": [],
"subMetas": {},
"userData": {}
}
import { _decorator, Node, Sprite, SpriteFrame } from 'cc';
import { CarColorsGlobalInstance } from 'db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import Panel from "db://assets/core/Module/Panel";
import { showShareGuide } from "db://assets/core/Module/UIFast";
import { MainGame } from "db://assets/Scripts/Scenes/MainGame/MainGame";
const { ccclass, property } = _decorator;
@ccclass('UnlockPanel')
export class UnlockPanel extends Panel {
static skin: string = "UnlockPanel";
static bundle: string = "UnlockPanel";
@property(Node) okBtn: Node = null;
@property(Node) cancelBtn: Node = null;
@property(Node) closeBtn: Node = null;
@property(SpriteFrame) shareSf: SpriteFrame = null;
@property(SpriteFrame) exchangeSf: SpriteFrame = null;
onLoad() {
super.onLoad();
this.okBtn.on(Node.EventType.TOUCH_END, this.ok, this);
this.cancelBtn.on(Node.EventType.TOUCH_END, this.cancel, this);
this.closeBtn.on(Node.EventType.TOUCH_END, this.cancel, this);
}
start(): void {
const { type } = this.data;
this.okBtn.getComponent(Sprite).spriteFrame = type == "share" ? this.shareSf : this.exchangeSf;
}
hidePanel() {
super.hidePanel();
CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
}
cancel = () => {
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
this.hidePanel();
}
ok = () => {
const { type } = this.data;
if (type == "share") {
showShareGuide();
this.scheduleOnce(() => {
MainGame.ins.shareUnlock();
}, 3);
} else {
}
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
this.hidePanel();
}
}
{"ver":"4.0.24","importer":"typescript","imported":true,"uuid":"ef5c5afa-46df-44d6-ae6d-9ca90b616b58","files":[],"subMetas":{},"userData":{}}
......@@ -18,16 +18,16 @@ import {
tween,
Vec3
} from 'cc';
import { CarCarColorsComponent } from '../Components/CarCarColorsComponent';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { GlobalData, ConfigKeys } from '../../../ScriptFrame/GlobalData';
import { CarCarColorsComponent } from 'db://assets/CarColorsGame/Scrips/Components/CarCarColorsComponent';
import { CarColorsGlobalInstance } from 'db://assets/CarColorsGame/Scrips/CarColorsGlobalInstance';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { showPanel, showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
import { StopPage } from "../../../Scripts/Panels/StopPage";
import { StopPage } from "db://assets/Scripts/Panels/StopPage";
import { RefreshPage } from "db://assets/Scripts/Panels/RefreshPage";
import { SortPage } from "db://assets/Scripts/Panels/SortPage";
import { VipPage } from "db://assets/Scripts/Panels/VipPage";
import { UnlockPanel } from "db://assets/Scripts/Panels/UnlockPanel";
const { ccclass, property } = _decorator;
......@@ -107,31 +107,7 @@ export class GamePage extends Component {
})
}
videoUnlock1() {
AudioMgr.ins.playOneShot(AudioClipName.button_ok)
PlatformManager.instance.showVideoAd(() => {
const points = find("Scene/Parkings").children
points[5].name = "empty"
points[5].children[0].children[0].active = true
points[5].children[0].children[1].active = false
AudioMgr.ins.playOneShot(AudioClipName.upgrade)
}, () => {
showToast("视频播放未完成!")
})
}
videoUnlock2() {
AudioMgr.ins.playOneShot(AudioClipName.button_ok)
PlatformManager.instance.showVideoAd(() => {
const points = find("Scene/Parkings").children
points[6].name = "empty"
points[6].children[0].children[0].active = true
points[6].children[0].children[1].active = false
AudioMgr.ins.playOneShot(AudioClipName.upgrade)
}, () => {
showToast("视频播放未完成!")
})
}
getEmptyParkPoint(): Node {
const points = find("Scene/Parkings").children
......@@ -144,8 +120,8 @@ export class GamePage extends Component {
}
touchStart(event: EventTouch) {
if (this.isAnimateObstacle) return
if (this.isAnimateHelicopter) return
if (this.isAnimateObstacle) return;
if (this.isAnimateHelicopter) return;
let ray = new geometry.Ray();
find("Main Camera").getComponent(Camera).screenPointToRay(event.getLocationX(), event.getLocationY(), ray);
// 以下参数可选
......@@ -155,15 +131,14 @@ export class GamePage extends Component {
// 点中停车位
if (!this.isChooseHelicopterTarget && PhysicsSystem.instance.raycastClosest(ray, mask, maxDistance, queryTrigger)) {
const parkPoint = PhysicsSystem.instance.raycastClosestResult.collider.node.parent.parent
console.log(parkPoint)
if (parkPoint.getSiblingIndex() === 4) {
this.shareUnlock()
} else if (parkPoint.getSiblingIndex() === 5) {
this.videoUnlock1()
}
if (parkPoint.getSiblingIndex() === 6) {
this.videoUnlock2()
const parkPoint = PhysicsSystem.instance.raycastClosestResult.collider.node.parent.parent;
const parkIndex = parkPoint.getSiblingIndex();
if (parkIndex === 4) {
showPanel(UnlockPanel, { type: "share" });
} else if (parkIndex === 5) {
showPanel(UnlockPanel, { type: "exchange" });
} else if (parkIndex === 6) {
showPanel(UnlockPanel, { type: "exchange" });
}
return
}
......@@ -194,13 +169,10 @@ export class GamePage extends Component {
// 碰到车
if (collider.getGroup() === 1 << 1) {
this.isAnimateObstacle = true
tween(car).to(0.1, {
worldPosition: carMovePos
})
tween(car)
.to(0.1, { worldPosition: carMovePos })
// .delay(0.1)
.to(0.1, {
worldPosition: pos
})
.to(0.1, { worldPosition: pos })
.call(() => {
this.isAnimateObstacle = false
})
......@@ -307,9 +279,8 @@ export class GamePage extends Component {
helicopter.forward = carPos.clone().subtract(helicopter.getWorldPosition()).normalize()
AudioMgr.ins.play(AudioClipName.helico, { loop: true })
tween(helicopter).to(1, {
worldPosition: carPos.clone().add3f(0, 3, 0)
})
tween(helicopter)
.to(1, { worldPosition: carPos.clone().add3f(0, 3, 0) })
.call(() => {
car.setParent(helicopter, true)
car.setRotationFromEuler(0, 180, 0)
......@@ -322,9 +293,7 @@ export class GamePage extends Component {
}).start()
})
.delay(0.5)
.to(1, {
worldPosition: parkPoint.children[0].getWorldPosition().add3f(0, 3, 0)
})
.to(1, { worldPosition: parkPoint.children[0].getWorldPosition().add3f(0, 3, 0) })
.call(() => {
car.forward = new Vec3(-1.2, 0, 2)
car.setParent(parkPoint, true)
......@@ -342,22 +311,19 @@ export class GamePage extends Component {
}
}).start()
})
.to(1, {
position: new Vec3(0, 0, 0)
})
.to(1, { position: new Vec3(0, 0, 0) })
.call(() => {
AudioMgr.ins.play(AudioClipName.bgm, { loop: true });
helicopter.active = false
})
.start()
.start();
}
// 导航到碰撞点
hitPointTween(car: Node, targetPoint: Node, tweenCar: Tween<Node>, hitPoint: Vec3 = null) {
const pointForward: Vec3 = hitPoint.clone().subtract(targetPoint.getWorldPosition()).normalize()
tweenCar.to(0.2, {
worldPosition: hitPoint
})
tweenCar
.to(0.2, { worldPosition: hitPoint })
.call(() => {
AudioMgr.ins.playOneShot(AudioClipName.brake);
const carforward = car.forward.clone()
......@@ -372,9 +338,8 @@ export class GamePage extends Component {
// 顶部导航
topRoadTween(car: Node, targetPoint: Node, tweenCar: Tween<Node>) {
tweenCar.to(0.2, {
worldPosition: targetPoint.getWorldPosition()
})
tweenCar
.to(0.2, { worldPosition: targetPoint.getWorldPosition() })
.call(() => {
AudioMgr.ins.playOneShot(AudioClipName.brake);
const carforward = car.forward.clone()
......@@ -394,9 +359,8 @@ export class GamePage extends Component {
// 左边导航
leftRoadTween(car: Node, tweenCar: Tween<Node>) {
const targetPoint = find("Scene/physicRoodTop/leftPoint")
tweenCar.to(0.2, {
worldPosition: targetPoint.getWorldPosition()
})
tweenCar
.to(0.2, { worldPosition: targetPoint.getWorldPosition() })
.call(() => {
AudioMgr.ins.playOneShot(AudioClipName.brake);
const carforward = car.forward.clone()
......
......@@ -7,6 +7,7 @@ import { CarColorsGlobalInstance } from "db://assets/CarColorsGame/Scrips/CarCol
import { RoleCarColorsSysterm } from "db://assets/CarColorsGame/Scrips/Systerms/RoleCarColorsSysterm";
import { CarCarColorsSysterm } from "db://assets/CarColorsGame/Scrips/Systerms/CarCarColorsSysterm";
import { SuccessPage } from "db://assets/Scripts/Panels/SuccessPage";
import { PlatformManager } from "db://assets/ScriptFrame/Frame/platformManager";
const { ccclass, property } = _decorator;
......@@ -42,6 +43,17 @@ export class MainGame extends Scene {
await this.nextLevel();
}
shareUnlock() {
AudioMgr.ins.playOneShot(AudioClipName.button_ok)
PlatformManager.instance.shareGame(() => {
const points = find("Scene/Parkings").children
points[4].name = "empty"
points[4].children[0].children[0].active = true
points[4].children[0].children[1].active = false
AudioMgr.ins.playOneShot(AudioClipName.upgrade)
})
}
showPre() {
this.gamePre.active = true;
const isLevel1 = this.level === 1;
......@@ -53,6 +65,32 @@ export class MainGame extends Scene {
}, 2);
}
videoUnlock1() {
AudioMgr.ins.playOneShot(AudioClipName.button_ok)
PlatformManager.instance.showVideoAd(() => {
const points = find("Scene/Parkings").children
points[5].name = "empty"
points[5].children[0].children[0].active = true
points[5].children[0].children[1].active = false
AudioMgr.ins.playOneShot(AudioClipName.upgrade)
}, () => {
showToast("视频播放未完成!")
})
}
videoUnlock2() {
AudioMgr.ins.playOneShot(AudioClipName.button_ok)
PlatformManager.instance.showVideoAd(() => {
const points = find("Scene/Parkings").children
points[6].name = "empty"
points[6].children[0].children[0].active = true
points[6].children[0].children[1].active = false
AudioMgr.ins.playOneShot(AudioClipName.upgrade)
}, () => {
showToast("视频播放未完成!")
})
}
async nextLevel() {
if (this.level >= 5) {
showPanel(SuccessPage);
......
......@@ -54,7 +54,7 @@
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 374.99999999999994,
"x": 375,
"y": 812,
"z": 0
},
......@@ -196,7 +196,7 @@
{
"__type__": "cc.Node",
"_name": "Panel",
"_objFlags": 512,
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 1
......@@ -253,7 +253,7 @@
{
"__type__": "cc.Node",
"_name": "mask",
"_objFlags": 512,
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 6
......
......@@ -104,8 +104,8 @@ export class UIMgr {
showShareGuide(guideTxt = "") {
this.shareGuide.active = true;
this.shareGuide.getChildByName("label")
.getComponent(Label).string = guideTxt;
// this.shareGuide.getChildByName("分享提示")
// .getComponent(Label).string = guideTxt;
}
hideShareGuide() {
......
......@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>口味王新春集福气</title>
<title>爱心护航 梦想启航</title>
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
<meta name="viewport"
......
<html>
<head>
<meta charset="utf-8" />
<title>口味王新春集福气</title>
<title>爱心护航 梦想启航</title>
<meta
name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1,minimal-ui=true"
......
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