池袋にて創業45年。法人実績6,150件 個人実績10,600件 相続実績1,080件 弊社はお陰様で信頼と実績があります。

税理士法人KOSUGE東池袋、池袋、豊島区、北区、練馬区、埼玉県を中心に活動しております。相続、その他税務に関する相談やそして会社起業などのお手伝いも積極的に行っています。池袋 税理士


池袋にて創業45年。法人実績6,150件 個人実績10,600件 相続実績1,080件 弊社はお陰様で信頼と実績があります。

経営革新等支援機関
経営改善計画をサポート
経営改善計画策定支援バナー
経営計画の策定支援
経営数値をタイムリーに把握
部門別の業績 管理をサポート
創業の夢をお手伝い
貴社を毎月来訪します
事前に必要納税額を通知
書面添付に対応します
相続対策 経営承継

事務所概要

事務所名税理士法人KOSUGE
所在地〒170-0013
東京都豊島区東池袋1-25-2 朝日生命池袋ビル2F
電話番号03-3984-5547
FAX番号03-3590-8004
業務内容
  • 池袋・記帳指導(PC)及び記帳代行、電子申告・池袋
  • 池袋・決算業務、税務代理、税務相談・池袋
  • 池袋・相続、資産税、事業承継対策、その他・池袋
  • 池袋TKCコンピュータシステム・生涯研修実践事務所・池袋
  • 池袋創業経営革新アドバイザー・池袋
  • 池袋TKC企業防衛制度取扱い事務所・池袋
  • 池袋損害保険代理店・池袋生命保険代理店(保険手続きは(株)小菅経営サービスが行います)

ここに文章を入力<!DOCTYPE html>

<html>

<head>

  <title>ブロック崩し</title>

  <style>

    #canvas {

      border: solid 1px black;

    }

  </style>

</head>

<body>

  <canvas id="canvas" width="480" height="320"></canvas>

  <script>

    const canvas = document.getElementById("canvas");

    const ctx = canvas.getContext("2d");

 

    // パドルの設定

    const paddleWidth = 75;

    const paddleHeight = 10;

    let paddleX = (canvas.width - paddleWidth) / 2;

 

    // ボールの設定

    let ballX = canvas.width / 2;

    let ballY = canvas.height - 30;

    let ballRadius = 10;

    let dx = 2;

    let dy = -2;

 

    // ブロックの設定

    const brickRowCount = 3;

    const brickColumnCount = 5;

    const brickWidth = 75;

    const brickHeight = 20;

    const brickPadding = 10;

    const brickOffsetTop = 30;

    const brickOffsetLeft = 30;

    const bricks = [];

    for(let c = 0; c < brickColumnCount; c++) {

      bricks[c] = [];

      for(let r = 0; r < brickRowCount; r++) {

        bricks[c][r] = { x: 0, y: 0, status: 1 };

      }

    }

 

    // スコアの設定

    let score = 0;

 

    // パドルの描画

    function drawPaddle() {

      ctx.beginPath();

      ctx.rect(paddleX, canvas.height - paddleHeight, paddleWidth, paddleHeight);

      ctx.fillStyle = "#0095DD";

      ctx.fill();

      ctx.closePath();

    }

 

    // ボールの描画

    function drawBall() {

      ctx.beginPath();

      ctx.arc(ballX, ballY, ballRadius, 0, Math.PI*2);

      ctx.fillStyle = "#0095DD";

      ctx.fill();

      ctx.closePath();

    }

 

    // ブロックの描画

    function drawBricks() {

      for(let c = 0; c < brickColumnCount; c++) {

        for(let r = 0; r < brickRowCount; r++) {

          if(bricks[c][r].status == 1) {

            let brickX = (c * (brickWidth + brickPadding)) + brickOffsetLeft;

            let brickY = (r * (brickHeight + brickPadding)) + brickOffsetTop;

            bricks[c][r].x = brickX;

            bricks[c][r].y = brickY;

            ctx.beginPath();

            ctx.rect(brickX, brickY, brickWidth, brickHeight);

            ctx.fillStyle = "#0095DD";

            ctx.fill();

            ctx.closePath();

          }

        }

      }

    }

 

    // スコアの描画

    function drawScore() {

      ctx.font = "16px Arial";

      ctx.fillStyle = "#0095DD";

      ctx.fillText("Score: " + score, 8, 20}

 

// 衝突判定

function collisionDetection() {

  for(let c = 0; c < brickColumnCount; c++) {

    for(let r = 0; r < brickRowCount; r++) {

      let b = bricks[c][r];

      if(b.status == 1) {

        if(ballX > b.x && ballX < b.x + brickWidth && ballY > b.y && ballY < b.y + brickHeight) {

          dy = -dy;

          b.status = 0;

          score++;

          if(score == brickRowCount * brickColumnCount) {

            alert("Congratulations! You cleared the game!");

            document.location.reload();

          }

        }

      }

    }

  }

}

 

// ゲームオーバーの描画

function drawGameOver() {

  ctx.font = "30px Arial";

  ctx.fillStyle = "red";

  ctx.fillText("Game Over", canvas.width/2 - 80, canvas.height/2);

}

 

// ゲームループ

function draw() {

  ctx.clearRect(0, 0, canvas.width, canvas.height);

  drawPaddle();

  drawBall();

  drawBricks();

  drawScore();

  collisionDetection();

 

  if(ballX + dx > canvas.width - ballRadius || ballX + dx < ballRadius) {

    dx = -dx;

  }

  if(ballY + dy < ballRadius) {

    dy = -dy;

  } else if(ballY + dy > canvas.height - ballRadius) {

    if(ballX > paddleX && ballX < paddleX + paddleWidth) {

      dy = -dy;

    } else {

      drawGameOver();

      clearInterval(interval);

    }

  }

 

  if(rightPressed && paddleX < canvas.width - paddleWidth) {

    paddleX += 7;

  } else if(leftPressed && paddleX > 0) {

    paddleX -= 7;

  }

 

  ballX += dx;

  ballY += dy;

}

 

// イベントハンドラの設定

let rightPressed = false;

let leftPressed = false;

document.addEventListener("keydown", keyDownHandler, false);

document.addEventListener("keyup", keyUpHandler, false);

function keyDownHandler(e) {

  if(e.key == "Right" || e.key == "ArrowRight") {

    rightPressed = true;

  } else if(e.key == "Left" || e.key == "ArrowLeft") {

    leftPressed = true;

  }

}

function keyUpHandler(e) {

  if(e.key == "Right" || e.key == "ArrowRight") {

    rightPressed = false;

  } else if(e.key == "Left" || e.key == "ArrowLeft") {

    leftPressed = false;

  }

}

 

// ゲームの開始

let interval = setInterval(draw, 10);してください

電帳法・インボイス最新情報
電帳法・インボイス最新情報