Update changed puph pop to vertex shape

This commit is contained in:
Lev
2021-06-09 00:39:13 -05:00
parent 7fa8dc5e61
commit 140f38bb3e

View File

@ -22,18 +22,19 @@ function setup() {
function draw() {
background(0);
Engine.update(engine);
rectMode(CENTER);
push();
let pos = box1.position;
translate(pos.x, pos.y);
rotate(box1.angle);
rect(0, 0, 80, 80);
pop();
fill(255);
drawVertices(box1.vertices);
push();
pos = ground.position;
translate(pos.x, pos.y);
rotate(ground.angle);
rect(0, 0, 810, 10);
pop();
fill(150, 50, 50);
drawVertices(ground.vertices);
}
function drawVertices(vertices)
{
beginShape();
for (let i = 0; i < vertices.length; i++) {
vertex(vertices[i].x, vertices[i].y);
}
endShape();
}