cc.fillStyle = "color"
cc.beginPath()
cc.arc(x, y, r, 0*Math.PI, 2*Math.PI)
cc.fill()
cc.beginPath()
cc.arc(x, y, r, 0*Math.PI, 2*Math.PI)
cc.fill()
cc.fillStyle = "color"
cc.fillRect(x, y, w, h)
cc.fillRect(x, y, w, h)
In regards to the above, please note the following:
- For rectangles, the 'w' and 'h' determine the width and height of the rectangle.
- For circles, the 'r' is the radius of the arc.
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