Can i clone a object and make it run some code
تبليغيرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.
I want to clone a bullet and make it auto move, but how can i do it?
Here is the code (it will loop every 10ms) i am using for the bullet (it is just for following the player):
bullet.style.right = (Number(player.style.right.split(“px”)[0]) + 40) + “px”;
bullet.style.top = (Number(player.style.top.split(“px”)[0]) + 6.5) + “px”;
I want to make the bullet auto generate its clone at its place and have its(the clone) own code
أضف إجابة