xxxxxxxxxx
var timerr = 0; // TIMER
var buttonn; // button of the song
var songg; // the song
var playy; // play the song
var sentencee = ['张峻豪','连淮伟','泮家豪','范丞丞','陈飞宇','秦霄贤', '王源', '时代少年团','王楚钦'];
var imagee; // the cake
function preload() {
songg = loadSound('Happy Birthday.wav');
imagee = loadImage('Cake.jpg');
}
function setup() {
createCanvas(1200, 600);
frameRate(1.5);
}
function draw() {
background(255, 235, 205);
imageMode(CENTER);
scale(0.75);
image(imagee, 800, 400);
textAlign(CENTER);
fill(random(100, 200), random(100, 200), 255, 175);
timerr = 630720000 + int(millis()/1000); // TIMER
textSize(20);
text('《食 用 指 南》', 225, 50);
text('建议电脑食用', 225, 100);
text('单击按钮会有声音', 225, 125);
text('再按空格', 225, 150);
text('再输1210', 225, 175);
textSize(15);
text('呜呜我太菜了', 225, 700);
text('这次只是随便放了几个东西', 225, 720);
text('没做有很多互动的或者视觉上好看的', 225, 740);
text('下次一定', 225, 760);
textSize(30);
text('邈邈祝你生日快乐', 225, 300);
text('恭喜你已经度过了', 225, 340);
text('20年', 225, 380);
text('240月', 225, 420);
text('1043周', 225, 460);
text('7300天', 225, 500);
text('175200时', 225, 540);
text('10512000分', 225, 580);
text(timerr+'秒', 225, 620);
textSize(20);
text('2021/12/10', 1375, 760);
buttonn = createButton('33');
buttonn.position(275, 215);
buttonn.size(30, 30);
buttonn.mousePressed(playy);
if(key===' ')
{
textSize(30);
fill(random(0,255), random(0,255), random(0,255));
text(random(sentencee)+'祝你生日快乐', random(0,windowWidth), random(0,windowHeight));
}
if(key==='0')
{
textSize(30);
text('邈邈以及你的 粉 丝 团', 1375, 60);
text('提醒你记得', 1375, 120)
text('每天都要', 1375, 200);
text('水逆退散', 1375, 250);
text('顺心顺意', 1375, 300);
text('保持开心', 1375, 350);
text('往后还要', 1375, 430);
text('谈个可以结婚的恋爱', 1375, 480);
text('考研上岸', 1375, 530);
text('工作有个大致的着落', 1375, 580);
}
}
function playy() {
songg.play();
}