Commit 15197a2b authored by Nguyễn Quang Sáng's avatar Nguyễn Quang Sáng

29/8/2023 commit

parent e00a4692
{
"__type__": "cc.AnimationClip",
"_name": "Intro",
"_objFlags": 0,
"_native": "",
"_duration": 0.16666666666666666,
"sample": 60,
"speed": 0.2,
"wrapMode": 2,
"curveData": {
"props": {
"opacity": [
{
"frame": 0,
"value": 255
},
{
"frame": 0.08333333333333333,
"value": 0
},
{
"frame": 0.15,
"value": 224.03280005870312
},
{
"frame": 0.16666666666666666,
"value": 255
}
]
}
},
"events": []
}
\ No newline at end of file
{
"ver": "2.1.2",
"uuid": "24b303eb-80f6-41f6-a817-f6bb048c2138",
"importer": "animation-clip",
"subMetas": {}
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
"_name": "Opening",
"_objFlags": 0,
"_native": "",
"_duration": 0.5166666666666667,
"_duration": 0.5833333333333334,
"sample": 60,
"speed": 1,
"wrapMode": 1,
......@@ -12,11 +12,11 @@
"opacity": [
{
"frame": 0,
"value": 0
"value": 255
},
{
"frame": 0.5166666666666667,
"value": 255
"frame": 0.5833333333333334,
"value": 0
}
]
}
......
This diff is collapsed.
This diff is collapsed.
{
"ver": "2.3.7",
"uuid": "0de0ba75-fee4-48db-b699-7993a835b98d",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1959,
"height": 701,
"platformSettings": {},
"subMetas": {
"Unlock": {
"ver": "1.0.6",
"uuid": "78d9ec6c-e154-4167-b29b-43fd0420025f",
"importer": "sprite-frame",
"rawTextureUuid": "0de0ba75-fee4-48db-b699-7993a835b98d",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 1959,
"height": 701,
"rawWidth": 1959,
"rawHeight": 701,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -100,18 +100,21 @@
},
{
"__id__": 46
},
{
"__id__": 72
}
],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 81
},
{
"__id__": 73
"__id__": 82
},
{
"__id__": 74
"__id__": 83
}
],
"_prefab": null,
......@@ -468,7 +471,7 @@
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d2abbacf-3959-4e3a-9fb7-5c1527a74dda"
"__uuid__": "65a2b7d8-d4e8-4571-aedb-766db7693820"
},
"_type": 0,
"_sizeMode": 1,
......@@ -3043,6 +3046,360 @@
"playOnLoad": true,
"_id": "e1Sbe+retMy79f3NjKsuvG"
},
{
"__type__": "cc.Node",
"_name": "Intro",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 73
}
],
"_active": true,
"_components": [
{
"__id__": 76
},
{
"__id__": 77
},
{
"__id__": 78
},
{
"__id__": 79
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 640,
"height": 1140
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "cdjfz9tR1KGagNMSd7GNIf"
},
{
"__type__": "cc.Node",
"_name": "Label",
"_objFlags": 0,
"_parent": {
"__id__": 72
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 74
},
{
"__id__": 75
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 440.5,
"height": 63
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "6dAPQo6k5LppgftUJo31S5"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "TOUCH TO START",
"_N$string": "TOUCH TO START",
"_fontSize": 50,
"_lineHeight": 50,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "0481a3d3-282a-499e-b2f1-c53edc40ac4c"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 1,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "39zrI+bwpE0IR3DzoBxIdK"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "24b303eb-80f6-41f6-a817-f6bb048c2138"
},
"_clips": [
{
"__uuid__": "24b303eb-80f6-41f6-a817-f6bb048c2138"
}
],
"playOnLoad": true,
"_id": "434rgdex9BGbtTN6xHBT0E"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "0f8uZ5+zNJY6Z4dAoiMvml"
},
{
"__type__": "cc.Animation",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"_defaultClip": {
"__uuid__": "20dd64ba-ba66-4af0-9f75-d3196eca01af"
},
"_clips": [
{
"__uuid__": "20dd64ba-ba66-4af0-9f75-d3196eca01af"
}
],
"playOnLoad": false,
"_id": "98HNEYNVlOaLQER47G6CHp"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 640,
"_originalHeight": 1140,
"_id": "6eDDZbgRNMOrXGgZwJUOUa"
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 72
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 80
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": "92U3JaTyFMwZhz+LiTOga4"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "221b6Awh/1PLZ7IzVb1f3El",
"handler": "onClickOpenGame",
"customEventData": ""
},
{
"__type__": "cc.Canvas",
"_name": "",
......
......@@ -8,6 +8,7 @@ import StageController from "./StageController";
import SkinController from "./SkinsController";
import Hive from "../Objects/Hive";
import SoundController from "./SoundController";
import StartScene from "./StartScene";
const { ccclass, property } = cc._decorator;
......@@ -67,6 +68,7 @@ export default class GamePlay extends cc.Component {
rightEdgePoints: Array<cc.Vec2> = new Array<cc.Vec2>();
blockedObjects: Array<cc.Node> = new Array<cc.Node>();
randomCoin: number = Math.floor(Math.random() * (30 - 26)) + 25;
protected onLoad(): void {
GamePlay.instance = this;
......@@ -117,9 +119,6 @@ export default class GamePlay extends cc.Component {
this.isCompleted = false;
this.isGameover = false;
this.updateSkin();
if (this.node.children[0].getChildByName("Acid")) {
SoundController.playLoopSound(SoundController.instance.sounds[0], 1);
}
}
updateSkin() {
......@@ -197,7 +196,6 @@ export default class GamePlay extends cc.Component {
}
onTouchMove(event: cc.Event.EventTouch) {
SoundController.playNoLoopSound(SoundController.instance.sounds[12]);
this.moved = true;
let touchPos = event.getLocation();
let posValid = true;
......@@ -246,7 +244,7 @@ export default class GamePlay extends cc.Component {
rightEdgeLast,
];
newPolyCol.restitution = 1.2;
newPolyCol.restitution = 1;
newPolyCol.apply();
this.lastTouchPos = touchPos;
......@@ -256,14 +254,18 @@ export default class GamePlay extends cc.Component {
LimitBar.instance.fillTheBar();
if (LimitBar.instance.progress <= 0) {
this.onTouchUp(event);
} else this.drawLine();
} else {
this.drawLine();
SoundController.playNoLoopSound(SoundController.instance.sounds[12]);
}
}
}
}
onTouchUp(event: cc.Event.EventTouch) {
SoundController.playNoLoopSound(SoundController.instance.sounds[11]);
if (!this.drew && this.moved && this.linePoints.length > 1) {
SoundController.playNoLoopSound(SoundController.instance.sounds[11]);
SoundController.playLoopSound(SoundController.instance.sounds[1]);
this.rb.type = cc.RigidBodyType.Dynamic;
if (this.node.children[0].getChildByName("Stone")) {
this.node.children[0]
......@@ -272,7 +274,6 @@ export default class GamePlay extends cc.Component {
}
StageController.instance.onHunting();
SoundController.playLoopSound(SoundController.instance.sounds[1], 1);
this.clock.active = true;
this.startCount = true;
this.drew = true;
......@@ -299,7 +300,6 @@ export default class GamePlay extends cc.Component {
protected update(dt: number): void {
if (!this.startCount) return;
this.countdown -= dt;
this.onStartCountdown();
}
......@@ -316,22 +316,24 @@ export default class GamePlay extends cc.Component {
}
if (!Dog.instance.attacked && this.countdown <= 1) {
this.startCount = false;
cc.audioEngine.stopAllEffects();
this.onLevelCompleted(this.currentLevel);
}
}
onReloadLevel() {
this.drew = false;
cc.audioEngine.stopAllEffects();
SoundController.stopSound(SoundController.instance.sounds[1]);
cc.director.loadScene("gameplay");
}
onLevelCompleted(level) {
SoundController.stopSound(SoundController.instance.sounds[1]);
SoundController.playNoLoopSound(SoundController.instance.sounds[6]);
SoundController.playNoLoopSound(SoundController.instance.sounds[13]);
SoundController.playNoLoopSound(SoundController.instance.sounds[10]);
this.addCoin();
this.coinEarned.getComponent(cc.Label).string = `x${this.randomCoin}`;
this.isCompleted = true;
StageController.instance.onCompleted();
if (this.currentLevel + 1 == this.highestLevel) {
......@@ -360,22 +362,25 @@ export default class GamePlay extends cc.Component {
this.updateAllStarLabel();
}
addCoin() {
let randomCoin = Math.floor(Math.random() * (30 - 26)) + 25;
this.coinEarned.getComponent(cc.Label).string = `x${randomCoin}`;
LocalStorage.setAllCoin((this.currentCoin += randomCoin));
onClickCollect() {
LocalStorage.setAllCoin((this.currentCoin += this.randomCoin));
this.coinLabel.getComponent(
cc.Label
).string = `x${LocalStorage.getAllCoin()}`;
}
onNextLevel() {
SoundController.playNoLoopSound(SoundController.instance.sounds[4]);
SoundController.playNoLoopSound(SoundController.instance.sounds[5]);
LocalStorage.setCurrentLevel((this.currentLevel += 1));
this.currentLevel = LocalStorage.getCurrentLevel();
if (this.currentLevel > 29) return cc.director.loadScene("start");
this.drew = false;
GlobalVariables.levelToLoad = this.currentLevel;
}
onNextLevel() {
this.onClickCollect();
this.scheduleOnce(() => {
cc.director.loadScene("gameplay");
}, 1);
}
onClickButtonBack() {
......
import { GlobalVariables } from "../Data/GlobalVariables";
import LocalStorage from "../Data/LocalStorage";
import StartScene from "./StartScene";
const { ccclass, property } = cc._decorator;
......
import { GlobalVariables } from "../Data/GlobalVariables";
import LocalStorage from "../Data/LocalStorage";
import StartScene from "./StartScene";
const { ccclass, property } = cc._decorator;
......
import LocalStorage from "../Data/LocalStorage";
const { ccclass, property } = cc._decorator;
@ccclass
export default class SoundController extends cc.Component {
static instance: SoundController;
private playingSounds: { audio: cc.AudioClip; audioId: number }[] = [];
@property(Array(cc.AudioClip)) sounds: Array<cc.AudioClip> =
new Array<cc.AudioClip>();
......@@ -11,16 +15,32 @@ export default class SoundController extends cc.Component {
SoundController.instance = this;
}
public static playLoopSound(sound: cc.AudioClip, delayTime: number) {
const audioId = cc.audioEngine.playEffect(sound, false);
this.instance.scheduleOnce(() => {
cc.audioEngine.stopEffect(audioId);
cc.audioEngine.playEffect(sound, true);
}, delayTime);
public static playLoopSound(sound: cc.AudioClip) {
if (!LocalStorage.getMusic()) return;
const audioId = cc.audioEngine.play(sound, true, 1);
SoundController.instance.playingSounds.push({
audio: sound,
audioId: audioId,
});
}
public static playNoLoopSound(sound: cc.AudioClip) {
cc.audioEngine.playEffect(sound, false);
if (!LocalStorage.getMusic()) return;
const audioId = cc.audioEngine.play(sound, false, 1);
SoundController.instance.playingSounds.push({
audio: sound,
audioId: audioId,
});
}
public static stopSound(audioClip: cc.AudioClip) {
const index = SoundController.instance.playingSounds.findIndex(
(item) => item.audio === audioClip
);
if (index !== -1) {
const audioId = SoundController.instance.playingSounds[index].audioId;
cc.audioEngine.stop(audioId);
SoundController.instance.playingSounds.splice(index, 1);
}
}
}
......@@ -16,15 +16,22 @@ export default class StartScene extends cc.Component {
pressed: boolean = false;
highestUnlockedLevel: number;
currentAnimation: string = null;
isStarted: boolean = false;
protected onLoad(): void {
cc.audioEngine.playEffect(this.soundIntro, true);
if (LocalStorage.getMusic()) {
this.currentSprite = this.soundOnSprite;
} else this.currentSprite = this.soundOffSprite;
this.updateButtonSprite();
if (this.currentSprite == this.soundOnSprite) {
cc.audioEngine.playEffect(this.soundIntro, true);
} else {
this.currentSprite = this.soundOffSprite;
cc.audioEngine.setMusicVolume(0);
cc.audioEngine.setEffectsVolume(0);
}
this.updateButtonSprite();
window.addEventListener("beforeunload", this.handleGameReload);
this.isStarted = LocalStorage.getGameStarted();
if (this.isStarted) this.node.getChildByName("Intro").active = false;
this.highestUnlockedLevel = LocalStorage.getHighestLevel();
LocalStorage.getCurrentLevel();
......@@ -40,6 +47,26 @@ export default class StartScene extends cc.Component {
.getComponent(cc.Label).string = `x${LocalStorage.getAllCoin()}`;
}
handleGameReload() {
LocalStorage.setGameStarted(false);
}
onDestroy() {
window.removeEventListener("beforeunload", this.handleGameReload);
}
onClickOpenGame() {
LocalStorage.setGameStarted(true);
this.node
.getChildByName("Intro")
.getComponent(cc.Animation)
.play("Opening");
this.scheduleOnce(() => {
this.node.getChildByName("Intro").active = false;
}, 0.6);
}
updateAllStarLabel() {
let sum = 0;
for (const item of LocalStorage.getAllStars()) {
......@@ -119,6 +146,10 @@ export default class StartScene extends cc.Component {
cc.audioEngine.playEffect(this.soundClick, false);
GlobalVariables.levelToLoad = this.highestUnlockedLevel - 1;
LocalStorage.setCurrentLevel(this.highestUnlockedLevel - 1);
if (this.highestUnlockedLevel == 31) {
GlobalVariables.levelToLoad = 0;
LocalStorage.setCurrentLevel(0);
}
cc.director.loadScene("gameplay");
}
}
......@@ -2,14 +2,28 @@ const { ccclass, property } = cc._decorator;
@ccclass
export default class LocalStorage extends cc.Component {
public static setGameStarted(value: boolean) {
cc.sys.localStorage.setItem("SaveTheDoge - GameStarted", value);
}
public static getGameStarted(): boolean {
if (cc.sys.localStorage.getItem("SaveTheDoge - GameStarted") == null) {
cc.sys.localStorage.setItem("SaveTheDoge - GameStarted", false);
return false;
} else
return JSON.parse(
cc.sys.localStorage.getItem("SaveTheDoge - GameStarted")
);
}
public static setMusic(value: boolean) {
cc.sys.localStorage.setItem("SaveTheDoge - Music", value);
}
public static getMusic(): boolean {
if (cc.sys.localStorage.getItem("SaveTheDoge - Music") == null) {
cc.sys.localStorage.setItem("SaveTheDoge - Music", false);
return false;
cc.sys.localStorage.setItem("SaveTheDoge - Music", true);
return true;
} else
return JSON.parse(cc.sys.localStorage.getItem("SaveTheDoge - Music"));
}
......
......@@ -26,6 +26,7 @@ export default class Bee extends cc.Component {
this.targetPosition = arrayTarget[randomIndex];
}
if (otherCollider.tag == 3) {
SoundController.playNoLoopSound(SoundController.instance.sounds[7]);
let effect = cc.instantiate(GamePlay.instance.fadePrefab);
effect.parent = this.node;
effect.position = this.node.convertToNodeSpaceAR(
......
......@@ -21,10 +21,11 @@ export default class Dog extends cc.Component {
if (!this.attacked && otherCollider.tag == 1) {
this.attacked = true;
GamePlay.instance.isGameover = true;
SoundController.playNoLoopSound(SoundController.instance.sounds[9])
SoundController.playNoLoopSound(SoundController.instance.sounds[9]);
this.node.getComponent(cc.Animation).play(`${this.currentSkin}Hurt`);
}
if (otherCollider.tag == 3) {
SoundController.playNoLoopSound(SoundController.instance.sounds[7]);
let effect = cc.instantiate(GamePlay.instance.fadePrefab);
effect.parent = this.node;
effect.position = this.node.convertToNodeSpaceAR(
......
......@@ -17,7 +17,7 @@ export default class LimitBar extends cc.Component {
}
fillTheBar() {
this.progress -= 0.006;
this.progress -= 0.005;
this.barSprite.fillRange = this.progress;
if (this.progress <= 0.6) {
this.winStar = 2;
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Save The Doge</title>
<!--http://www.html5rocks.com/en/mobile/mobifying/-->
<meta
name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"
/>
<!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta
name="apple-mobile-web-app-status-bar-style"
content="black-translucent"
/>
<meta name="format-detection" content="telephone=no" />
<!-- force webkit on 360 -->
<meta name="renderer" content="webkit" />
<meta name="force-rendering" content="webkit" />
<!-- force edge on IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- force full screen on some browser -->
<meta name="full-screen" content="yes" />
<meta name="x5-fullscreen" content="true" />
<meta name="360-fullscreen" content="true" />
<!-- force screen orientation on some browser -->
<meta name="screen-orientation" content="portrait" />
<meta name="x5-orientation" content="portrait" />
<!--fix fireball/issues/3568 -->
<!--<meta name="browsermode" content="application">-->
<meta name="x5-page-mode" content="app" />
<!--<link rel="apple-touch-icon" href=".png" />-->
<!--<link rel="apple-touch-icon-precomposed" href=".png" />-->
<!-- <link rel="stylesheet" type="text/css" href="style-mobile.css"/> -->
<link rel="icon" href="favicon.ico" />
</head>
<body>
<!-- <canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
<div id="splash">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div> -->
<script
async
src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1766156477558119"
crossorigin="anonymous"
></script>
<script>
window.adsbygoogle = window.adsbygoogle || [];
window.adBreak = function (o) {
adsbygoogle.push(o);
};
window.adConfig = function (o) {
adsbygoogle.push(o);
};
window.adConfig({
sound: "off",
preloadAdBreaks: "on",
onReady: () => {
console.log("AdSense Ready!");
},
});
</script>
<script>
let isMobile = false;
(function (a) {
if (
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(
a
) ||
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
a.substr(0, 4)
)
)
isMobile = true;
})(navigator.userAgent || navigator.vendor || window.opera);
let html = ``;
let html2 = ``;
if (isMobile) {
html = `
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
<div id="splash">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div>
`;
html2 = `<link rel="stylesheet" type="text/css" href="style-mobile.css"/>`;
} else {
html = `
<div id="GameDiv">
<canvas id="GameCanvas"></canvas>
<div id="splash">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div>
</div>
`;
html2 = `<link rel="stylesheet" type="text/css" href="style-desktop.css"/>`;
}
document.head.innerHTML += html2;
document.body.insertAdjacentHTML("afterbegin", html);
</script>
<script src="src/settings.js" charset="utf-8"></script>
<script src="main.js" charset="utf-8"></script>
<script type="text/javascript">
(function () {
// open web debugger console
if (typeof VConsole !== "undefined") {
window.vConsole = new VConsole();
}
var debug = window._CCSettings.debug;
var splash = document.getElementById("splash");
splash.style.display = "block";
function loadScript(moduleName, cb) {
function scriptLoaded() {
document.body.removeChild(domScript);
domScript.removeEventListener("load", scriptLoaded, false);
cb && cb();
}
var domScript = document.createElement("script");
domScript.async = true;
domScript.src = moduleName;
domScript.addEventListener("load", scriptLoaded, false);
document.body.appendChild(domScript);
}
loadScript(debug ? "cocos2d-js.js" : "cocos2d-js-min.js", function () {
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
loadScript(debug ? "physics.js" : "physics-min.js", window.boot);
} else {
window.boot();
}
});
})();
</script>
</body>
</html>
body {
cursor: default;
padding: 0;
/* border: 0;*/
margin: 0;
text-align: center;
background-color: black;
background-repeat: repeat;
background-size: contain;
background-image: url("./background.png");
font-family: Helvetica, Verdana, Arial, sans-serif;
}
body,
canvas,
div {
outline: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
#Cocos2dGameContainer {
position: absolute;
margin: 0;
overflow: hidden;
left: 0px;
top: 0px;
}
canvas {
background-color: rgba(0, 0, 0, 0);
}
a:link,
a:visited {
color: #000;
}
a:active,
a:hover {
color: #666;
}
p.header {
font-size: small;
}
p.footer {
font-size: x-small;
}
#splash {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #171717 url(./splash.png) no-repeat center;
background-size: 540px;
}
.progress-bar {
background-color: #1a1a1a;
position: absolute;
left: 50%;
top: 99%;
height: 5px;
width: 300px;
margin: 0 -150px;
border-radius: 5px;
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}
.progress-bar span {
display: block;
height: 100%;
border-radius: 5px;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset;
transition: width 0.4s ease-in-out;
background-color: #3dc5de;
}
.stripes span {
background-size: 30px 30px;
background-image: linear-gradient(
135deg,
rgba(255, 255, 255, 0.15) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, 0.15) 50%,
rgba(255, 255, 255, 0.15) 75%,
transparent 75%,
transparent
);
animation: animate-stripes 1s linear infinite;
}
@keyframes animate-stripes {
0% {
background-position: 0 0;
}
100% {
background-position: 60px 0;
}
}
h1 {
color: #444;
text-shadow: 3px 3px 15px;
}
#GameDiv {
width: calc(100vh * 45 / 80);
height: 100vh;
margin: 0 auto;
background: black;
position: relative;
}
html {
-ms-touch-action: none;
}
body, canvas, div {
display: block;
outline: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
user-select: none;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
-khtml-user-select: none;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
/* Remove spin of input type number */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
/* display: none; <- Crashes Chrome on hover */
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
body {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
padding: 0;
border: 0;
margin: 0;
cursor: default;
color: #888;
background-color: #333;
text-align: center;
font-family: Helvetica, Verdana, Arial, sans-serif;
display: flex;
flex-direction: column;
/* fix bug: https://github.com/cocos-creator/2d-tasks/issues/791 */
/* overflow cannot be applied in Cocos2dGameContainer,
otherwise child elements will be hidden when Cocos2dGameContainer rotated 90 deg */
overflow: hidden;
}
#Cocos2dGameContainer {
position: absolute;
margin: 0;
left: 0px;
top: 0px;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-align: center;
-webkit-box-pack: center;
}
canvas {
background-color: rgba(0, 0, 0, 0);
}
a:link, a:visited {
color: #666;
}
a:active, a:hover {
color: #666;
}
p.header {
font-size: small;
}
p.footer {
font-size: x-small;
}
#splash {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #171717 url(./splash.png) no-repeat center;
background-size: 45%;
}
.progress-bar {
position: absolute;
left: 27.5%;
top: 80%;
height: 3px;
padding: 2px;
width: 45%;
border-radius: 7px;
box-shadow: 0 1px 5px #000 inset, 0 1px 0 #444;
}
.progress-bar span {
display: block;
height: 100%;
border-radius: 3px;
transition: width .4s ease-in-out;
background-color: #3dc5de;
}
.stripes span {
background-size: 30px 30px;
background-image: linear-gradient(135deg, rgba(255, 255, 255, .15) 25%, transparent 25%,
transparent 50%, rgba(255, 255, 255, .15) 50%, rgba(255, 255, 255, .15) 75%,
transparent 75%, transparent);
animation: animate-stripes 1s linear infinite;
}
@keyframes animate-stripes {
0% {background-position: 0 0;} 100% {background-position: 60px 0;}
}
{
"title": "SaveTheDoge",
"packageName": "org.cocos2d.demo",
"startScene": "73089584-bdb3-4639-abbf-bb4f569866a9",
"excludeScenes": [],
"orientation": {
"landscapeRight": true,
"landscapeLeft": true,
"portrait": false,
"upsideDown": false
},
"webOrientation": "auto",
"inlineSpriteFrames": true,
"inlineSpriteFrames_native": true,
"mainCompressionType": "default",
"mainIsRemote": false,
"optimizeHotUpdate": false,
"md5Cache": true,
"nativeMd5Cache": true,
"encryptJs": true,
"xxteaKey": "5e03b453-5a96-44",
"zipCompressJs": true,
"fb-instant-games": {},
"android": {
"packageName": "org.cocos2d.demo",
"REMOTE_SERVER_ROOT": ""
},
"ios": {
"packageName": "org.cocos2d.demo",
"REMOTE_SERVER_ROOT": "",
"ios_enable_jit": true
},
"mac": {
"packageName": "org.cocos2d.demo",
"REMOTE_SERVER_ROOT": "",
"width": 1280,
"height": 720
},
"win32": {
"REMOTE_SERVER_ROOT": "",
"width": 1280,
"height": 720
},
"android-instant": {
"packageName": "org.cocos2d.demo",
"REMOTE_SERVER_ROOT": "",
"pathPattern": "",
"scheme": "https",
"host": "",
"skipRecord": false,
"recordPath": ""
},
"appBundle": false,
"agreements": {}
}
{
"start-scene": "73089584-bdb3-4639-abbf-bb4f569866a9"
"start-scene": "73089584-bdb3-4639-abbf-bb4f569866a9",
"last-module-event-record-time": 1693293321483
}
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