Commit 016ed50a authored by 李维's avatar 李维

UAT feedback

parent 260bdaa3
...@@ -134,6 +134,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -134,6 +134,7 @@ export class PlayComponent implements OnInit, OnDestroy {
// ------------ 游戏逻辑数据 ------------ // ------------ 游戏逻辑数据 ------------
m_allCardIds = [] m_allCardIds = []
m_allCardContentIds = []
m_runIntervalId = null m_runIntervalId = null
m_runStatus = false; m_runStatus = false;
m_mouseInRunway = false; m_mouseInRunway = false;
...@@ -237,6 +238,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -237,6 +238,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_cartoon.stopAllAudio() this.g_cartoon.stopAllAudio()
this.m_allCardIds = [] this.m_allCardIds = []
this.m_allCardContentIds = []
this.cardRunControl(false) this.cardRunControl(false)
clearInterval(this.m_runIntervalId) clearInterval(this.m_runIntervalId)
this.m_runIntervalId = null this.m_runIntervalId = null
...@@ -421,6 +423,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -421,6 +423,7 @@ export class PlayComponent implements OnInit, OnDestroy {
createCard(index,x,y,data){ createCard(index,x,y,data){
this.m_allCardIds.push(`card-bckground-${index}`) this.m_allCardIds.push(`card-bckground-${index}`)
this.m_allCardContentIds.push(`card-content-${index}`)
let element = this.g_cartoon.createCartoonElementImageFunc(`card-bckground-${index}`, "bg_card", (w,h)=>{ let element = this.g_cartoon.createCartoonElementImageFunc(`card-bckground-${index}`, "bg_card", (w,h)=>{
return { return {
sx: 230*this.g_mapScale/w, sx: 230*this.g_mapScale/w,
...@@ -457,18 +460,39 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -457,18 +460,39 @@ export class PlayComponent implements OnInit, OnDestroy {
cardContent.handleClick = ()=>{ cardContent.handleClick = ()=>{
this.g_cartoon.playAudio("sm-click") this.g_cartoon.playAudio("sm-click")
cardContent.canMove = true; cardContent.canMove = true;
if(cardContent.parentID){ if(cardContent.parentID && cardContent.parentID.indexOf("pos_")==-1){
this.g_cartoon.getCartoonElement(cardContent.parentID).content = null this.g_cartoon.getCartoonElement(cardContent.parentID).content = null
} }
this.enableMoveAsstant(cardContent) this.enableMoveAsstant(cardContent)
this.m_pickupCard = true; this.m_pickupCard = true;
this.m_currentPickupCardID = `card-content-${index}` this.m_currentPickupCardID = `card-content-${index}`
this.g_cartoon.getCartoonElement(`selected-card-hotzone`).show() // this.g_cartoon.getCartoonElement(`selected-card-hotzone`).show()
this.topOfRenderArray(cardContent.ref) this.topOfRenderArray(cardContent.ref)
element.baseClick_x = this.g_clickX element.baseClick_x = this.g_clickX
element.baseClick_y = this.g_clickY element.baseClick_y = this.g_clickY
hilightBackground.ref.visible = true; hilightBackground.ref.visible = true;
} }
cardContent.handleMouseUp = (isSaveCurrentPickupCardID?)=>{
cardContent.clickTime = null
let savedPickupCardID = this.m_currentPickupCardID;
if(cardContent.canMove){
setTimeout(()=>{
cardContent.canMove = false;
cardContent.backToParent()
if(isSaveCurrentPickupCardID){
this.m_currentPickupCardID = savedPickupCardID
this.m_pickupCard = false;
}
// this.g_cartoon.getCartoonElement(`selected-card-hotzone`).hide()
},100)
}
if(!isSaveCurrentPickupCardID){
this.disableMoveAsstant()
this.g_enableMapUp = true;
}
}
this.subscribeMapDownEvent(`card-content-${index}`, ()=>{ this.subscribeMapDownEvent(`card-content-${index}`, ()=>{
if(this.m_endGame){ if(this.m_endGame){
if(cardContent.parentID.indexOf("hot") != -1){ if(cardContent.parentID.indexOf("hot") != -1){
...@@ -495,45 +519,33 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -495,45 +519,33 @@ export class PlayComponent implements OnInit, OnDestroy {
} }
} }
if( cardContent.canMove ){ if( cardContent.canMove ){
if(cardContent.parentID.indexOf("pos_") == -1 || this.m_renderArr.indexOf(cardContent.ref) == this.m_renderArr.length-1){
cardContent.ref.x = this.g_clickX cardContent.ref.x = this.g_clickX
cardContent.ref.y = this.g_clickY cardContent.ref.y = this.g_clickY
}else if(cardContent.parentID.indexOf("pos_") != -1){
cardContent.handleMouseUp(true)
}
} }
this.g_enableMapMove = true; this.g_enableMapMove = true;
}) })
this.subscribeMapUpEvent(`card-content-${index}`, ()=>{ this.subscribeMapUpEvent(`card-content-${index}`, ()=>{
cardContent.clickTime = null cardContent.handleMouseUp()
if(cardContent.canMove){
setTimeout(()=>{
cardContent.canMove = false;
cardContent.backToParent()
this.g_cartoon.getCartoonElement(`selected-card-hotzone`).hide()
this.m_pickupCard = false;
},100)
}else{
if(cardContent.parentID && this.m_currentPickupCardID){
let pickupCard = this.g_cartoon.getCartoonElement(this.m_currentPickupCardID)
if( cardContent.parentID.indexOf("card-bckground") != -1 && pickupCard.parentID.indexOf("card-bckground") != -1 ){
}else{
let temp = pickupCard.parentID
pickupCard.parentID = cardContent.parentID
cardContent.parentID =temp
cardContent.backToParent()
}
}
}
this.disableMoveAsstant()
this.g_enableMapUp = true;
}) })
element.content = cardContent element.content = cardContent
cardContent.backToParent = ()=>{ cardContent.backToParent = ()=>{
cardContent.canMove = false; cardContent.canMove = false;
this.m_pickupCard = false; this.m_pickupCard = false;
if(cardContent.parentID){ if(cardContent.parentID){
if(cardContent.parentID.indexOf("pos_") == -1){
this.g_cartoon.getCartoonElement(cardContent.parentID).setContent(cardContent) this.g_cartoon.getCartoonElement(cardContent.parentID).setContent(cardContent)
}else{
tweenChange(cardContent.ref, {x:cardContent.parentID.split("_")[1], y:cardContent.parentID.split("_")[2]}, 0.1)
} }
}
hilightBackground.ref.visible = false; hilightBackground.ref.visible = false;
this.m_currentPickupCardID = null; this.m_currentPickupCardID = null;
} }
...@@ -560,7 +572,6 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -560,7 +572,6 @@ export class PlayComponent implements OnInit, OnDestroy {
cardContent.ref.addChild(imageContent) cardContent.ref.addChild(imageContent)
} }
element.moveLeft = (distance)=>{ element.moveLeft = (distance)=>{
element.ref.x -= distance element.ref.x -= distance
if(element.content){ if(element.content){
...@@ -589,7 +600,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -589,7 +600,7 @@ export class PlayComponent implements OnInit, OnDestroy {
if(!element.content){ if(!element.content){
if(this.m_currentPickupCardID){ if(this.m_currentPickupCardID){
let card = this.g_cartoon.getCartoonElement(this.m_currentPickupCardID) let card = this.g_cartoon.getCartoonElement(this.m_currentPickupCardID)
if(card.parentID){ if(card.parentID && card.parentID.indexOf("pos_").index==-1){
this.g_cartoon.getCartoonElement(card.parentID).content = null; this.g_cartoon.getCartoonElement(card.parentID).content = null;
} }
element.setContent(this.g_cartoon.getCartoonElement(this.m_currentPickupCardID)) element.setContent(this.g_cartoon.getCartoonElement(this.m_currentPickupCardID))
...@@ -753,35 +764,51 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -753,35 +764,51 @@ export class PlayComponent implements OnInit, OnDestroy {
case "C": baseLine = 165*this.g_mapScale; break; case "C": baseLine = 165*this.g_mapScale; break;
default: baseLine = 165*this.g_mapScale; default: baseLine = 165*this.g_mapScale;
} }
let element = this.g_cartoon.createCartoonElementImageFunc(`selected-card-hotzone`, "bg_1280_180", (w,h)=>{ let element = this.g_cartoon.createCartoonElementImageFunc(`selected-card-hotzone`, "bg_1280_250", (w,h)=>{
return { return {
sx: 1,//this.g_canvasWidth/w, sx: this.g_canvasWidth/w,
sy: 1//(180*this.g_mapScale)/h sy: (280*this.g_mapScale)/h
} }
}, (w,h)=>{ }, (w,h)=>{
return { return {
x: this.g_canvasWidth/2, x: this.g_canvasWidth/2,
y: this.g_canvasHeight/2 + baseLine y: this.g_cartoon.getOrigin().y + 555*this.g_mapScale
} }
}) })
element.ref.alpha = 0; element.ref.alpha = 0;
let base_X = -1*(200*this.g_mapScale*totalLightCount)/2
for(let index=0; index<totalLightCount; index++){
let a = index%2==1?-1:1
element.ref.addChild(this.createSelectedCardArea(index,base_X + 190*this.g_mapScale*index,0))
}
element.show = ()=>{
this.m_allSelectedHotZone.forEach((id)=>{ this.subscribeMapUpEvent(`selected-card-hotzone`, ()=>{
tweenChange(this.g_cartoon.getCartoonElement(id).ref, {alpha:0.7}, 0.2)
}) if(this.m_currentPickupCardID){
let card = this.g_cartoon.getCartoonElement(this.m_currentPickupCardID)
if(card.parentID && card.parentID.indexOf("pos_")==-1){
this.g_cartoon.getCartoonElement(card.parentID).content = null;
} }
element.hide = ()=>{ card.parentID = "pos_" + this.g_clickX + "_" + this.g_clickY
this.m_allSelectedHotZone.forEach((id)=>{ this.g_cartoon.getCartoonElement("start-button").showHideCheck()
tweenChange(this.g_cartoon.getCartoonElement(id).ref, {alpha:0}, 0.2)
})
} }
this.g_enableMapUp = true;
})
// let base_X = -1*(200*this.g_mapScale*totalLightCount)/2
// for(let index=0; index<totalLightCount; index++){
// let a = index%2==1?-1:1
// element.ref.addChild(this.createSelectedCardArea(index,base_X + 190*this.g_mapScale*index,0))
// }
// element.show = ()=>{
// this.m_allSelectedHotZone.forEach((id)=>{
// tweenChange(this.g_cartoon.getCartoonElement(id).ref, {alpha:0.7}, 0.2)
// })
// }
// element.hide = ()=>{
// this.m_allSelectedHotZone.forEach((id)=>{
// tweenChange(this.g_cartoon.getCartoonElement(id).ref, {alpha:0}, 0.2)
// })
// }
this.render(element.ref) this.render(element.ref)
} }
...@@ -844,10 +871,17 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -844,10 +871,17 @@ export class PlayComponent implements OnInit, OnDestroy {
element.getAllCards = ()=>{ element.getAllCards = ()=>{
let allSelectedCards = [] let allSelectedCards = []
this.m_allSelectedHotZone.forEach(id=>{ // this.m_allSelectedHotZone.forEach(id=>{
let content_id = this.g_cartoon.getCartoonElement(id).content?this.g_cartoon.getCartoonElement(id).content.id:null // let content_id = this.g_cartoon.getCartoonElement(id).content?this.g_cartoon.getCartoonElement(id).content.id:null
if(content_id){ // if(content_id){
allSelectedCards.push(content_id) // allSelectedCards.push(content_id)
// }
// })
this.m_allCardContentIds.forEach(id=>{
let parentID = this.g_cartoon.getCartoonElement(id).parentID?this.g_cartoon.getCartoonElement(id).parentID:null
if(parentID && parentID.indexOf("pos_")!=-1){
allSelectedCards.push(parentID)
} }
}) })
return allSelectedCards return allSelectedCards
...@@ -859,15 +893,15 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -859,15 +893,15 @@ export class PlayComponent implements OnInit, OnDestroy {
this.endGame() this.endGame()
}) })
}) })
let allIDs = element.getAllCards() // let allIDs = element.getAllCards()
let cardWidth = 180*this.g_mapScale // let cardWidth = 180*this.g_mapScale
let allWidth = allIDs.length * cardWidth // let allWidth = allIDs.length * cardWidth
let base_x = (this.g_canvasWidth - allWidth + cardWidth)/2 // let base_x = (this.g_canvasWidth - allWidth + cardWidth)/2
if(allIDs.length>0){ // if(allIDs.length>0){
allIDs.forEach((id,index) => { // allIDs.forEach((id,index) => {
tweenChange( this.g_cartoon.getCartoonElement(id).ref, {x:base_x+index*cardWidth}, 0.2) // tweenChange( this.g_cartoon.getCartoonElement(id).ref, {x:base_x+index*cardWidth}, 0.2)
}); // });
} // }
element.ref.scaleX = 0; element.ref.scaleX = 0;
element.ref.scaleY = 0; element.ref.scaleY = 0;
element.ref.x = 100000; element.ref.x = 100000;
......
...@@ -39,10 +39,10 @@ const localImages = { ...@@ -39,10 +39,10 @@ const localImages = {
'light-2': 'assets/play/light-2.png', 'light-2': 'assets/play/light-2.png',
'bg_title': 'assets/play/bg_title.png', 'bg_title': 'assets/play/bg_title.png',
'bg_card': 'assets/play/bg_card.png', 'bg_card': 'assets/play/bg_card.png',
'bg_card_runway': 'assets/play/bg_card_runway.png', 'bg_card_runway': 'assets/play/bg_card_runway_1.png',
'text_container': 'assets/play/text_container-1.png', 'text_container': 'assets/play/text_container-1.png',
'bg_selected_card': 'assets/play/bg_selected_card.png', 'bg_selected_card': 'assets/play/bg_selected_card.png',
'bg_1280_180': 'assets/play/bg_1280_180_1.png', 'bg_1280_250': 'assets/play/bg_1280_250_1.png',
'bee-demo': 'assets/play/bee-demo.jpg', 'bee-demo': 'assets/play/bee-demo.jpg',
'tablecloth': 'assets/play/tablecloth.png' 'tablecloth': 'assets/play/tablecloth.png'
}; };
......
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