Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
float rectY; // random rectangle right side
float rectWidth;
float rectHeight;
int xSpeed = 70; // MOVEMENT VALUE X AXIS
int ySpeed = 70; // MOVEMENT VALUE Y AXIS
int x; // centre starting point X value
int y; // centre starting point Y value
void setup() {
size(700,700);
rectX = random(0,width); // LEFT SIDE
rectY = random(0,width); // RIGHT SIDE
rectWidth = 75;
rectHeight = 250;
x = 35;
y = 35;
}
void draw() {
// BACKGROUND
background(#cfced4); /// colour CANVAS
// LINE
line(x,y-850,x,y); // LINE ontop of character
// CHARACTER
noStroke();
fill(#9CE578); // SKIN colour - green
ellipse(x,y,29,21); // HEAD
triangle(x+10,y-7,x+5,y+9,x+30,y-8); // right EAR
triangle(x-10,y-7,x+5,y+9,x-30,y-8); // left EAR
fill(232,136,168,220); // INSIDE EAR colour - pink
triangle(x+15,y+1,x+15,y-4,x+30,y-8); // right EAR INSIDE
triangle(x-15,y+1,x-15,y-4,x-30,y-8); // left EAR INSIDE
fill(0); // EYE colour - black
ellipse(x+6,y-3,8.5,9); // right EYE
ellipse(x-6,y-3,8.5,9); // left EYE
fill(255); // EYE REFLECTION colour - white
ellipse(x+5,y-5,3.5,3.5); // right EYE REFLECTION
ellipse(x-7,y-5,3.5,3.5); // left EYE REFLECTION
stroke(1); // reveal MOUTH
line(x-2,y+4,x+2,y+4); // MOUTH
// OBSTACLES
fill(200,30,80);
if(rectX > 450){
rectX = 20;
}
if(rectX < 10){
rectX = 100;
}
rect(205,rectX,rectWidth,rectHeight); // LEFT SIDE OBSTACLE
if(rectY > 450){
rectY = 50;
}
if(rectY < 10){
rectY = 40;
}
rect(415,rectY,rectWidth,rectHeight); // RIGHT SIDE OBSTACLE
// CHARCTER COLLISION
if(dist(rectX,rectY,rectWidth,rectHeight) <= x) {
background(0);
fill(100,255,150);
textSize(60);
text("Gameover",210,330);
}
}
void keyPressed() {
if (keyCode == UP) {
y = y - ySpeed;
if(y <= 0) {
y = 665;
}
}
if (keyCode == DOWN) {
y = y + ySpeed;
if(y >= 700) {
y = 35;
}
}
if (keyCode == LEFT) {
x = x - xSpeed;
if(x <= 0) {
x = 665;
}
}
if (keyCode == RIGHT) {
x = x + xSpeed;
if(x >= 700) {
x = 35;
}
}
}
![]() |
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team