This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ctx.globalCompositeOperation = "destination-out"; | |
ctx.arc(mousePos.x, mousePos.y, this.r, 0, Math.PI * 2, false); | |
ctx.fill(); | |
ctx.globalCompositeOperation = "source-over"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.infos | |
h2 Project 4 | |
h1 Memory<br>Blocks | |
h3.status - | |
.blocks | |
.row | |
.block.block1 1 | |
.block.block2 2 | |
.row |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.game | |
.board.b1 | |
.board.b2 | |
.ball | |
.info | |
h2.infoText Start Game | |
button.start(onclick="game.startGame()") Start | |
.grade |