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

uat feedback

parent 645d4bd7
......@@ -146,10 +146,10 @@ export class PlayComponent implements OnInit, OnDestroy {
m_requestAfterCard = false;
m_requestID = null;
m_enableRunway = false;
m_currentFocusCard = -1;
m_enableAutoRunFocus = false;
m_currentFocusCard = 0;
m_autoFocusID = null;
m_enableCamera = true;
m_nextCardLock = false;
// ------------------------------------
......@@ -223,12 +223,11 @@ export class PlayComponent implements OnInit, OnDestroy {
this.initBillboard();
this.initCamera();
this.initCards();
this.m_enableAutoRunFocus = true;
this.autoRunFocus()
this.initShowCard();
this.g_cartoon.playAudio("sm-run", false ,null, true, (audio)=>{
audio.volume = 0.3
})
this.autoRollRun()
}
cleanGameVar(){
......@@ -243,9 +242,9 @@ export class PlayComponent implements OnInit, OnDestroy {
this.m_requestAfterCard = false;
this.m_requestID = null;
this.m_enableRunway = false;
this.m_currentFocusCard = -1;
this.m_enableAutoRunFocus = false;
this.m_currentFocusCard = 0;
this.m_autoFocusID = null
this.m_nextCardLock = false;
}
endGame(){
......@@ -303,6 +302,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.subscribeMapDownEvent(element.id, ()=>{
if(this.m_enableCamera){
this.m_enableCamera = false;
this.m_enableRunway = false;
this.g_cartoon.stopAudio("sm-run")
clearTimeout(this.m_autoFocusID)
this.g_cartoon.playAudio("sm-camera")
......@@ -318,12 +318,13 @@ export class PlayComponent implements OnInit, OnDestroy {
// 选择卡片
initCards(){
let repeatNum = Math.floor(this.g_canvasWidth / (249*this.g_mapScale)) + 2
let boundingBox = this.g_cartoon.getCartoonElement('Camera-Roll').ref.getBoundingBox()
let cardWidth = 265*this.g_mapScale
let cardNumber = Math.ceil(this.g_canvasWidth/cardWidth);
let cardDetailArray = this.g_formData.dataArray
for(let index=0; index<cardDetailArray.length; index++){
let newCard = this.createCard(index,index*cardWidth,boundingBox.y,cardDetailArray[index]);
for(let index=0; index<(cardDetailArray.length) * repeatNum; index++){
let newCard = this.createCard(index,index*cardWidth,boundingBox.y,cardDetailArray[index%cardDetailArray.length]);
if(index>=cardNumber){
newCard.ref.x = -999
newCard.waiting = true;
......@@ -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)
cardContentHighlight.ref.alpha = 0;
if(index==0){
cardContentHighlight.ref.alpha = 1;
cardContentHighlight.ref.visible = true;
}else{
cardContentHighlight.ref.alpha = 0;
cardContentHighlight.ref.visible = false;
}
element.ref.addChild(cardContentHighlight.ref)
element.moveLeft = (distance)=>{
......@@ -411,6 +418,12 @@ export class PlayComponent implements OnInit, OnDestroy {
if(element.content){
element.content.ref.x -= distance;
}
if(cardContentHighlight.ref.visible){
if(!this.m_nextCardLock && element.ref.x<=0){
this.nextFocus()
}
}
}
element.readyGoOut = (x)=>{
......@@ -436,19 +449,17 @@ export class PlayComponent implements OnInit, OnDestroy {
}
// 跑道启停控制
cardRunControl(distance, callback?){
autoRollRun(){
if(!this.m_enableRunway){
return;
}
let step = Math.floor(10*this.g_mapScale*10000)/20000;
let step = Math.floor(3*this.g_mapScale*10000)/20000;
let cardElement = null;
this.m_runIntervalId = setInterval(()=>{
distance -= step;
if(distance<=0){
clearInterval(this.m_runIntervalId);
callback && callback()
}
this.m_allCardIds.forEach((id)=>{
if(!this.m_enableRunway){
return;
}
cardElement = this.g_cartoon.getCartoonElement(id)
cardElement.moveLeft(step)
this.cardRecyclingAndPreparation(id)
......@@ -485,6 +496,7 @@ export class PlayComponent implements OnInit, OnDestroy {
}
nextFocus(callback?){
this.m_nextCardLock = true;
let all = this.m_allCardIds.length
let current = this.m_currentFocusCard
let next = -1
......@@ -494,44 +506,14 @@ export class PlayComponent implements OnInit, OnDestroy {
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){
this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).hideHighlight()
}
this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).showHighlight(()=>{
callback && callback()
})
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)
}
})
if(current != -1){
this.g_cartoon.getCartoonElement(this.m_allCardIds[current]).hideHighlight()
}
this.g_cartoon.getCartoonElement(this.m_allCardIds[next]).showHighlight(()=>{
this.m_nextCardLock = false;
callback && callback()
})
this.m_currentFocusCard = next;
}
initShowCard(){
......@@ -552,7 +534,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let closeBntton = this.g_cartoon.createCartoonElementImage(`card-show-close`, "close", 50, 50, 100, -100)
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)
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 {
}
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;
this.m_enableAutoRunFocus = false
tweenChange(element.ref, {scaleX: element.ref.initScaleX, scaleY: element.ref.initScaleY}, 0.3, ()=>{
this.g_cartoon.playAudio(element.audio_url)
callback && callback()
......@@ -635,10 +616,8 @@ export class PlayComponent implements OnInit, OnDestroy {
}
element.hide = (callback?)=>{
this.m_enableAutoRunFocus = true;
element.audio_url = null;
this.g_cartoon.stopAudio(element.audio_url)
this.autoRunFocus()
tweenChange(element.ref, {scaleX: 0, scaleY: 0}, 0.3, ()=>{
element.ref.visible = false;
let textIndex = element.ref.children.indexOf(element.textContent)
......@@ -667,6 +646,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.stopAudio(element.audio_url)
this.m_enableCamera = true;
element.hide(()=>{
this.m_enableRunway = true;
this.g_enableMapDown = true
})
})
......@@ -676,7 +656,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// 灯光
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 height = this.g_cartoon.getCartoonElement('Camera-Roll').ref.height*this.g_mapScale
let pos_y = [
......@@ -699,11 +679,11 @@ initLights(){
createLights(line, row, base_x, pos_y, 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;
return element;
}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;
}
}
......
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