Skip to content

Instantly share code, notes, and snippets.

#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "Adafruit_SHTC3.h"
#include <Adafruit_Sensor.h>
#include "Adafruit_BMP3XX.h"
#include "Adafruit_APDS9960.h"
Adafruit_APDS9960 apds;
ctx.clearRect(0, 0, canvas.width, canvas.height);
angle = (angle+1) % 360;
ctx.save();
ctx.translate(centerX, centerY);
ctx.rotate(2* Math.PI* angle/360);
ctx.beginPath();
ctx.arc(0, 0, dotR, 0, 2 * Math.PI, false);
ctx.fillStyle = "#000000";
ctx.closePath();
canvas.draw = function() {
ctx = this.ctx;
requestAnimationFrame(() => {
this.draw(ctx);
});
ctx.fillStyle = this.backgroundColor;
ctx.fillRect(0, 0, window.innerWidth, window.innerHeight);
ctx.beginPath();
ctx.fillStyle = this.fillStyle;
ctx.lineWidth = 5;
var count = 0;
count += 0.05;
radians = (count%360);
let movement = radians/Math.PI;
x = Math.sin(movement)*this.r*2;
y = Math.cos(movement)*this.r*1.5 - textHeight/2;
ctx.arc(
ctx.globalCompositeOperation = "destination-out";
ctx.arc(mousePos.x, mousePos.y, this.r, 0, Math.PI * 2, false);
ctx.fill();
ctx.globalCompositeOperation = "source-over";
canvas.draw = function() {
ctx = this.ctx;
requestAnimationFrame(() => {
this.draw(ctx);
});
ctx.fillStyle = this.backgroundColor;
ctx.fillRect(0, 0, window.innerWidth, window.innerHeight);
ctx.beginPath();
ctx.fillStyle = this.fillStyle;
ctx.lineWidth = 5;
.infos
h2 Project 4
h1 Memory<br>Blocks
h3.status -
.blocks
.row
.block.block1 1
.block.block2 2
.row
.game
.board.b1
.board.b2
.ball
.info
h2.infoText Start Game
button.start(onclick="game.startGame()") Start
.grade