Commit 3ca854f0 authored by Tt's avatar Tt

飞行棋修改

parent 8cdc0b84
...@@ -21,6 +21,7 @@ export default class NewClass extends cc.Component { ...@@ -21,6 +21,7 @@ export default class NewClass extends cc.Component {
private aning; private aning;
onLoad() { onLoad() {
this.aning = false; this.aning = false;
this.showAni();
} }
protected onDestroy(): void { protected onDestroy(): void {
cc.Tween.stopAll(); cc.Tween.stopAll();
...@@ -29,16 +30,19 @@ export default class NewClass extends cc.Component { ...@@ -29,16 +30,19 @@ export default class NewClass extends cc.Component {
showAni() { showAni() {
if (this.aning) return; if (this.aning) return;
if (this.node && this.node.active) { if (this.node && this.node.active) {
this.node.x += 400; // this.node.y -= 200;
this.node.y -= 200; // this.aning = true;
this.aning = true; cc.tween(this.node).repeatForever(
cc.tween(this.node).by(0.3, { x: -400, y: 200 }).delay(1.5).call(() => { cc.tween()
this.aning = false; .by(.5, { y: -50 })
this.showAni(); .by(.5, { y: 50 }).start()
}).start(); ).start();
// this.aning = false;
// this.showAni();
// }).start();
} }
} }
update(dt) { update(dt) {
this.showAni(); // this.showAni();
} }
} }
This diff is collapsed.
...@@ -76,6 +76,8 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -76,6 +76,8 @@ export default class NewClass extends MyCocosSceneComponent {
this.layout_start.active = true; this.layout_start.active = true;
pg.audio.playAudioByUrl(Game.getIns().question.audio); pg.audio.playAudioByUrl(Game.getIns().question.audio);
this.initMap();
} }
initEvent() { initEvent() {
pg.view.touchOn(pg.view.find(this.layout_start, 'btn_start'), this.onTouchStart, this); pg.view.touchOn(pg.view.find(this.layout_start, 'btn_start'), this.onTouchStart, this);
...@@ -107,6 +109,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -107,6 +109,7 @@ export default class NewClass extends MyCocosSceneComponent {
pg.audio.resumeBgm(); pg.audio.resumeBgm();
} }
onTouchStart() { onTouchStart() {
this.layout_start.active = false; this.layout_start.active = false;
cc.audioEngine.stopAllEffects(); cc.audioEngine.stopAllEffects();
...@@ -134,8 +137,21 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -134,8 +137,21 @@ export default class NewClass extends MyCocosSceneComponent {
vs.active = false; vs.active = false;
}).start(); }).start();
} }
initMap() {
let chess = pg.view.find(this, 'chess');
let items = pg.view.find(chess, 'items');
let item = pg.view.find(chess, 'item');
item.active = false;
let list = Game.getIns().getItemList();
list.forEach(li => {
let node = cc.instantiate(item);
node.x = li.box_x;
node.y = li.box_y;
node.active = true;
pg.view.setNetImg(node.getChildByName('img'), li.ext.img, { w: 75, h: 75 })
node.parent = items;
})
}
//-----------------------------流程------------------------------ //-----------------------------流程------------------------------
private playerPoint: number;// private playerPoint: number;//
private robotPoint: number;// private robotPoint: number;//
...@@ -344,6 +360,7 @@ export default class NewClass extends MyCocosSceneComponent { ...@@ -344,6 +360,7 @@ export default class NewClass extends MyCocosSceneComponent {
let hand = pg.view.find(touzi_ani, "hand"); let hand = pg.view.find(touzi_ani, "hand");
let btn_stop = pg.view.find(touzi_ani, "btn_stop"); let btn_stop = pg.view.find(touzi_ani, "btn_stop");
pg.view.visible(touzi_ani, true); pg.view.visible(touzi_ani, true);
pg.event.emit("player_point_update", { isRobot: this.turnRobot, num: 0 });
touzi.startAni(); touzi.startAni();
if (this.turnRobot) { if (this.turnRobot) {
this.scheduleOnce(this.stopTouzi, 1); this.scheduleOnce(this.stopTouzi, 1);
......
...@@ -98,7 +98,7 @@ export default class SpeakRecord extends cc.Component { ...@@ -98,7 +98,7 @@ export default class SpeakRecord extends cc.Component {
let img = pg.view.find(this.text_tip, "img"); let img = pg.view.find(this.text_tip, "img");
let ext = this.data.ext; let ext = this.data.ext;
pg.view.setNetImg(img, ext.img, { w: 550, h: 270 }) pg.view.setNetImg(img, ext.img, { w: 550, h: 270 })
pg.view.setString(text, ext.text); pg.view.setString(text, ext.tip);
this.onTouchVoice(); this.onTouchVoice();
pg.view.touchOn(img, this.onTouchVoice, this); pg.view.touchOn(img, this.onTouchVoice, this);
} }
......
...@@ -112,6 +112,11 @@ export default class Game { ...@@ -112,6 +112,11 @@ export default class Game {
}) })
} }
} }
getItemList() {
return this.map.filter(m => {
return m.type === '1';
})
}
mapFull() { mapFull() {
} }
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
"rawHeight": 750, "rawHeight": 750,
"borderTop": 0, "borderTop": 0,
"borderBottom": 0, "borderBottom": 0,
"borderLeft": 0, "borderLeft": 200,
"borderRight": 0, "borderRight": 0,
"subMetas": {} "subMetas": {}
} }
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 1920, "width": 983,
"height": 1200, "height": 702,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"bg_map": { "bg_map": {
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 229, "width": 279,
"height": 145, "height": 101,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"btn_audio-stop": { "btn_audio-stop": {
......
assets/ns20_jsqj/textures/btn_start.png

6.51 KB | W: | H:

assets/ns20_jsqj/textures/btn_start.png

6.02 KB | W: | H:

assets/ns20_jsqj/textures/btn_start.png
assets/ns20_jsqj/textures/btn_start.png
assets/ns20_jsqj/textures/btn_start.png
assets/ns20_jsqj/textures/btn_start.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
"premultiplyAlpha": false, "premultiplyAlpha": false,
"genMipmaps": false, "genMipmaps": false,
"packable": true, "packable": true,
"width": 102, "width": 39,
"height": 98, "height": 59,
"platformSettings": {}, "platformSettings": {},
"subMetas": { "subMetas": {
"icon_player": { "icon_player": {
......
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