Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mariane/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# p5js-natal
Mariane.
Binary file added mariane/arvorenatal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mariane/floco1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mariane/floco2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mariane/floco3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mariane/floco4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions mariane/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>p5js - boilerplate</title>
<script type="text/javascript" src="p5.min.js"></script>
<script type="text/javascript" src="p5.sound.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body>

</body>
</html>
Binary file added mariane/musica.mp3
Binary file not shown.
Binary file added mariane/noite.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions mariane/p5.min.js

Large diffs are not rendered by default.

11,441 changes: 11,441 additions & 0 deletions mariane/p5.sound.js

Large diffs are not rendered by default.

Binary file added mariane/paisagem.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions mariane/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* p5js boilerplate
*
*
*/
var fundo;
var floco1img;
var floco2img;
var floco3img;
var floco4img;
var boneco;
var estrela;
var som;
var arvore;
var cairEstrela;

function preload() {
fundo = loadImage("paisagem.jpg");
floco1img = loadImage("floco1.png");
floco2img = loadImage("floco2.png");
floco3img = loadImage("floco3.png");
floco4img = loadImage("floco4.png");
boneco = loadImage("snowman.png");
estrela = loadImage("star.png");
som = loadSound("musica.mp3");
arvore = loadImage("arvorenatal.png");

}

// chamada no inicio do programa
function setup() {
som.play();
createCanvas(1270,730);
som.setVolume(1.0);
som.loop();
estrelaPos = createVector(900, 0);
cair = createVector(0, 0);
// cria o quadro, com dimensoes 900 x 400
createCanvas(900, 400);
}

// chamada toda vez que o quadro for redesenhado
// ou seja, a cada frame da animacao
function draw() {
// pinta o fundo de preto
background(fundo);

image(boneco, 50, 180, 150, 150);

image(floco1img, 25, cair.y, 50, 50);
image(floco2img, 125, cair.y, 50, 50);
image(floco3img, 225, cair.y, 50, 50);
image(floco4img, 325, cair.y, 50, 50);
image(floco1img, 425, cair.y, 50, 50);
image(floco2img, 525, cair.y, 50, 50);
image(floco3img, 650, cair.y, 50, 50);
image(floco4img, 725, cair.y, 50, 50);
image(floco1img, 825, cair.y, 50, 50);
image(floco2img, 925, cair.y, 50, 50);

cair.y++;

if(cair.y >= 400){
cair.y = -50
}

image(estrela, estrelaPos.x, estrelaPos.y, 50, 50);
image(arvore, 740, 240, 150, 150);

if(cairEstrela == true){

estrelaPos.x -=3;
estrelaPos.y +=2;
}
}

function mousePressed(){
cairEstrela = true
}


Binary file added mariane/snowman.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added mariane/star.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.