NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

/* Constants for bricks */

var NUM_ROWS = 8;

var BRICK_TOP_OFFSET = 10;

var BRICK_SPACING = 2;

var NUM_BRICKS_PER_ROW = 10;

var BRICK_HEIGHT = 10;

var SPACE_FOR_BRICKS = getWidth() - (NUM_BRICKS_PER_ROW + 1) * BRICK_SPACING;

var BRICK_WIDTH = SPACE_FOR_BRICKS / NUM_BRICKS_PER_ROW;



/* Constants for ball and paddle */

var PADDLE_WIDTH = 80;

var PADDLE_HEIGHT = 15;

var PADDLE_OFFSET = 10;

var paddle;



var BALL_RADIUS = 15;



var counter = 0;

var x=2;

var y=0;



function start(){

for(var i = 0; i < NUM_ROWS; i++){
x=2;

counter++;

rowChecker(counter);

y += BRICK_HEIGHT+BRICK_SPACING;

}

mouseMoveMethod(movePaddle);
}



function rowChecker(counter){

if(counter%8==1||counter%8==2){

drawBrickRow("#ff6961");

}else if(counter%8==3||counter%8==4){

drawBrickRow("#ffb347");

}else if(counter%8==5||counter%8==6){

drawBrickRow("#77dd77");

}else if(counter%8==7||counter%8==0){

drawBrickRow("#779ecb");

}

}



function drawBrickRow(color){

for(var i = 0; i < NUM_BRICKS_PER_ROW; i++){

var brick = new Rectangle(BRICK_WIDTH, BRICK_HEIGHT);

brick.setPosition(x, y);

brick.setColor(color);

add(brick);

x += BRICK_WIDTH+BRICK_SPACING;

}

}



function movePaddle(e){

var paddleX = e.getX()-PADDLE_WIDTH/2;

var paddleY = e.getY()-PADDLE_HEIGHT/2;

var wallX = paddleX>0 && paddleX+PADDLE_WIDTH<getWidth();

var wallY = paddleY>y && paddleY+PADDLE_HEIGHT<getHeight();

if(wallX&&wallY){

remove(paddle);

}

paddle = new Rectangle(PADDLE_WIDTH, PADDLE_HEIGHT);

paddle.setPosition(paddleX, paddleY);

paddle.setColor("#008080");

if(wallX&&wallY){

remove(paddle);

add(paddle);

}

}
     
 
what is notes.io
 

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

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.