From 9952509a9ee05a5b35ab0a8e43f4f5f050d1cef2 Mon Sep 17 00:00:00 2001 From: Christian Dreier Date: Wed, 24 May 2017 22:43:38 +0200 Subject: [PATCH] basic setup --- index.html | 6 ++++++ main.js | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 index.html create mode 100644 main.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..04f71b1 --- /dev/null +++ b/index.html @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/main.js b/main.js new file mode 100644 index 0000000..4700a08 --- /dev/null +++ b/main.js @@ -0,0 +1,16 @@ +var canvas = document.getElementById("canvas") +var ctx = canvas.getContext("2d") + + +ctx.fillStyle = 'rgb(200,0,0)'; +ctx.fillRect(10, 10, 55, 50); + + +var fps = 30; +function draw() { + setTimeout(function() { + requestAnimationFrame(draw); + // Drawing code goes here + + }, 1000 / fps); +} \ No newline at end of file