Skip to content
Advertisement

How to make canvas shape circle?

Hello I want to know how can I make the canvas shape circle in the below code. The code is about moving a object with keyboard keys. I tried to make the circle out of this box but it just disappeared and i am not really sharp. Can some help me make this canvas circle without affecting code.

sorry but i have to write something more because SO says body has all code… i don’t know what to say now (make the canvas circle)(make the canvas circle)(make the canvas circle)

JavaScript

Advertisement

Answer

I moved the circle code into the drawstuff function as that is where it has to run, and removed the use of fillRect.

You can see the result here:

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement