Warning! This page is still in the works.


cc.fillStyle = "color"
cc.beginPath()
cc.arc(x, y, r, 0*Math.PI, 2*Math.PI)
cc.fill()

cc.fillStyle = "color"
cc.fillRect(x, y, w, h)

In regards to the above, please note the following:

  • The 'w' and 'h' and 'r' tell the computer how big to draw shapes.

  • Although 'w,' 'h' or 'r' can be a number, it can also be a variable.
  • Using variables instead of numbers for your w-h-r coordinates means you can set a continuous equation for your shape:
  • w1 = w1 + (put any number here) // The number given will determine the speed of change of dimensions of the shape. //

    However, please note that w1 needs a value to be equal to. In initialize(), add the following:

    w1 = (put any number here)

    The Next Step


    Create a speed variable in initialize(). The number should be the same as whatever you are adding/subtracting in your update line.

    If you have in repeatingForever():

    w1 = w1 + 3

    Then in initialize(), you should add:

    w1speed = 3

    In repeatingForever(), change your "update" line so that it uses the speed variable you created.

    w1 = w1 + 3

    becomes...

    w1 = w1 + w1speed