xxxxxxxxxx
//collides: returns true when a sprite first collides with another.
//on the first frame that a sprite collides with another sprite,
//the collides function returns true.` `
//let player, pillar;
function setup() {
new Canvas(400, 400);
world.gravity.y = 10; // set +gravity so objects fall down
pillar = new Sprite(30, 362, 30, 500, 'static')
// x = | y = | w = | h = | collider =
player = new Sprite(30, 0, 50);
// x = | y = | d = | collider =
}
function draw() {
clear();
//on the first frame that a sprite collides with another sprite,
//the collides function returns true.
// if (player.collides(pillar)) {
// player.vel.y = -5;
// pillar.h -= 52;
// }
}