Kids

Can

JavaScript

Ready Functions

This Tutorial contains some handy functions that you can use.

  • circle()draws a circle: x,y,radius.
  • rect()draws a rectangle: x,y,width,height.
  • oval()draws an oval: x,y,width,height.
  • triangle()draws a triangle: x,y,dist2x,dist2y,dist3x,dist3y.
  • ReadyObj()An object Constructor with parameters: Image,x,y,width,heigth, and with a this.draw function, to draw itself on canvas.
  • ReadyObjWithAnim()Same as above plus a this.animate function for animation.
  • intersects(dimensions)checks if 2 shapes intersect(parametes: dimensions of objects)
  • intersects(objects)checks if 2 shapes intersect(parametes: objects)
  • mouseIntersects()checks if mouseCoords are inside a shape
  • DragNDrop()deletes a key and its value from an Object
  • inreturns true if the a property is in the specified object, otherwise false


  • <-----Back        Next --->

    This username already exists.

    This username already exists.

    Login or register to save your work.

    User name field is empty.

    Your username needs to be at least 7 characters long.

    Your username can not contain any of the following characters: ",', <, > , < and whitespaces.

    Please enter a correct email addresss .

    This email address is not found in our database .

    Your password needs to be at least 7 characters long.

    login
    username
    password
    forgot password
    email
    register
    username
    password
    email