Commit 8e21a80f authored by Tt's avatar Tt

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

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