※このページは書きかけです。


初級編応用

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN">
<html>
<head>
<title>TheaterJS</title>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="imagetoolbar" content="no"/>
<link rel="stylesheet" href="style.css" type="text/css"/>
<script src="staff/theaterconstructor.js" type="text/javascript" charset="Shift_JIS"></script>
<script type="text/javascript">
<!--
 new Theater({
   img: [
     "img/sample1.gif",
     "img/sample2.gif",
     "img/sample3.gif"
   ],
   scenario:[
     function(){
       this.act({
         img: "img/sample1.gif",
         msg: "クイズゲーム!"
       });
     },
     function(){
       this.act({
         img: "img/sample2.gif",
         msg: "まず、お名前を入力してください。"
       });
     },
     function(){
       this.prompt("お名前を入力してください。", "名無し");
     },
     function(result){
       this.work.name = result;
       this.speak("ようこそ" + this.work.name + "さん");
     },
     function(){
       this.work.count = 0;
       this.act({
         img: "img/sample3.gif",
         msg: "第一問:「檄を飛ばす」とは、「叱咤激励する」という意味である?"
       });
     },
     function(){
       this.confirm("どっち?");
     },
     function(result){
       if(result == true){
         this.push(scenarioWrong);
       }else{
         this.push(scenarioRight);
       }
       this.keep();
     },
     function(result){
       this.speak("本来は「自分の考えを広く知らしめる」という意味。");
     },
     function(){
       this.act({
         img: "img/sample3.gif",
         msg: "第二問:能力と比べて、その人の役割・地位が過大に重要であるとき"
            + "「役」がつく言葉でなんと言う?"
       });
     },
     function(){
       this.prompt("役???", "役");
     },
     function(result){
       if(result == "役者が足りない" || result == "役者がたりない"){
         this.push(scenarioRight);
       }else{
         this.push(scenarioWrong);
       }
       this.keep();
     },
     function(result){
       this.speak("「役者が足りない」が正解。「役不足」は逆の意味。");
     },
     function(){
       this.act({
         img: "img/sample3.gif",
         msg: "第三問:次の「すべからく」を使用した表現で、正しいものは?"
       });
     },
     function(){
       this.choice(["その本をすべからく読んだ",
                    "その本の一部でもすべからく読むべし",
                    "その本の一部をすべからく読んだ"]);
     },
     function(result){
       if(result == "その本の一部でもすべからく読むべし"){
         this.push(scenarioRight);
       }else{
         this.push(scenarioWrong);
       }
       this.keep();
     },
     function(result){
       this.speak("「すべからく」は「ぜひとも」の意味で「すべからく・・・べし」という形で用いる。"
                + "「すべて」という意味ではない。");
     },
     function(){
       this.act({
         img: "img/sample3.gif",
         msg: "クイズ終了!"
       });
     },
     function(){
       this.speak(this.work.name + "さんの結果:" + this.work.count + "問正解");
     },
     function(){
       if(this.work.count == 3){
         this.act({
           img: "img/sample3.gif",
           msg: "全問正解!! おめでとうございます^^"
         });
       }else{
         this.keep();
       }
     },
     function(){
       this.act({
         img: "img/sample3.gif",
         msg: "お疲れ様でした^^"
       });
     }
   ]
 });
 
 var scenarioRight = [
   function(){
     this.work.count++;
     this.act({
       img: "img/sample3.gif",
       msg: "正解!"
     });
   },
   function(){
     this.speak("^^");
   }
 ];
 
 var scenarioWrong = [
   function(){
     this.act({
       img: "img/sample3.gif",
       msg: "残念!"
     });
   },
   function(){
     this.speak("><;");
   }
 ];
//-->
</script>
</head>
<body>
<div id="play">
<div id="frame"></div>
<div id="msg">クリックしてスタートしてください。</div>
<button id='reset'>はじめから</button>
</div>
</body>
</html>

※このページは書きかけです。


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS