Commit 2fe3df96 authored by 李维's avatar 李维

uat feedback

parent 645d4bd7
...@@ -146,10 +146,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -146,10 +146,10 @@ export class PlayComponent implements OnInit, OnDestroy {
m_requestAfterCard = false; m_requestAfterCard = false;
m_requestID = null; m_requestID = null;
m_enableRunway = false; m_enableRunway = false;
m_currentFocusCard = -1; m_currentFocusCard = 0;
m_enableAutoRunFocus = false;
m_autoFocusID = null; m_autoFocusID = null;
m_enableCamera = true; m_enableCamera = true;
m_nextCardLock = false;
// ------------------------------------ // ------------------------------------
...@@ -223,12 +223,11 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -223,12 +223,11 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initBillboard(); this.initBillboard();
this.initCamera(); this.initCamera();
this.initCards(); this.initCards();
this.m_enableAutoRunFocus = true;
this.autoRunFocus()
this.initShowCard(); this.initShowCard();
this.g_cartoon.playAudio("sm-run", false ,null, true, (audio)=>{ this.g_cartoon.playAudio("sm-run", false ,null, true, (audio)=>{
audio.volume = 0.3 audio.volume = 0.3
}) })
this.autoRollRun()
} }
cleanGameVar(){ cleanGameVar(){
...@@ -243,9 +242,9 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -243,9 +242,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_requestAfterCard = false; this.m_requestAfterCard = false;
this.m_requestID = null; this.m_requestID = null;
this.m_enableRunway = false; this.m_enableRunway = false;
this.m_currentFocusCard = -1; this.m_currentFocusCard = 0;
this.m_enableAutoRunFocus = false;
this.m_autoFocusID = null this.m_autoFocusID = null
this.m_nextCardLock = false;
} }
endGame(){ endGame(){
...@@ -303,6 +302,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -303,6 +302,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.subscribeMapDownEvent(element.id, ()=>{ this.subscribeMapDownEvent(element.id, ()=>{
if(this.m_enableCamera){ if(this.m_enableCamera){
this.m_enableCamera = false; this.m_enableCamera = false;
this.m_enableRunway = false;
this.g_cartoon.stopAudio("sm-run") this.g_cartoon.stopAudio("sm-run")
clearTimeout(this.m_autoFocusID) clearTimeout(this.m_autoFocusID)
this.g_cartoon.playAudio("sm-camera") this.g_cartoon.playAudio("sm-camera")
...@@ -318,12 +318,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -318,12 +318,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// 选择卡片 // 选择卡片
initCards(){ initCards(){
let repeatNum = Math.floor(this.g_canvasWidth / (249*this.g_mapScale)) + 2
let boundingBox = this.g_cartoon.getCartoonElement('Camera-Roll').ref.getBoundingBox() let boundingBox = this.g_cartoon.getCartoonElement('Camera-Roll').ref.getBoundingBox()
let cardWidth = 265*this.g_mapScale let cardWidth = 265*this.g_mapScale
let cardNumber = Math.ceil(this.g_canvasWidth/cardWidth); let cardNumber = Math.ceil(this.g_canvasWidth/cardWidth);
let cardDetailArray = this.g_formData.dataArray let cardDetailArray = this.g_formData.dataArray
for(let index=0; index<cardDetailArray.length; index++){ for(let index=0; index<(cardDetailArray.length) * repeatNum; index++){
let newCard = this.createCard(index,index*cardWidth,boundingBox.y,cardDetailArray[index]); let newCard = this.createCard(index,index*cardWidth,boundingBox.y,cardDetailArray[index%cardDetailArray.length]);
if(index>=cardNumber){ if(index>=cardNumber){
newCard.ref.x = -999 newCard.ref.x = -999
newCard.waiting = true; newCard.waiting = true;
...@@ -403,7 +404,13 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -403,7 +404,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// 高亮 // 高亮
let cardContentHighlight = this.g_cartoon.createCartoonElementImage(`card-content-highlight-${index}`, "card-hightlight", 256, 285, 5, -4) let cardContentHighlight = this.g_cartoon.createCartoonElementImage(`card-content-highlight-${index}`, "card-hightlight", 256, 285, 5, -4)
if(index==0){
cardContentHighlight.ref.alpha = 1;
cardContentHighlight.ref.visible = true;
}else{
cardContentHighlight.ref.alpha = 0; cardContentHighlight.ref.alpha = 0;
cardContentHighlight.ref.visible = false;
}
element.ref.addChild(cardContentHighlight.ref) element.ref.addChild(cardContentHighlight.ref)
element.moveLeft = (distance)=>{ element.moveLeft = (distance)=>{
...@@ -411,6 +418,12 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -411,6 +418,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if(element.content){ if(element.content){
element.content.ref.x -= distance; element.content.ref.x -= distance;
} }
if(cardContentHighlight.ref.visible){
if(!this.m_nextCardLock && element.ref.x<=0){
this.nextFocus()
}
}
} }
element.readyGoOut = (x)=>{ element.readyGoOut = (x)=>{
...@@ -436,19 +449,17 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -436,19 +449,17 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
// 跑道启停控制 // 跑道启停控制
cardRunControl(distance, callback?){ autoRollRun(){
if(!this.m_enableRunway){ if(!this.m_enableRunway){
return; return;
} }
let step = Math.floor(10*this.g_mapScale*10000)/20000; let step = Math.floor(3*this.g_mapScale*10000)/20000;
let cardElement = null; let cardElement = null;
this.m_runIntervalId = setInterval(()=>{ this.m_runIntervalId = setInterval(()=>{
distance -= step;
if(distance<=0){
clearInterval(this.m_runIntervalId);
callback && callback()
}
this.m_allCardIds.forEach((id)=>{ this.m_allCardIds.forEach((id)=>{
if(!this.m_enableRunway){
return;
}
cardElement = this.g_cartoon.getCartoonElement(id) cardElement = this.g_cartoon.getCartoonElement(id)
cardElement.moveLeft(step) cardElement.moveLeft(step)
this.cardRecyclingAndPreparation(id) this.cardRecyclingAndPreparation(id)
...@@ -485,6 +496,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -485,6 +496,7 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
nextFocus(callback?){ nextFocus(callback?){
this.m_nextCardLock = true;
let all = this.m_allCardIds.length let all = this.m_allCardIds.length
let current = this.m_currentFocusCard let current = this.m_currentFocusCard
let next = -1 let next = -1
...@@ -494,45 +506,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -494,45 +506,15 @@ export class PlayComponent implements OnInit, OnDestroy {
next = current + 1 next = current + 1
} }
if(this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).ref.x>=this.g_canvasWidth-300*this.g_mapScale){
this.m_enableCamera = false;
this.g_enableMapDown = false;
let distance = this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).ref.x / 2
this.cardRunControl(distance, ()=>{
if(current != -1){
this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).hideHighlight()
}
this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).showHighlight(()=>{
this.m_enableCamera = true;
this.g_enableMapDown = true;
callback && callback()
})
this.m_currentFocusCard = next;
})
}else{
if(current != -1){ if(current != -1){
this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).hideHighlight() this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).hideHighlight()
} }
this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).showHighlight(()=>{ this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).showHighlight(()=>{
this.m_nextCardLock = false;
callback && callback() callback && callback()
}) })
this.m_currentFocusCard = next; this.m_currentFocusCard = next;
} }
}
autoRunFocus(){
if(this.m_enableAutoRunFocus){
this.nextFocus(()=>{
if(this.m_enableAutoRunFocus){
this.m_autoFocusID = setTimeout(()=>{
if(this.m_enableAutoRunFocus){
this.autoRunFocus()
}
},3000)
}
})
}
}
initShowCard(){ initShowCard(){
let element = this.g_cartoon.createCartoonElementImageFunc(`card-show`, "Image-05", (w, h)=>{ let element = this.g_cartoon.createCartoonElementImageFunc(`card-show`, "Image-05", (w, h)=>{
...@@ -552,7 +534,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -552,7 +534,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let closeBntton = this.g_cartoon.createCartoonElementImage(`card-show-close`, "close", 50, 50, 100, -100) let closeBntton = this.g_cartoon.createCartoonElementImage(`card-show-close`, "close", 50, 50, 100, -100)
element.ref.addChild(closeBntton.ref) element.ref.addChild(closeBntton.ref)
let cardHighlight = this.g_cartoon.createCartoonElementImage(`card-highlight`, "highlight", 439*0.7, 408*0.7, 0, 0) let cardHighlight = this.g_cartoon.createCartoonElementImage(`card-highlight`, "highlight", 677*0.6, 660*0.6, 0, 0)
element.ref.children.unshift(cardHighlight.ref) element.ref.children.unshift(cardHighlight.ref)
let clickTarget = this.g_cartoon.createCartoonElementImage(`card-click-target`, "Image-05", 170, 170, 0, 0) let clickTarget = this.g_cartoon.createCartoonElementImage(`card-click-target`, "Image-05", 170, 170, 0, 0)
...@@ -625,9 +607,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -625,9 +607,8 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
element.show = (callback?)=>{ element.show = (callback?)=>{
element.setContent(this.g_formData.dataArray[this.m_currentFocusCard]) element.setContent(this.g_formData.dataArray[this.m_currentFocusCard % this.g_formData.dataArray.length])
element.ref.visible = true; element.ref.visible = true;
this.m_enableAutoRunFocus = false
tweenChange(element.ref, {scaleX: element.ref.initScaleX, scaleY: element.ref.initScaleY}, 0.3, ()=>{ tweenChange(element.ref, {scaleX: element.ref.initScaleX, scaleY: element.ref.initScaleY}, 0.3, ()=>{
this.g_cartoon.playAudio(element.audio_url) this.g_cartoon.playAudio(element.audio_url)
callback && callback() callback && callback()
...@@ -635,10 +616,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -635,10 +616,8 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
element.hide = (callback?)=>{ element.hide = (callback?)=>{
this.m_enableAutoRunFocus = true;
element.audio_url = null; element.audio_url = null;
this.g_cartoon.stopAudio(element.audio_url) this.g_cartoon.stopAudio(element.audio_url)
this.autoRunFocus()
tweenChange(element.ref, {scaleX: 0, scaleY: 0}, 0.3, ()=>{ tweenChange(element.ref, {scaleX: 0, scaleY: 0}, 0.3, ()=>{
element.ref.visible = false; element.ref.visible = false;
let textIndex = element.ref.children.indexOf(element.textContent) let textIndex = element.ref.children.indexOf(element.textContent)
...@@ -667,6 +646,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -667,6 +646,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.stopAudio(element.audio_url) this.g_cartoon.stopAudio(element.audio_url)
this.m_enableCamera = true; this.m_enableCamera = true;
element.hide(()=>{ element.hide(()=>{
this.m_enableRunway = true;
this.g_enableMapDown = true this.g_enableMapDown = true
}) })
}) })
...@@ -676,7 +656,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -676,7 +656,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 灯光 // 灯光
initLights(){ initLights(){
let totalLightCount = Math.ceil(this.g_canvasWidth / (82*this.g_mapScale)) let totalLightCount = Math.ceil(this.g_canvasWidth / (38*this.g_mapScale))
let baseY = this.g_cartoon.getCartoonElement('Camera-Roll').ref.y let baseY = this.g_cartoon.getCartoonElement('Camera-Roll').ref.y
let height = this.g_cartoon.getCartoonElement('Camera-Roll').ref.height*this.g_mapScale let height = this.g_cartoon.getCartoonElement('Camera-Roll').ref.height*this.g_mapScale
let pos_y = [ let pos_y = [
...@@ -699,11 +679,11 @@ initLights(){ ...@@ -699,11 +679,11 @@ initLights(){
createLights(line, row, base_x, pos_y, stuats){ createLights(line, row, base_x, pos_y, stuats){
if(stuats){ if(stuats){
let element = this.g_cartoon.createCartoonElementImage(`water-light-${line}-${row}-on`, "light-on", 38*this.g_mapScale, 35*this.g_mapScale, base_x + row*82*this.g_mapScale, pos_y[line]) let element = this.g_cartoon.createCartoonElementImage(`water-light-${line}-${row}-on`, "light-on", 38*this.g_mapScale, 35*this.g_mapScale, base_x + row*38*this.g_mapScale, pos_y[line])
element.ref.visible = false; element.ref.visible = false;
return element; return element;
}else{ }else{
let element = this.g_cartoon.createCartoonElementImage(`water-light-${line}-${row}-off`, "light-off", 16*this.g_mapScale, 18*this.g_mapScale, base_x + row*82*this.g_mapScale, pos_y[line]) let element = this.g_cartoon.createCartoonElementImage(`water-light-${line}-${row}-off`, "light-off", 16*this.g_mapScale, 18*this.g_mapScale, base_x + row*38*this.g_mapScale, pos_y[line])
return element; return element;
} }
} }
......
src/assets/play/highlight.png

267 KB | W: | H:

src/assets/play/highlight.png

353 KB | W: | H:

src/assets/play/highlight.png
src/assets/play/highlight.png
src/assets/play/highlight.png
src/assets/play/highlight.png
  • 2-up
  • Swipe
  • Onion skin
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