From c5cad6907274ba59d4a09b9a02f36c75f0e84605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=84=8B=E1=85=A2=E1=84=91=E1=85=B3=E1=86=AF=20=E1=84=82?= =?UTF-8?q?=E1=85=A9=E1=84=90=E1=85=B3=E1=84=87=E1=85=AE=E1=86=A8?= Date: Thu, 24 Jan 2019 11:17:02 +0900 Subject: [PATCH] Fix: add stageData --- src/game/license_simulator/itq/loading.js | 10 ++ src/game/license_simulator/itq/simulator.js | 139 ++++++++++++++++---- 2 files changed, 125 insertions(+), 24 deletions(-) diff --git a/src/game/license_simulator/itq/loading.js b/src/game/license_simulator/itq/loading.js index 1fc07b8..e19c051 100644 --- a/src/game/license_simulator/itq/loading.js +++ b/src/game/license_simulator/itq/loading.js @@ -32,6 +32,16 @@ var Loading = { // SpriteIconTimer.loadResources(); + game.load.image('windows_basic_koas', '../../../resources/image/license/itq/windows_basic_koas.png'); + game.load.image('pen', '../../../resources/image/confirm_tester_number.png'); + game.load.image('itq_itq_testsheet_small', '../../../resources/image/itq_itq_testsheet_small.png'); + // game.load.image('register_tester_number', '../../../resources/image/register_tester_number.png'); + // game.load.image('register_version', '../../../resources/image/register_version.png'); + // game.load.image('send_file', '../../../resources/image/send_file.png'); + // game.load.image('wait_paper', '../../../resources/image/wait_paper.png'); + // game.load.image('windows_basic_koas_execute', '../../../resources/image/windows_basic_koas_execute.png'); + + game.load.start(); }, diff --git a/src/game/license_simulator/itq/simulator.js b/src/game/license_simulator/itq/simulator.js index fbd035a..cce3c3a 100644 --- a/src/game/license_simulator/itq/simulator.js +++ b/src/game/license_simulator/itq/simulator.js @@ -3,7 +3,7 @@ var GAME_SCREEN_SIZE = { x: 1024, y: 768 } var Simulator = { preload: function() { - this.game.load.image('windows_basic_koas', '../../../resources/image/license/itq/windows_basic_koas.png'); + // this.game.load.image('windows_basic_koas', '../../../resources/image/license/itq/windows_basic_koas.png'); // this.game.load.image('confirm_tester_number', './image/confirm_tester_number.png'); // this.game.load.image('control_center', './image/control_center.png'); // this.game.load.image('register_tester_number', './image/register_tester_number.png'); @@ -47,18 +47,98 @@ var Simulator = { initVariables: function() { this.stageIndex = 0; - this.tips = [ - "파워포인트, 아래한글, 엑셀 프로그램을 실행해봅니다.\n다른 프로그램은 절대 실행하지 마세요. (특히 인터넷)", - "KOAS 수험자용 - 프로그램을 실행합니다.", - "수험표에 있는 수험번호를 정확히 입력합니다.", - "아래한글 또는 MS오피스\n2010 버전을 선택하세요.", - "입력한 내용이 정확한지 자세히 확인하고\n[확인] 버튼을 누르세요.", - "기다리는 동안 시험지를 받습니다.\n시험지 위에 볼펜으로\n자신의 [수험번호], [이름]을 적습니다.", - "시험이 시작되면\n아래한글 또는 파워포인트/엑셀 프로그램을\n실행합니다.", - "프로그램 실행 후 가장 먼저 파일을 저장합니다.\n라이브러리>문서>ITQ 폴더!!! '수험번호-이름'!!!", - "내 정답 파일이 목록에 잘 보이는지 확인한 후,\n[답안 전송] 버튼을 누르세요.", - "자주 저장하세요!!!\n슬라이드/페이지마다 / 시험 종료 5분전 / 시험 종료시\n답안 전송도 함께 하세요.", + this.stageData = [ + { + tip: "파워포인트, 아래한글, 엑셀 프로그램을 실행해봅니다.\n다른 프로그램은 절대 실행하지 마세요. (특히 인터넷)", + textColor: "yellow", + images: [ + { + name: "pen", + x: 100, + y: 100 + }, + { + name: "itq_testsheet_small", + x: 900, + y: 100 + }, + ], + rectangles: [ + { + x: 0, + y: 0, + width: 300, + height: 300 + }, + ] + }, + { + tip: "KOAS 수험자용 - 프로그램을 실행합니다.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "수험표에 있는 수험번호를 정확히 입력합니다.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "아래한글 또는 MS오피스\n2010 버전을 선택하세요.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "입력한 내용이 정확한지 자세히 확인하고\n[확인] 버튼을 누르세요.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "기다리는 동안 시험지를 받습니다.\n시험지 위에 볼펜으로\n자신의 [수험번호], [이름]을 적습니다.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "시험이 시작되면\n아래한글 또는 파워포인트/엑셀 프로그램을\n실행합니다.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "프로그램 실행 후 가장 먼저 파일을 저장합니다.\n라이브러리>문서>ITQ 폴더!!! '수험번호-이름'!!!", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "내 정답 파일이 목록에 잘 보이는지 확인한 후,\n[답안 전송] 버튼을 누르세요.", + images: [ + ], + rectangles: [ + ] + }, + { + tip: "자주 저장하세요!!!\n슬라이드/페이지마다 / 시험 종료 5분전 / 시험 종료시\n답안 전송도 함께 하세요.", + images: [ + ], + rectangles: [ + ] + }, ]; + console.log(this.stageData); + + this.rectangles = []; }, prev: function() { @@ -80,18 +160,12 @@ var Simulator = { printContents: function() { // this.bgImage.loadTexture(this.images[this.stageIndex]); - this.tipText.text = this.tips[this.stageIndex]; - switch(this.stageIndex) { - case 0: - case 5: - case 7: - case 9: - this.tipText.addColor("#ff0000", 0); // red - break; - default: - this.tipText.addColor("#ffffff", 0); // white - break; - } + this.removeRectangles(); + + var data = this.stageData[this.stageIndex]; + this.tipText.text = data.tip; + if(data.textColor != undefined) + this.tipText.addColor(data.textColor, 0); }, showImage: function(image, x, y) { @@ -103,4 +177,21 @@ var Simulator = { image.y = 0; }, + removeRectangles: function() { + var count = this.rectangles.length; + for(var i = 0; i < count; i++) + this.rectangles.pop().destroy(); + }, + + drawRectangle: function(x, y, width, height) { + var index = this.rectangles.length; + + graphics.lyneStyle(10, 0xff0000); + graphics.drawRect(0, 0, width, height); + var rectSprite = game.add.sprite(x, y, graphcis.generateTexture()); + graphics.destroy(); + + this.rectangles.push(rectSprite); + } + } \ No newline at end of file