Commit 8e21a80f authored by Tt's avatar Tt

feat(游戏模式): 添加双人模式选项支持

parent d8d7b044
......@@ -98,6 +98,23 @@
</div>
</div>
</div>
<!-- 游戏模式选择区 -->
<div class="border-dashed" style="margin: 20px;width: 1000px;">
<div class="word-input-title">
<span style="font-size: 20px;">游戏模式: </span>
</div>
<div style="margin-top: 10px;">
<nz-radio-group [(ngModel)]="item.doubleModal" (ngModelChange)="ngChange()">
<label nz-radio [nzValue]="false">
<span [style]="{color:!item.doubleModal ? '#169BD5':'#000'}">单人模式</span>
</label>
<label nz-radio [nzValue]="true">
<span [style]="{color:item.doubleModal ? '#169BD5':'#000'}">双人模式</span>
</label>
</nz-radio-group>
</div>
</div>
</div>
<div style="padding: 10px;background-color: #fff;display:none">
<!-- 标题区 -->
......
......@@ -20,6 +20,7 @@ export class FormComponent extends ComponentBase implements OnInit, OnChanges, O
questionType: "read",
questionTextAudio: "",
bgAudio: "",
doubleModal: false, // 游戏模式:false为单人模式,true为双人模式
questions: [],
};
......
......@@ -32,6 +32,7 @@ export interface FormData {
score: number;
/** 标题 */
title: string;
doubleModal: boolean;
/** 问题文本 */
questionText: string;
/** 问题类型 */
......@@ -72,4 +73,4 @@ export interface Position {
export interface PositionMap {
/** 键为问题数量,值为位置数组 */
[key: string]: Position[];
}
\ No newline at end of file
}
......@@ -49,6 +49,7 @@ import { FormData, Position, PositionMap } from './interfaces';
let defaultFormData: FormData = {
"score": 0,
"title": "",
"doubleModal": false,
"questionText": "", "questionType": "read", "questionTextAudio": "",
"bgAudio": "",
"questions": [
......@@ -397,7 +398,6 @@ export class PlayComponent implements OnInit, OnDestroy {
console.log('当前选中项目:', this.selectList);
}
initPageTitle() {
// 创建标题背景图片元素
const titleBgElement = this.g_cartoon.createCartoonElement('page_title_bg', 'MySprite');
......@@ -485,11 +485,6 @@ export class PlayComponent implements OnInit, OnDestroy {
// 渲染按钮
this.render(checkBtnElement.ref, zIndexMap.card + 2);
}
/**
* 更新检查按钮状态
* 根据selectList的长度更新按钮显示
*/
updateCheckBtnState() {
if (this.checkBtnElement) {
if (this.selectList.length >= 2) {
......@@ -501,7 +496,6 @@ export class PlayComponent implements OnInit, OnDestroy {
}
}
}
initListItem() {
// 获取questions数据
const questions = this.g_formData.questions || [];
......@@ -681,12 +675,18 @@ export class PlayComponent implements OnInit, OnDestroy {
}
/**
* 初始化鱼游戏
*/
initFishGame() {
}
/**
* 初始化退出按钮
* 创建退出按钮并放置在标题背景的最左侧
......@@ -715,10 +715,6 @@ export class PlayComponent implements OnInit, OnDestroy {
});
}
/**
* 订阅元素的移动事件
* 将元素ID添加到移动元素数组中,使其能够随场景移动
......@@ -915,6 +911,7 @@ export class PlayComponent implements OnInit, OnDestroy {
this.g_formData = {
score: 0,
title: '',
doubleModal: false,
questionText: '',
questionType: '',
questionTextAudio: '',
......
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