0

Why won't this code work?

I was working on this code, amd it worked. I saved it and took a break, but when I came back, the circle that should have been appearing was gone. I'm not sure what happened and can't find anything wrong. https://sololearn.com/compiler-playground/Wc5anUbfe1l9/?ref=app

7th Dec 2023, 6:12 PM
Paxton Programer
5 ответов
0
Hi.👋 string 27: //add circle brackets Date.now()
9th Dec 2023, 7:48 AM
Maksim Dimitrak
Maksim Dimitrak - avatar
+ 2
Thanks for the tip
9th Dec 2023, 6:19 PM
Paxton Programer
0
Thanks so much
9th Dec 2023, 1:01 PM
Paxton Programer
0
👍🏻👍🏻👍🏻
9th Dec 2023, 5:00 PM
Maksim Dimitrak
Maksim Dimitrak - avatar
0
u can store the enemies inside an array let enemyes=[{x:5,y:7},{x:8,y:2}] then to render them just loop in enemies ``` for(let i in enemies){ ctx.circle(enemies[i].x,enemies[i].y,20,0,Math.Pi); ctx.fill(); } or use classe class enemy{ constructor(x,y){ this.x=x; this.y=y; } } and store them in an array let enemies=[new enemy(5,7),new enemy(8,2)]; and u can add an enemy by using enemyes.push(new enemy(50,79)); and use the same loop to render them
9th Dec 2023, 6:15 PM
Med Yassine
Med Yassine - avatar