Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <canvas id="cvs" width="400" height="400"></canvas>
              
            
!

CSS

              
                body { background-color: #FFFFFF; }
              
            
!

JS

              
                // forked from siouxcitizen's "ゲームっぽい画面表示、にできず。。。" 
//前回コードから勇者の上下左右画像の表示機能を追加しました
//
//引き続きWonderflの以下のコードのような実装を目指してみました。勇者画像が上下左右向くようになっただけですが。。。
//ワンダフルクエスト
//http://wonderfl.net/c/wu8f
//↑画像データは上記コードからのものを使用させてもらってまいす
//
//以下コードをbase64画像への変換に使用させていただきました
//2009-3-14 選んだファイルを Base64 エンコードする
//http://wonderfl.net/c/h1NU
//
var canvas;
var ctx;

var sunaImg; //砂
var shibafuImg; //芝生
var mizuImg; //水
var sabotenImg; //サボテン
var makkuraImg; //真っ暗

//勇者用
var yuusha;
var yuushaFrontImgOne; //勇者前向き1
var yuushaFrontImgTwo; //勇者前向き2
var yuushaBackImgOne;  //勇者後ろ向き1
var yuushaBackImgTwo;  //勇者後ろ向き2
var yuushaLeftImgOne;  //勇者左向き1
var yuushaLeftImgTwo;  //勇者左向き2
var yuushaRightImgOne; //勇者右向き1
var yuushaRightImgTwo; //勇者右向き2
var MAPSIZE = 16; //マップの横・縦のマスの個数
var FLDSIZE = 16; //フィールド(マップ上の1マス)の横・縦のドット数
var yuushaXPos = MAPSIZE/2;
var yuushaYPos = MAPSIZE/2;

//0:砂漠 1:芝生 2:水 3:サボテン
var mapData = 
            [[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
             [ 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2],
             [ 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2],
             [ 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
             [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
var bMapData = []; //フィールドが障害物か否かを記憶

window.onload = function () {
  setImageData();
  init();
}

function init() {
  canvas = document.getElementById("cvs");
  if (!canvas) return false;
  canvas.width = 400;
  canvas.height = 400;
  ctx= canvas.getContext("2d");
  if(!ctx) return false;

  createMap();

  yuusha = new Yuusha(canvas, FLDSIZE*yuushaXPos, FLDSIZE*yuushaYPos);

  //キープレスイベントを処理
  document.addEventListener('keydown', handleKeyDown, false);

  setInterval(loop, 10);
}

function handleKeyDown(event) {
  //walkDirection = 0;    //歩いていく方向 (0~3:下上左右  4:止)
  if (event.keyCode==38) {//↑ボタン押下
    if (yuushaYPos > 0) {
      yuushaYPos--;
      yuusha.walkDirection = 1;
    }
  } else if (event.keyCode==40) {//↓ボタン押下
    if (yuushaYPos < 15) {
      yuushaYPos++;
      yuusha.walkDirection = 0;
    }
  } else if (event.keyCode==39) {//→ボタン押下
    if (yuushaXPos < 15) {
      yuushaXPos++;
      yuusha.walkDirection = 3;
    }
  } else if (event.keyCode==37) {//←ボタン押下
    if (yuushaXPos > 0) {
      yuushaXPos--;
      yuusha.walkDirection = 2;
    }
  }
}

function loop() {
  //保持したマップを再描画
  ctx.putImageData(mapImg, 0, 0);
  //勇者画像表示
  yuusha.walk(FLDSIZE*yuushaXPos, FLDSIZE*yuushaYPos);
}

function createMap() {
  for (k = 0; k < MAPSIZE; k++) bMapData[k] = []; //bMapDataを2次元配列にする

  for (j = 0; j < MAPSIZE; j++){
    for (i = 0; i < MAPSIZE; i++){
      var imgPosX = FLDSIZE * i;
      var imgPosY = FLDSIZE * j;
      var isObstacle;
      if ([mapData[j][i]] == 0) {
        ctx.drawImage(sunaImg, imgPosX, imgPosY);
        bMapData[j][i] = false;
      } else if ([mapData[j][i]] == 1) {
        ctx.drawImage(shibafuImg, imgPosX, imgPosY);
        bMapData[j][i] = false;
      } else if ([mapData[j][i]] == 2) {
        ctx.drawImage(mizuImg, imgPosX, imgPosY);
        bMapData[j][i] = true;
      } else if ([mapData[j][i]] == 3) {
        ctx.drawImage(sabotenImg, imgPosX, imgPosY);
        bMapData[j][i] = true;
      } else if ([mapData[j][i]] == 4) {
        ctx.drawImage(makkuraImg, imgPosX, imgPosY);
        bMapData[j][i] = true;
      }
      //マップをまとめて保持
      mapImg = ctx.getImageData(0, 0, MAPSIZE*FLDSIZE, MAPSIZE*FLDSIZE);
    }
  }

}

//勇者クラス
var Yuusha = function(canvas,x,y) {
  this.x = x;
  this.y = y;
  this.frameCount = 0;
  this.walkFlg = true; //足踏み用
  this.walkDirection = 0; //歩いていく方向 (0~3:下上左右)
  this.canvas = canvas;
  this.ctx = canvas.getContext('2d');
}
Yuusha.prototype.walk = function(x, y) {
  this.ctx.save();
  this.ctx.beginPath();

  if (this.frameCount++ > 15) { //
    this.frameCount = 0;
    this.walkFlg = !this.walkFlg;
  } 
  if(this.walkFlg) { //足踏み表現
    if(this.walkDirection == 0) { //勇者画像1による足踏み
      this.ctx.drawImage(yuushaFrontImgOne,x,y);
    } else if (this.walkDirection == 1) {
      this.ctx.drawImage(yuushaBackImgOne,x,y);
    } else if (this.walkDirection == 2) {
      this.ctx.drawImage(yuushaLeftImgOne,x,y);
    } else if (this.walkDirection == 3) {
      this.ctx.drawImage(yuushaRightImgOne,x,y);
    } 
  } else {
    if(this.walkDirection == 0) { //勇者画像2による足踏み
      this.ctx.drawImage(yuushaFrontImgTwo,x,y);
    } else if (this.walkDirection == 1) {
      this.ctx.drawImage(yuushaBackImgTwo,x,y);
    } else if (this.walkDirection == 2) {
      this.ctx.drawImage(yuushaLeftImgTwo,x,y);
    } else if (this.walkDirection == 3) {
      this.ctx.drawImage(yuushaRightImgTwo,x,y);
    } 
  }

  this.ctx.restore();
}

function setImageData() {
  //砂
  sunaImg = new Image();
  sunaImg.src =  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAAANklEQVQokWP4v8MDE+2sYsAqDkQ4JaigAWItA34H0NdJg0ED1sAYYn4goIHI+CZKEbJZJDsJAExt+khTZWqXAAAAAElFTkSuQmCC";
  //芝生
  shibafuImg = new Image();
  shibafuImg.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAAANElEQVQokWOYdIcBExlOwyIIQTglqKABYi0BB9DXSYNBA9bAGGJ+IKCByPgmShGyWSQ7CQCHEmomoGsXjwAAAABJRU5ErkJggg==";
  //水
  mizuImg = new Image();
  mizuImg.src =  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAAAcUlEQVQokZWSwQ2AMAwDvS/bsAlLMAUvFimRLIXQummQ/GivUWpHwXY27JfpuJvJDkYoyeGUd765BI8NvI4VkmNszOuMI7ErOTK7kid2JUdiV3JUZh85SrMPHEvTPa/M/sOLK/T+WV2hGPpXjD70MsYDrQTzsOkaBq4AAAAASUVORK5CYII=";
  //サボテン
  sabotenImg = new Image();
  sabotenImg.src =  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAFxJREFUGJVtj8ENwDAIA2+C7r8R725UbCAiUvNIiM8gw1MHpugngiWQ/3hZDilHUHc5EE6WSIKBOIl6hqBr8RLAd2tud+PYelLlki/NVzDsP8l/krIEz7u2Zfb/AKt1Pp87jJKZAAAAAElFTkSuQmCC";
  //真っ暗
  makkuraImg = new Image();
  makkuraImg.src =  "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGElEQVQ4jWNgYGD4TyEeNWDUgFEDhocBAJvM/wEeNfmLAAAAAElFTkSuQmCC";

  //勇者前向き1
  yuushaFrontImgOne = new Image();
  yuushaFrontImgOne.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAF5JREFUGJVNz4sNACEIA1CYotMye698vSYm8oKK5nQlKrmzAhVkywAJiA7YR7igPQKoMwNV48AX7g6Jopq0mNSzWuZ6L06BhJLXkTexB2OB/0fng/keG7LbYybdBu98alNb5ZfPFBgAAAAASUVORK5CYII=";
  //勇者前向き2
  yuushaFrontImgTwo = new Image();
  yuushaFrontImgTwo.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAGNJREFUGJVVkNERAEEEQ6ki1ao9l7DMnJ/lDREb2VEdzmJrckgkDUhA6ABnhAuUo4CeeaBrHMgFpyGikDQNRlGPE7rj7SitBsMb+OsA5OMZO/Csq0mitaeN1dhbPca79n4g8wOB+V8BcL2yOAAAAABJRU5ErkJggg==";

  //勇者後ろ向き1
  yuushaBackImgOne = new Image();
  yuushaBackImgOne.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAFdJREFUGJV1kMENwDAIA/EUTMvsVwhNkKKWFz5hO4opJ9bUhuzoRX4ArdkgYk6+wZUBV+0byD4zZzJwl/mQ1F4WKAMVpkiAdkalZsu8o0GXirYsoPMDtTwsDV5/HlZIZgAAAABJRU5ErkJggg==";
  //勇者後ろ向き2
  yuushaBackImgTwo = new Image();
  yuushaBackImgTwo.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAFRJREFUGJVtjtENADEIQssUTuvsHGrVpDk+bHixyIHkKaTO+EsewAQszwbuu/IP3gySe0SgHPsR4GawNobQNOJLpmgAZhE6GRdgQ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s7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAGNJREFUGJVtj8EVwCAMQs0UTMvsFKKmPZSLvi+BuEpVxahaK0B8SQAgfUG/DoqDBHmnOgMh+AO3xbE7x/flsyPVsbIDZwsK7g+Adul1OElZbUbyk72WnWkpjtS1npDe/x5HjR5xhmEtRRWNJgAAAABJRU5ErkJggg==";
  //勇者左向き2
  yuushaLeftImgTwo = new Image();
  yuushaLeftImgTwo.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAGFJREFUGJVtj8sVADEIArUKq6V2FjS/w3rIM6MoRjrg6CzDD3FJJLOKfEFXD3IHUMBWGWSZ1B9YEpEpkzRgj9THczlggiUDITFn6e6QnrYmvMC1JeZbcF3Ra1fqlefa9/4Pcg5lNUHFeXgAAAAASUVORK5CYII=";
  
  //勇者右向き1
  yuushaRightImgOne = new Image();
  yuushaRightImgOne.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEUAAACAAAAAgACAgAAAAICAAIAAgIDAwMDA3MCmyvD/8NT/4rH/1I7/xmv/uEj/qiX/qgDckgC5egCWYgBzSgBQMgD/49T/x7H/q47/j2v/c0j/VyX/VQDcSQC5PQCWMQBzJQBQGQD/1NT/sbH/jo7/a2v/SEj/JSX+AADcAAC5AACWAABzAABQAAD/1OP/scf/jqv/a4//SHP/JVf/AFXcAEm5AD2WADFzACVQABn/1PD/seL/jtT/a8b/SLj/Jar/AKrcAJK5AHqWAGJzAEpQADL/1P//sf//jv//a///SP//Jf/+AP7cANy5ALmWAJZzAHNQAFDw1P/isf/Ujv/Ga/+4SP+qJf+qAP+SANx6ALliAJZKAHMyAFDj1P/Hsf+rjv+Pa/9zSP9XJf9VAP9JANw9ALkxAJYlAHMZAFDU1P+xsf+Ojv9ra/9ISP8lJf8AAP4AANwAALkAAJYAAHMAAFDU4/+xx/+Oq/9rj/9Ic/8lV/8AVf8ASdwAPbkAMZYAJXMAGVDU8P+x4v+O1P9rxv9IuP8lqv8Aqv8AktwAerkAYpYASnMAMlDU//+x//+O//9r//9I//8l//8A/v4A3NwAubkAlpYAc3MAUFDU//Cx/+KO/9Rr/8ZI/7gl/6oA/6oA3JIAuXoAlmIAc0oAUDLU/+Ox/8eO/6tr/49I/3Ml/1cA/1UA3EkAuT0AljEAcyUAUBnU/9Sx/7GO/45r/2tI/0gl/yUA/gAA3AAAuQAAlgAAcwAAUADj/9TH/7Gr/46P/2tz/0hX/yVV/wBJ3AA9uQAxlgAlcwAZUADw/9Ti/7HU/47G/2u4/0iq/yWq/wCS3AB6uQBilgBKcwAyUAD//9T//7H//47//2v//0j//yX+/gDc3AC5uQCWlgBzcwBQUADy8vLm5uba2trOzs7CwsK2traqqqqenp6SkpKGhoZ6enpubm5iYmJWVlZKSko+Pj4yMjImJiYaGhoODg7/+/CgoKSAgID/AAAA/wD//wAAAP//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAGJJREFUGJVVjwEOQCEIQvUUnNaz8wX9tVhr9aagkcxWSXpkGPhffAEJLJjvdjWoFeyyADrI2/KCCWlLkhk2bNm270jg2BZhAGeqCALKUtdUNvgnV0VPH2eT3eZWOHTBaHb5AGDBY1V+N7IcAAAAAElFTkSuQmCC";
  //勇者右向き2
  yuushaRightImgTwo = new Image();
  yuushaRightImgTwo.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P//AP8A///////g951TAAABAHRSTlP/AP//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////rTvmKwAAAGJJREFUGJVVkNERwDAIQnUKp3V2CmjPlvgR36nERFot+RaXNwZgAVC1YNLtIuhVecqCUlReyx+MiUcCApA8lmHwjm06h4rtqaIiSPUyY4JpIeh9mk5kZ58Ss5xsxv277XzEA9VEYfvKjCMoAAAAAElFTkSuQmCC";

}


              
            
!
999px

Console