Commit 66c7ef8a authored by Li MingZhe's avatar Li MingZhe

feat:同步测试

parent 83a2d5dd
No preview for this file type
......@@ -237,7 +237,7 @@ cc.Class({
this.isDebug = true;
this.isTeacher = true;
// this.isTeacher = true;
this.treeTypeArr = ['apple', 'banana', 'orange'];
this.typeIndex = 0;
......@@ -421,7 +421,18 @@ cc.Class({
case 'sentence_panel_speak_click':
this.sentencePanelSpeakClick();
break;
case 'chinese_btn_click':
this.chineseBtnClick();
break;
case 'bottom_tip_btn_click':
this.bottomTipBtnClick(data.btnIndex);
break;
case 'next_btn_click':
this.nextBtnClick();
break;
......@@ -472,6 +483,7 @@ cc.Class({
},
chineseBtn: null,
initTitle() {
const title = getSprNode('bg_title');
......@@ -487,20 +499,29 @@ cc.Class({
chineseBtn.scale = this._mapScaleMin;
chineseBtn.x = this.canvas.width / 2 - (20 + chineseBtn.width / 2) * this._mapScaleMin;
chineseBtn.y = this.canvas.height / 2 - (20 + chineseBtn.height / 2 ) * this._mapScaleMin;
this.canvas.addChild(chineseBtn)
this.canvas.addChild(chineseBtn, 35)
chineseBtn.on(cc.Node.EventType.TOUCH_START, () => {
showBtnAnima(chineseBtn);
if (this.tipClipId) {
cc.audioEngine.stop(this.tipClipId)
}
this.tipClipId = playAudio(this.tipClip);
this.sendServerEvent("chinese_btn_click", {});
})
this.chineseBtn = chineseBtn;
}
},
chineseBtnClick() {
const chineseBtn = this.chineseBtn;
showBtnAnima(chineseBtn);
if (this.tipClipId) {
cc.audioEngine.stop(this.tipClipId)
}
this.tipClipId = playAudio(this.tipClip);
},
bgGround: null,
......@@ -774,7 +795,6 @@ cc.Class({
soundIcon.addComponent(cc.Button)
soundIcon.on("click", () => {
this.sentenceLayerSoundClick();
this.sendServerEvent("sentence_layer_sound_click", {});
})
......@@ -810,7 +830,9 @@ cc.Class({
goodJobLayer: null,
initGoodJobLayer() {
const goodJobLayer = new cc.Node();
this.canvas.addChild(goodJobLayer);
goodJobLayer.width = this.canvas.width;
goodJobLayer.height = this.canvas.height;
this.canvas.addChild(goodJobLayer, 40);
const bgBlack = getSprNode("bg_black")
bgBlack.scaleX = this.canvas.width / bgBlack.width;
......@@ -867,46 +889,58 @@ cc.Class({
bg.tiBtnArr = [goodBtn, greatBtn, perfectBtn];
this.addTiBtnListener(goodBtn);
this.addTiBtnListener(greatBtn);
this.addTiBtnListener(perfectBtn);
// if (!this.isTeacher) {
// ti.active = false;
// }
this.addTiBtnListener(0, bg.tiBtnArr);
this.addTiBtnListener(1, bg.tiBtnArr);
this.addTiBtnListener(2, bg.tiBtnArr);
if (!this.isTeacher) {
ti.active = false;
}
},
addTiBtnListener(btn) {
addTiBtnListener(btnIndex, tiBtnArr) {
const btn = tiBtnArr[btnIndex];
btn.on(cc.Node.EventType.TOUCH_START, () => {
showBtnAnima(btn);
if (btn.isClicked) {
return;
}
btn.isClicked = true;
this.sendServerEvent("bottom_tip_btn_click", {btnIndex})
})
},
cc.tween(btn.star)
.to(0.3, {opacity: 0}, {easing: "cubicIn"})
.call(() => {
if (this.wordLayer.active) {
this.showWordLayerStar(btn.starNum);
this.addSmallBasketFruit();
} else {
this.showSentenceLayerStar(btn.starNum);
this.addBigBasketFruit();
}
bottomTipBtnClick(index) {
let btn;
if (this.wordLayer.active) {
btn = this.wordLayer.tiBtnArr[index];
} else {
btn = this.sentenceLayer.tiBtnArr[index];
}
})
.start();
if (btn.isClicked) {
return;
}
btn.isClicked = true;
playAudio(this.stripClip);
playAudio(this.btnStarClip);
cc.tween(btn.star)
.to(0.3, {opacity: 0}, {easing: "cubicIn"})
.call(() => {
if (this.wordLayer.active) {
this.showWordLayerStar(btn.starNum);
this.addSmallBasketFruit();
} else {
this.showSentenceLayerStar(btn.starNum);
this.addBigBasketFruit();
}
})
})
.start();
playAudio(this.stripClip);
playAudio(this.btnStarClip);
},
showWordLayerStar(starNum) {
const fillStar = this.wordLayer['star_' + starNum];
cc.tween(fillStar)
......@@ -1888,7 +1922,7 @@ cc.Class({
const p = goodJob.position;
this.showOneFirework(p, this.canvas, cc.find('paperBase').children, 300, 500, 30, 1);
this.showOneFirework(p, goodJobLayer, cc.find('paperBase').children, 300, 500, 30, 1);
},
......@@ -3294,7 +3328,11 @@ cc.Class({
initNextBtn() {
const nextBtn = getSprNode("btn_next");
this.bgGround.addChild(nextBtn, 20)
nextBtn.x = - this.bgGround.x - this.canvas.width / 2 + this.canvas.width / this.bgGround.scaleX - 100;
const wordX = this.canvas.width / 2;
const localPos = this.bgGround.convertToNodeSpaceAR(this.canvas.convertToWorldSpaceAR(cc.v2(wordX, 0)));
nextBtn.x = localPos.x;
nextBtn.y = 150;
nextBtn.scale = this._mapScaleMin;
this.nextBtn = nextBtn;
......@@ -3303,20 +3341,29 @@ cc.Class({
nextBtn.addComponent(cc.Button)
nextBtn.on("click", () => {
if (nextBtn.isClicked) {
return;
}
nextBtn.isClicked = true;
this.enterNextTree();
playAudio(this.clickClip)
this.sendServerEvent("next_btn_click", {});
})
this.initHand(nextBtn);
this.showHandAnima(nextBtn)
// nextBtn.y = -100;
},
nextBtnClick() {
const nextBtn = this.nextBtn;
if (nextBtn.isClicked) {
return;
}
nextBtn.isClicked = true;
this.enterNextTree();
playAudio(this.clickClip)
},
initHand(btn) {
console.log("in showHand");
......@@ -3351,11 +3398,15 @@ cc.Class({
.to(0.5, {opacity: 255}, {easing: "cubicOut"})
.start();
btn.x = - this.bgGround.x - this.canvas.width / 2 + this.canvas.width / this.bgGround.scaleX - 100;
const wordX = this.canvas.width / 2 - 100 * this._mapScaleMin;
const localPos = this.bgGround.convertToNodeSpaceAR(this.canvas.convertToWorldSpaceAR(cc.v2(wordX, 0)));
btn.x = localPos.x;
// btn.x = - this.bgGround.x - this.canvas.width / 2 + this.canvas.width / this.bgGround.scaleX - 100;
btn.isClicked = false;
// }
this.showHandAnima(btn)
},
showHandAnima(btn) {
......
......@@ -12,7 +12,7 @@
"quality": 80,
"contourBleed": true,
"paddingBleed": true,
"filterUnused": false,
"filterUnused": true,
"packable": false,
"premultiplyAlpha": false,
"filterMode": "bilinear",
......
......@@ -12,7 +12,7 @@
"quality": 80,
"contourBleed": true,
"paddingBleed": true,
"filterUnused": false,
"filterUnused": true,
"packable": false,
"premultiplyAlpha": false,
"filterMode": "bilinear",
......
......@@ -12,7 +12,7 @@
"quality": 80,
"contourBleed": true,
"paddingBleed": true,
"filterUnused": false,
"filterUnused": true,
"packable": false,
"premultiplyAlpha": false,
"filterMode": "bilinear",
......
......@@ -3,6 +3,6 @@
"packages": "packages",
"name": "play",
"id": "9af72fd2-44a6-4131-8ea3-3e1b3fa22231",
"version": "2.4.0",
"version": "2.4.4",
"isNew": false
}
\ No newline at end of file
No preview for this file type
{"ios":{"sceneName":"aks_03","version":"7f36f"},"android":{"sceneName":"aks_03","version":"7f36f"}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Cocos Creator | hello_world</title>
<meta name="viewport" content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="full-screen" content="yes"/>
<meta name="screen-orientation" content="portrait"/>
<meta name="x5-fullscreen" content="true"/>
<meta name="360-fullscreen" content="true"/>
<meta name="renderer" content="webkit"/>
<meta name="force-rendering" content="webkit"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<link rel="stylesheet" type="text/css" href="style-desktop.css"/>
<link rel="icon" href="favicon.ico"/>
</head>
<body>
<!-- <h1 class="header">hello_world</h1> -->
<!-- <div id="GameDiv" style="width:1280px; height: 720px;"> -->
<canvas id="GameCanvas" width="100%" height="100%"></canvas>
<div id="splash">
<div class="progress-bar stripes">
<span style="width: 0%"></span>
</div>
</div>
<!-- </div> -->
<!-- <p class="footer">Made with <a href="https://www.cocos.com/products#CocosCreator" title="cocos creator">Cocos Creator</a></p> -->
<script src="src/settings.js" charset="utf-8"></script>
<script src="main.js" charset="utf-8"></script>
<script type="text/javascript" src="https://staging-teach.cdn.ireadabc.com/h5template/h5-static-lib/js/air_online_open.js"></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>
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
bl@^1.0.0:
version "1.2.3"
resolved "https://registry.npm.taobao.org/bl/download/bl-1.2.3.tgz#1e8dd80142eac80d7158c9dccc047fb620e035e7"
integrity sha1-Ho3YAULqyA1xWMnczAR/tiDgNec=
dependencies:
readable-stream "^2.3.5"
safe-buffer "^5.1.1"
buffer-alloc-unsafe@^1.1.0:
version "1.1.0"
resolved "https://registry.npm.taobao.org/buffer-alloc-unsafe/download/buffer-alloc-unsafe-1.1.0.tgz#bd7dc26ae2972d0eda253be061dba992349c19f0"
integrity sha1-vX3CauKXLQ7aJTvgYdupkjScGfA=
buffer-alloc@^1.2.0:
version "1.2.0"
resolved "https://registry.npm.taobao.org/buffer-alloc/download/buffer-alloc-1.2.0.tgz#890dd90d923a873e08e10e5fd51a57e5b7cce0ec"
integrity sha1-iQ3ZDZI6hz4I4Q5f1RpX5bfM4Ow=
dependencies:
buffer-alloc-unsafe "^1.1.0"
buffer-fill "^1.0.0"
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.nlark.com/buffer-crc32/download/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
buffer-fill@^1.0.0:
version "1.0.0"
resolved "https://registry.nlark.com/buffer-fill/download/buffer-fill-1.0.0.tgz#f8f78b76789888ef39f205cd637f68e702122b2c"
integrity sha1-+PeLdniYiO858gXNY39o5wISKyw=
compressing@^1.5.0:
version "1.5.1"
resolved "https://registry.npm.taobao.org/compressing/download/compressing-1.5.1.tgz#d031a3311b8c2ed6561a8431671d5a844540482d"
integrity sha1-0DGjMRuMLtZWGoQxZx1ahEVASC0=
dependencies:
flushwritable "^1.0.0"
get-ready "^1.0.0"
iconv-lite "^0.5.0"
mkdirp "^0.5.1"
pump "^3.0.0"
streamifier "^0.1.1"
tar-stream "^1.5.2"
yauzl "^2.7.0"
yazl "^2.4.2"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.nlark.com/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=
end-of-stream@^1.0.0, end-of-stream@^1.1.0:
version "1.4.4"
resolved "https://registry.npm.taobao.org/end-of-stream/download/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha1-WuZKX0UFe682JuwU2gyl5LJDHrA=
dependencies:
once "^1.4.0"
fd-slicer@~1.1.0:
version "1.1.0"
resolved "https://registry.npm.taobao.org/fd-slicer/download/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=
dependencies:
pend "~1.2.0"
flushwritable@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/flushwritable/download/flushwritable-1.0.0.tgz#3e328d8fde412ad47e738e3be750b4d290043498"
integrity sha1-PjKNj95BKtR+c44751C00pAENJg=
fs-constants@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/fs-constants/download/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha1-a+Dem+mYzhavivwkSXue6bfM2a0=
get-ready@^1.0.0:
version "1.0.0"
resolved "https://registry.npm.taobao.org/get-ready/download/get-ready-1.0.0.tgz#f91817f1e9adecfea13a562adfc8de883ab34782"
integrity sha1-+RgX8emt7P6hOlYq38jeiDqzR4I=
iconv-lite@^0.5.0:
version "0.5.2"
resolved "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.5.2.tgz#af6d628dccfb463b7364d97f715e4b74b8c8c2b8"
integrity sha1-r21ijcz7RjtzZNl/cV5LdLjIwrg=
dependencies:
safer-buffer ">= 2.1.2 < 3"
inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.nlark.com/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=
mkdirp@^0.5.1:
version "0.5.5"
resolved "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.5.tgz?cache=0&sync_timestamp=1604053732604&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha1-2Rzv1i0UNsoPQWIOJRKI1CAJne8=
dependencies:
minimist "^1.2.5"
once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
pend@~1.2.0:
version "1.2.0"
resolved "https://registry.nlark.com/pend/download/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA=
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha1-eCDZsWEgzFXKmud5JoCufbptf+I=
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
readable-stream@^2.3.0, readable-stream@^2.3.5:
version "2.3.7"
resolved "https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
safe-buffer@^5.1.1:
version "5.2.1"
resolved "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.nlark.com/safe-buffer/download/safe-buffer-5.1.2.tgz?cache=0&sync_timestamp=1618847044058&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha1-mR7GnSluAxN0fVm9/St0XDX4go0=
"safer-buffer@>= 2.1.2 < 3":
version "2.1.2"
resolved "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=
streamifier@^0.1.1:
version "0.1.1"
resolved "https://registry.npm.taobao.org/streamifier/download/streamifier-0.1.1.tgz#97e98d8fa4d105d62a2691d1dc07e820db8dfc4f"
integrity sha1-l+mNj6TRBdYqJpHR3AfoINuN/E8=
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
integrity sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=
dependencies:
safe-buffer "~5.1.0"
tar-stream@^1.5.2:
version "1.6.2"
resolved "https://registry.npm.taobao.org/tar-stream/download/tar-stream-1.6.2.tgz?cache=0&sync_timestamp=1609236246435&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftar-stream%2Fdownload%2Ftar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
integrity sha1-jqVdqzeXIlPZqa+Q/c1VmuQ1xVU=
dependencies:
bl "^1.0.0"
buffer-alloc "^1.2.0"
end-of-stream "^1.0.0"
fs-constants "^1.0.0"
readable-stream "^2.3.0"
to-buffer "^1.1.1"
xtend "^4.0.0"
to-buffer@^1.1.1:
version "1.1.1"
resolved "https://registry.npm.taobao.org/to-buffer/download/to-buffer-1.1.1.tgz#493bd48f62d7c43fcded313a03dcadb2e1213a80"
integrity sha1-STvUj2LXxD/N7TE6A9ytsuEhOoA=
util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Futil-deprecate%2Fdownload%2Futil-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
wrappy@1:
version "1.0.2"
resolved "https://registry.nlark.com/wrappy/download/wrappy-1.0.2.tgz?cache=0&sync_timestamp=1619133505879&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fwrappy%2Fdownload%2Fwrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
xtend@^4.0.0:
version "4.0.2"
resolved "https://registry.nlark.com/xtend/download/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"
integrity sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=
yauzl@^2.7.0:
version "2.10.0"
resolved "https://registry.npm.taobao.org/yauzl/download/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=
dependencies:
buffer-crc32 "~0.2.3"
fd-slicer "~1.1.0"
yazl@^2.4.2:
version "2.5.1"
resolved "https://registry.npm.taobao.org/yazl/download/yazl-2.5.1.tgz#a3d65d3dd659a5b0937850e8609f22fffa2b5c35"
integrity sha1-o9ZdPdZZpbCTeFDoYJ8i//orXDU=
dependencies:
buffer-crc32 "~0.2.3"
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