Skip to content

Instantly share code, notes, and snippets.

@mayth
Created November 10, 2014 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mayth/6a3080c3496f9faebdb2 to your computer and use it in GitHub Desktop.
Save mayth/6a3080c3496f9faebdb2 to your computer and use it in GitHub Desktop.
あぁ^〜心がぴょんぴょんするんじゃぁ^〜
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>あぁ^〜心がぴょんぴょんするんじゃぁ^〜</title>
<script src="gochiusa.js"></script>
</head>
<body>
<canvas id="gochiusa" width="640" height="480">
あぁ^〜心ぴょんぴょんするには最新のブラウザが必要なんじゃぁ^〜
</canvas>
</body>
</html>
var y, canvas;
function pyonpyon() {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.width, canvas.height);
++y;
ctx.fillText("心", 0, y * y);
if (y == 9) {
y = -y;
}
}
document.addEventListener("DOMContentLoaded", function(event) {
y = -9;
canvas = document.getElementById("gochiusa");
setInterval(pyonpyon, 50);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment