Commit 255ed21d authored by haiyoucuv's avatar haiyoucuv

init

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