Add: prepare html and basic js files

This commit is contained in:
2019-01-02 22:34:28 +09:00
parent 9238d4daa7
commit 7434a43fd0
7 changed files with 382 additions and 0 deletions
+5
View File
@@ -45,5 +45,10 @@ HeartGauge.prototype.updateHearts = function() {
}
}
HeartGauge.loadResources = function() {
game.load.image('heart_full', '../../../resources/image/ui/heart_full.png');
game.load.image('heart_empty', '../../../resources/image/ui/heart_empty.png');
}
HeartGauge.GAP = 35;
HeartGauge.HEART_SCALE = 0.6;
+96
View File
@@ -0,0 +1,96 @@
var WordFlyingSaucer = {
create: function() {
this.dbConnectManager = new DBConnectManager();
sessionStorageManager.setRecord(0);
sessionStorageManager.setIsNewAppHighestRecord(false);
var experienceAppTimer = new ExperienceAppTimer();
experienceAppTimer.setTimeOverListener(
(function() { this.timeOver(); }).bind(this)
);
game.stage.backgroundColor = '#4d4d4d';
// top ui
var screenTopUI = new ScreenTopUI();
screenTopUI.makeBackButton( (function() { this.back(); }).bind(this) );
screenTopUI.makeFullScreenButton();
this.scoreManager = new ScoreManager();
this.scoreBoard = new ScoreBoard();
this.scoreManager.addOnChangeScoreListener(
(function(score) {
sessionStorageManager.setRecord(score);
this.scoreBoard.printScore(NumberUtil.numberWithCommas(score));
}).bind(this)
);
this.scoreManager.addOnChangeHighScoreListener(
(function(highScore) {
console.log(highScore);
// sessionStorageManager.setAppHighestRecord(highScore);
sessionStorageManager.setIsNewBestRecrd(true);
// this.screenBottomUI.printLeftTextWithAppHighestRecord(sessionStorageManager.getAppHighestRecord());
}).bind(this)
);
var heartManager = new HeartManager();
var heartGauge = new HeartGauge(heartManager);
heartManager.addOnChangeGameOverListener(
(function() { this.gameOver(); }).bind(this)
);
heartGauge.start();
// bottom ui
this.screenBottomUI = new ScreenBottomUI();
// screenBottomUI.printBottomUILeftText("");
this.screenBottomUI.printCenterText(sessionStorageManager.getPlayingAppKoreanName());
this.screenBottomUI.printRightText(sessionStorageManager.getPlayerName());
// this.startGame();
},
back: function() {
sessionStorageManager.resetPlayingAppData();
location.href = '../../web/client/menu_app.html';
},
startGame: function() {
},
timeOver: function() {
var timeOverText = new TimeOverText();
sessionStorageManager.setRecord(this.scoreManager.getScore());
if(!isExperienceMaestroAccount())
this.updateResultRecord();
game.time.events.add(Phaser.Timer.SECOND * 2, this.goResult, this);
},
updateResultRecord: function() {
if(sessionStorageManager.getMaestroAccountType() < 100) { // experience account
this.dbConnectManager.updateResultRecord(
sessionStorageManager.getMaestroID(),
sessionStorageManager.getPlayerID(),
sessionStorageManager.getPlayingAppID(),
sessionStorageManager.getRecord()
);
}
},
goResult: function() {
location.href = '../../web/client/result.html';
},
}
@@ -0,0 +1,94 @@
var Loading = {
preload: function() {
// game.load.image('loadingbar', './image/phaser.png');
},
create: function() {
// var userID = sessionStorage.getItem("UserID");
// console.log("userID : " + userID);
// game.stage.backgroundColor = '#4d4d4d';
// // Progress report
// this.textProgress = game.add.text(game.world.centerX, 100, '로딩중 . . .', textStyleBasic);
// this.textProgress.anchor.setTo(0.5, 0.4);
// this.textProgress.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
// // Preload bar
// this.preloadBar = this.add.sprite(game.world.centerX, game.world.centerY, 'loadingbar');
// this.preloadBar.anchor.setTo(0.5);
// this.preloadBar.alpha = 0;
game.load.onFileComplete.add(this.fileComplete, this);
game.load.onLoadComplete.add(this.loadComplete, this);
this.startLoading();
},
startLoading: function() {
game.load.image('icon_fullscreen', '../../../resources/image/icon/fullscreen_white.png');
game.load.image('star', '../../../resources/image/ui/star_particle.png');
HeartGauge.loadResources();
// game.load.image('hand_left', '../../../resources/image/ui/hand_left.png');
// game.load.image('hand_right', '../../../resources/image/ui/hand_right.png');
// game.load.image('a', '../../../resources/image/icon/fullscreen_white.png');
// game.load.image('b', '../../../resources/image/icon/fullscreen_white.png');
// game.load.image('c', '../../../resources/image/icon/fullscreen_white.png');
// game.load.image('d', '../../../resources/image/icon/fullscreen_white.png');
// game.load.image('a', './image/phaser.png');
// game.load.image('b', './image/phaser.png');
// game.load.image('c', './image/phaser.png');
// game.load.image('d', './image/phaser.png');
// game.load.image('e', './image/phaser.png');
// game.load.image('g', './image/phaser.png');
// game.load.image('e', './image/phaser.png');
// game.load.image('f', './image/phaser.png');
// game.load.image('g', './image/phaser.png');
// game.load.image('h', './image/phaser.png');
// game.load.image('phaser', './image/phaser.png');
// game.load.spritesheet('button', './image/button_basic.png', 200, 100);
// game.load.image('star', './image/star_particle.png');
// game.load.image('medal_gold', './image/medal_gold.png');
// game.load.image('medal_silver', './image/medal_silver.png');
// game.load.image('medal_bronze', './image/medal_bronze.png');
game.load.start();
},
fileComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
// this.preloadBar.alpha = progress / 100;
// console.log('progress : ' + progress);
// text.setText("File Complete: " + progress + "% - " + totalLoaded + " out of " + totalFiles);
// var newImage = game.add.image(x, y, cacheKey);
// newImage.scale.set(0.3);
// x += newImage.width + 20;
// if (x > 700)
// {
// x = 32;
// y += 332;
// }
},
loadComplete: function(progress, cacheKey, success, totalLoaded, totalFiles) {
// this.preloadBar.alpha = 1;
if(isDebugMode()) {
this.state.start('WordFlyingSaucer');
return;
}
this.state.start('WordFlyingSaucer');
// this.startMenu();
// this.startTypingTestStage();
// this.startTypingTestResult();
}
}
+16
View File
@@ -0,0 +1,16 @@
/////////////////////////////
// Main game
var CONTENT_ID = "WordFlyingSaucer";
var game = new Phaser.Game(
GAME_SCREEN_SIZE.x, GAME_SCREEN_SIZE.y,
Phaser.CANVAS, CONTENT_ID,
this, false, false
);
game.state.add('Loading', Loading);
game.state.start('Loading');
game.state.add('WordFlyingSaucer', WordFlyingSaucer);
// game.state.add('Menu', Menu);
@@ -0,0 +1,54 @@
function TypingScore() {
this.typingCount = 0;
var fontStyle = TypingScore.DEFAULT_TEXT_FONT;
fontStyle.align = "right";
fontStyle.boundsAlignH = "right";
this.scoreTitleText = game.add.text(game.world.width / 2 - 40, TypingScore.SCORE_POS_Y, "연속 성공 타수 : ", fontStyle)
this.scoreTitleText.anchor.set(0.5);
fontStyle.align = "left";
fontStyle.boundsAlignH = "left";
this.scoreText = game.add.text(game.world.width / 2 + 100, TypingScore.SCORE_POS_Y, "0", fontStyle)
this.scoreText.anchor.set(0.5);
// var grd = this.scoreText.context.createLinearGradient(0, 0, 0, TypingScore.SCORE_POS_Y);
// grd.addColorStop(0, '#8ED6FF');
// grd.addColorStop(1, '#004CB3');
// this.scoreText.fill = grd;
// this.scoreText.fill = grd;
// this.setShadow(3, 3, 'rgba(0, 0, 0, 0.5)', 2);
// this.scoreText.stroke = '#000';
// this.scoreText.strokeThickness = 3;
};
TypingScore.prototype.score = function() {
return this.typingCount;
}
TypingScore.prototype.increase = function() {
this.typingCount++;
this.print(this.typingCount);
}
TypingScore.prototype.reset = function() {
this.typingCount = 0;
this.print(this.typingCount);
}
TypingScore.prototype.print = function(typingCount) {
this.scoreText.text = typingCount;
}
TypingScore.SCORE_POS_Y = 35;
TypingScore.DEFAULT_TEXT_FONT = {
font: "38px Arial",
align: "center",
boundsAlignH: "center", // left, center. right
boundsAlignV: "middle", // top, middle, bottom
fill: "#fff"
};
+115
View File
@@ -0,0 +1,115 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta charset="UTF-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-85912788-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-85912788-2');
</script>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N8PB4F3');</script>
<!-- End Google Tag Manager -->
<title>격추! 비행접시 | 초코마에</title>
<meta name="description" CONTENT="격추! 비행접시 - 한글/영어 타자 앱 | 초코마에 ‧ Shoot down! flyingsaucer - Korean/English typing app | ChocoMae">
<link rel="icon" href="/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
<link href="../../../resources/font/open-iconic-master/font/css/open-iconic-bootstrap.css" rel="stylesheet">
<link href="../../../resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/phaser/2.6.2/phaser.js"></script> -->
<script src="../../../resources/js/phaser.min.js"></script>
<!-- global source files -->
<script src="../../game/lib/session_storage_manager.js"></script>
<script src="../../game/lib/score_manager.js"></script>
<script src="../../game/lib/heart_manager.js"></script>
<script src="../../game/lib/global/global_variables.js?update_date=191224"></script>
<!-- library source files -->
<!-- <script src="../../game/lib/keyboard_shortcut.js"></script> -->
<script src="../../game/lib/util/string_util.js"></script>
<script src="../../game/lib/util/number_util.js"></script>
<script src="../../game/lib/util/record_util.js"></script>
<script src="../../game/lib/text/input_type_text.js?update_date=191224"></script>
<script src="../../game/lib/text/game_over_text.js?update_date=191224"></script>
<script src="../../game/lib/text/time_over_text.js?update_date=191224"></script>
<script src="../../game/lib/text/score_board.js?update_date=191224"></script>
<script src="../../game/lib/text/score_text.js?update_date=191224"></script>
<script src="../../game/lib/text/screen_top_ui.js?update_date=191224"></script>
<script src="../../game/lib/text/screen_bottom_ui.js?update_date=191224"></script>
<script src="../../game/lib/history_record_manager.js"></script>
<script src="../../game/lib/heart_gauge.js"></script>
<script src="../../game/lib/button/round_rect_button.js"></script>
<script src="../../game/lib/button/back_button.js"></script>
<script src="../../game/lib/button/fullscreen_button.js"></script>
<script src="../../game/lib/db_connect_manager.js"></script>
<script src="../../game/lib/score_manager.js"></script>
<script src="../../game/lib/experience_app_timer.js"></script>
<script src="../../game/lib/stage_timer.js"></script>
<!-- Test typing : source files -->
<script src="../../game/typing/word_list/korean_basic.js"></script>
<script src="../../game/typing/word_list/korean_left_upper.js"></script>
<script src="../../game/typing/word_list/korean_second_finger.js"></script>
<script src="../../game/typing/word_list/korean_right_upper.js"></script>
<script src="../../game/typing/word_list/korean_left_lower.js"></script>
<script src="../../game/typing/word_list/korean_right_lower.js"></script>
<script src="../../game/typing/word_list/korean_left_upper_double.js"></script>
<script src="../../game/typing/word_list/korean_right_upper_double.js"></script>
<script src="../../game/typing/word_list/korean_word.js"></script>
<script src="../../game/typing/word_list/english_basic.js"></script>
<script src="../../game/typing/word_list/english_left_lower.js"></script>
<script src="../../game/typing/word_list/english_left_upper.js"></script>
<script src="../../game/typing/word_list/english_right_lower.js"></script>
<script src="../../game/typing/word_list/english_right_upper.js"></script>
<script src="../../game/typing/word_list/english_second_finger.js"></script>
<script src="../../game/typing/word_list/english_word.js"></script>
<!-- Shoot down! flyingsaucer : source files -->
<script src="../../game/typing/lib/typing_text_manager.js"></script>
<script src="../../game/typing/lib/typing_content_bg.js"></script>
<script src="../../game/typing/word_flyingsaucer/loading.js"></script>
<script src="../../game/typing/word_flyingsaucer/game.js?update_date=191225"></script>
<script src="../../game/typing/word_flyingsaucer/main.js"></script>
<style>
body{
padding: 0;
margin: 0;
}
canvas{
margin: 0 auto;
}
</style>
</head>
<body>
<div id="WordFlyingSaucer" style="text-align:center;"></div>
<div style="margin-top: 20px; text-align:center;">
앱이 실행되지 않으면, 브라우저의 새로 고침 버튼( <span class="oi oi-reload" title="icon reload" aria-hidden="true"></span> , 단축키 : Ctrl + R)을 눌러주세요.<br/>
(그래도 실행되지 않을때에는, Ctrl + Shift + R 을 눌러서 브라우저 캐시 삭제를 실행해 주세요)
</div>
</body>
</html>
+2
View File
@@ -40,6 +40,8 @@ INSERT INTO `app` (`AppID`, `AppName`, `KoreanName`, `AppType`, `Status`, `HowTo
(40, 'test_english_sentence', 'Sentence test', 12, 1, '문장을 빠르게 입력하세요.'),
(50, 'typing_korean_whac_a_mole', '두더지 타자', 50, 0, '두더지가 나온 키의 글자를\\n정확하고 빠르게 눌러서 잡으세요.\\n(한글)'),
(51, 'typing_english_whac_a_mole', 'Whac A Mole', 50, 0, '두더지가 나온 키의 글자를\\n정확하고 빠르게 눌러서 잡으세요.\\n(영문)'),
(52, 'typing_korean_word_flyingsaurce', '단어 비행접시', 50, 0, '비행접시에 있는 글자를 빨리 입력해서,\\n외계인의 침공을 막으세요.\\n(한글)'),
(53, 'typing_english_word_flyingsaurce', 'Word flyingsaucer', 50, 0, '비행접시에 있는 글자를 빨리 입력해서,\\n외계인의 침공을 막으세요.\\n(영문)'),
(101, 'space_invaders', '외계인 침공', 100, 1, '외계인이 나타났다!\\n마우스 왼쪽 버튼을 클릭해서\\n외계인이 사라지기 전에 물리쳐 주세요.'),
(102, 'card_matching', '카드 짝 맞추기', 100, 0, '같은 그림의 카드를 맞춰주세요.');
(103, 'grilled_meat', '고기 굽기', 100, 0, '고기를 드래그해서 불판에 울리고,\\n잘 익으면 클릭해서 뒤집어주세요.\\n맛있게 구워지면 할아버지한테 먹여주세요.');