Commit 0e41859f authored by haiyoucuv's avatar haiyoucuv

init

parent 6af08fa7
......@@ -6,6 +6,7 @@
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
<excludeFolder url="file://$MODULE_DIR$/extensions" />
<excludeFolder url="file://$MODULE_DIR$/library" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
......
This diff is collapsed.
declare const window: any;
This diff is collapsed.
This diff is collapsed.
assets/Bundles/HomeScene/jpg/bg.jpg

127 KB | W: | H:

assets/Bundles/HomeScene/jpg/bg.jpg

332 KB | W: | H:

assets/Bundles/HomeScene/jpg/bg.jpg
assets/Bundles/HomeScene/jpg/bg.jpg
assets/Bundles/HomeScene/jpg/bg.jpg
assets/Bundles/HomeScene/jpg/bg.jpg
  • 2-up
  • Swipe
  • Onion skin
......@@ -46,10 +46,10 @@
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1624,
"height": 750,
"rawWidth": 1624,
"rawHeight": 750,
"width": 750,
"height": 1624,
"rawWidth": 750,
"rawHeight": 1624,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
......@@ -61,17 +61,17 @@
"meshType": 0,
"vertices": {
"rawPosition": [
-812,
-375,
0,
812,
-375,
0,
-812,
0,
375,
-812,
0,
-375,
812,
0,
375,
812,
0
],
"indexes": [
......@@ -84,12 +84,12 @@
],
"uv": [
0,
750,
1624,
750,
1624,
0,
0,
1624,
750,
0
],
"nuv": [
......@@ -103,13 +103,13 @@
1
],
"minPos": [
-812,
-375,
-812,
0
],
"maxPos": [
812,
375,
812,
0
]
},
......
{
"ver": "1.0.27",
"importer": "image",
"imported": true,
"uuid": "84d5193d-9ab3-4205-b586-775b8f646f74",
"files": [
".json",
".png"
],
"subMetas": {
"6c48a": {
"importer": "texture",
"uuid": "84d5193d-9ab3-4205-b586-775b8f646f74@6c48a",
"displayName": "start",
"id": "6c48a",
"name": "texture",
"userData": {
"wrapModeS": "clamp-to-edge",
"wrapModeT": "clamp-to-edge",
"imageUuidOrDatabaseUri": "84d5193d-9ab3-4205-b586-775b8f646f74",
"isUuid": true,
"visible": false,
"minfilter": "linear",
"magfilter": "linear",
"mipfilter": "none",
"anisotropy": 0
},
"ver": "1.0.22",
"imported": true,
"files": [
".json"
],
"subMetas": {}
},
"f9941": {
"importer": "sprite-frame",
"uuid": "84d5193d-9ab3-4205-b586-775b8f646f74@f9941",
"displayName": "start",
"id": "f9941",
"name": "spriteFrame",
"userData": {
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 500,
"height": 206,
"rawWidth": 500,
"rawHeight": 206,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"packable": true,
"pixelsToUnit": 100,
"pivotX": 0.5,
"pivotY": 0.5,
"meshType": 0,
"vertices": {
"rawPosition": [
-250,
-103,
0,
250,
-103,
0,
-250,
103,
0,
250,
103,
0
],
"indexes": [
0,
1,
2,
2,
1,
3
],
"uv": [
0,
206,
500,
206,
0,
0,
500,
0
],
"nuv": [
0,
0,
1,
0,
0,
1,
1,
1
],
"minPos": [
-250,
-103,
0
],
"maxPos": [
250,
103,
0
]
},
"isUuid": true,
"imageUuidOrDatabaseUri": "84d5193d-9ab3-4205-b586-775b8f646f74@6c48a",
"atlasUuid": ""
},
"ver": "1.0.12",
"imported": true,
"files": [
".json"
],
"subMetas": {}
}
},
"userData": {
"type": "sprite-frame",
"hasAlpha": true,
"fixAlphaTransparencyArtifacts": false,
"redirect": "84d5193d-9ab3-4205-b586-775b8f646f74@6c48a"
}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "0936edb3-4792-4cb7-8563-b3a68055aebb",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "820b948b-fcd7-4f8a-90a5-ae5046a3a543",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "334f401f-58f7-441d-a99f-dd4aa206385b",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "4c61bba9-b9a9-4d8c-bee6-4d1695065184",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "ba2478f2-9674-4f61-9ad3-af268afca707",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "5b1e6fb9-2d94-432a-842f-90f5a12c1ebc",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "38fc951c-3c2a-4c53-a0d7-53399a653c36",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "8c5856cd-118a-4e29-be20-512d64c37679",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.0.0",
"importer": "audio-clip",
"imported": true,
"uuid": "f71bf956-2413-45dc-9e05-0f5a191b4075",
"files": [
".json",
".mp3"
],
"subMetas": {},
"userData": {
"downloadMode": 0
}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "64d2d23c-5da0-4b83-8455-065565ac925c",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f701b696-fa0f-487e-92ac-e27038f5963f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "character_man"
}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "92ff9886-7fb4-4641-b799-28871156bd6d",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "aef0fdf5-4746-48cd-95ba-fc71bb48526f",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level1"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "7d2e5c17-ae25-4463-b83b-2e6062ca13c3",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level10"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "53e57144-7c1d-4027-a81b-5473b76da97a",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level2"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "acd60852-2465-43a6-a1a1-aed6d55c508e",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level3"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f4f0f3e0-802c-4e93-aa10-f9040d8d4b13",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level4"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "84cd42a2-5ed9-4a12-a2d9-580a9b257fff",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level5"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e5c06d2b-5800-42e0-8ce9-2c47dce243dc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level6"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "e2f11ad5-5b1c-4fc7-b471-75cf0c5aa402",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level7"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "57f31237-9a2d-459a-b385-bbe40e4dbe46",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level8"
}
}
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "362b5800-4e6b-407c-b5d1-5d709a58c1e4",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "level9"
}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "6ffa85c9-33fc-4d6d-8472-19e8b9b2987f",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "1f612778-1236-48a7-8c50-d6900c7a3c44",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "map1"
}
}
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "28652ac8-f90c-461d-ada0-ab5b4f646711",
"files": [],
"subMetas": {},
"userData": {
"isBundle": true
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "a66efc45-41ba-45bc-b3a5-28b896807b3b",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "FailPage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "23d02ce1-9d19-4cae-be78-ee7624e22e26",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "GamePage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "403ed200-c6b3-4e6a-bd7e-242a3ae5ba29",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "HomePage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "52692d65-fde6-4dba-87cb-ce978df34e14",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "RefreshPage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "cd536457-064b-4b7b-96f3-0b3659b811c4",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "RevivePage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "49a2367c-77ec-4d52-9716-3f8bee5f62e3",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "SortPage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "0387204a-417f-4ab0-bb64-b21d07c988bc",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "StopPage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "f9db42ff-4817-4bf0-9032-251171a6c4c1",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "SuccessPage"
}
}
This diff is collapsed.
{
"ver": "1.1.50",
"importer": "prefab",
"imported": true,
"uuid": "da8e945b-7638-4244-8e5b-f107fa0fcf37",
"files": [
".json"
],
"subMetas": {},
"userData": {
"syncNodeName": "VipPage"
}
}
import { _decorator, Component, find, geometry, instantiate, Node, NodePool, PhysicsSystem, Prefab, randomRange, randomRangeInt, tween, Vec3 } from 'cc';
import {
_decorator,
Component,
find,
geometry,
instantiate,
Node,
NodePool,
PhysicsSystem,
Prefab,
randomRange,
randomRangeInt,
Vec3
} from 'cc';
import { RoleCarColorsComponent } from '../Components/RoleCarColorsComponent';
import { CarColors, CarTypes, RoleNames, UINames } from '../CarColorsGlobalTypes';
import { CarColors, CarTypes, UINames } from '../CarColorsGlobalTypes';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { CarCarColorsComponent } from '../Components/CarCarColorsComponent';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
@ccclass('RoleCarColorsSysterm')
export class RoleCarColorsSysterm extends Component {
// 对象池
rolePools: Map<string, {pool:NodePool, prefab: Prefab}> = new Map()
rolePools: Map<string, { pool: NodePool, prefab: Prefab }> = new Map()
activeRole: Map<string, Node> = new Map()
isGaming: boolean = false
async loadRolePrefabs(){
const colors = Object.keys(CarColors).filter(item => isNaN(Number(item)))
const prefabList: Array<Prefab> = await Promise.all(CarColorsGlobalInstance.instance.bundleSysterm.loadRolePrefab())
prefabList.forEach((prefab, index)=>{
......@@ -50,7 +64,7 @@ export class RoleCarColorsSysterm extends Component {
}
initLevel(){
AudioManager.instance.playBgm(AudioClipNames.bgm)
AudioMgr.ins.play(AudioClipName.bgm, { loop: true });
this.clearAll()
this.addRoleToLine()
this.scheduleOnce(()=>{
......@@ -66,7 +80,7 @@ export class RoleCarColorsSysterm extends Component {
}
}
let colors: Array<CarColors> = []
for(let i = cars.length; i--;){
const car = cars[i]
const carComp = car.getComponent(CarCarColorsComponent)
......@@ -107,7 +121,7 @@ export class RoleCarColorsSysterm extends Component {
roleCom.color = colors[i]
}
}
this.isGaming = true
}
......@@ -184,7 +198,7 @@ export class RoleCarColorsSysterm extends Component {
return
}
//
//
let selectedCar: Node = null
for(let i = cars.length; i--;){
const car = cars[i]
......@@ -197,7 +211,7 @@ export class RoleCarColorsSysterm extends Component {
}
if (selectedCar.getComponent(CarCarColorsComponent).roleNum === 0){
selectedCar = car
}
}
}
}
......@@ -209,7 +223,7 @@ export class RoleCarColorsSysterm extends Component {
}
this.addRoleToLine()
}else {
// 游戏结束判定
if (!isEmpty){
this.isGaming = false
......@@ -235,7 +249,7 @@ export class RoleCarColorsSysterm extends Component {
})
this.activeRole.clear()
}
// 从对象池获取
getRoleFromPool(color: CarColors): Node{
const poolItem = this.rolePools.get(CarColors[color])
......@@ -262,7 +276,7 @@ export class RoleCarColorsSysterm extends Component {
role.setPosition(-10, 0, -6 - index * 2)
return
}
let pos = new Vec3()
role.getPosition(pos)
let wpos = role.getWorldPosition()
......@@ -285,7 +299,7 @@ export class RoleCarColorsSysterm extends Component {
}
pos.add(add)
// 到达终点判定
if (roleCom.isHorizon && pos.x > 0){
roleCom.playIdle()
......
import { _decorator, Component, find, instantiate, Label, Node, ProgressBar } from 'cc';
import { _decorator, find, instantiate, Label, ProgressBar } from 'cc';
import { UIBase } from '../Components/UIBase';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { ConfigKeys, GlobalData } from '../../../ScriptFrame/GlobalData';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
@ccclass('FailPage')
export class FailPage extends UIBase {
homeClick(){
AudioManager.instance.playOneShot(AudioClipNames.button_ok)
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
CarColorsGlobalInstance.instance.uiSysterm.showUI(UINames.HomePage)
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.GamePage)
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.FailPage)
}
replayClick(){
AudioManager.instance.playOneShot(AudioClipNames.button_ok)
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
this.startGame()
}
async startGame(){
......@@ -56,7 +57,7 @@ export class FailPage extends UIBase {
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.GamePage)
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.FailPage)
})
AudioManager.instance.playOneShot(AudioClipNames.start)
AudioMgr.ins.playOneShot(AudioClipName.start);
}
}
......
This diff is collapsed.
......@@ -3,8 +3,8 @@ import { UIBase } from '../Components/UIBase';
import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { GlobalData, ConfigKeys } from '../../../ScriptFrame/GlobalData';
import { AudioClipNames, AudioManager } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
@ccclass('HomePage')
......@@ -14,7 +14,7 @@ export class HomePage extends UIBase {
show(opts?: any): void {
super.show(opts)
this.startBtn.active = true
AudioManager.instance.playBgm(AudioClipNames.bgm)
AudioMgr.ins.play(AudioClipName.bgm, { loop: true });
CarColorsGlobalInstance.instance.roleSysterm.showHomeRoles()
find("Scene/map").destroyAllChildren()
find("Scene/map").removeAllChildren()
......@@ -68,7 +68,7 @@ export class HomePage extends UIBase {
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.GamePage)
})
AudioManager.instance.playOneShot(AudioClipNames.start)
AudioMgr.ins.playOneShot(AudioClipName.start);
}
}
......@@ -3,25 +3,25 @@ import { CarColorsGlobalInstance } from '../CarColorsGlobalInstance';
import { UINames } from '../CarColorsGlobalTypes';
import { UIBase } from '../Components/UIBase';
import { PlatformManager } from '../../../ScriptFrame/Frame/platformManager';
import { AudioManager, AudioClipNames } from '../../../ScriptFrame/Frame/AudioManager';
import { showToast } from "db://assets/core/Module/UIFast";
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
@ccclass('RefreshPage')
export class RefreshPage extends UIBase {
useClick(){
AudioManager.instance.playOneShot(AudioClipNames.button_ok)
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
PlatformManager.instance.showVideoAd(()=>{
CarColorsGlobalInstance.instance.carSysterm.refreshCar()
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RefreshPage)
CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
AudioManager.instance.playOneShot(AudioClipNames.upgrade)
AudioMgr.ins.playOneShot(AudioClipName.upgrade);
},()=>{
showToast("视频播放未完成!")
})
}
closeClick(){
AudioManager.instance.playOneShot(AudioClipNames.button_ok)
AudioMgr.ins.playOneShot(AudioClipName.button_ok);
CarColorsGlobalInstance.instance.uiSysterm.hideUI(UINames.RefreshPage)
CarColorsGlobalInstance.instance.roleSysterm.isGaming = true
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import { _decorator, AudioClip, AudioSource } from 'cc';
import { ConfigKeys, GlobalData } from '../GlobalData';
import { AudioClipName, AudioMgr } from "db://assets/core/base/AudioMgr";
const { ccclass, property } = _decorator;
// 音效列表
......@@ -11,7 +12,7 @@ export enum AudioClipNames{
crash,
brake,
win,
helico,
helico,A
}
@ccclass('AudioManager')
......@@ -39,7 +40,7 @@ export class AudioManager {
this.audioSource = audioSource
this.getSoundConfig()
if (this.soundOn){
this.playBgm(AudioClipNames.bgm)
AudioMgr.ins.play(AudioClipName.bgm, { loop: true });
}else {
this.pause()
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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