How to make an image appears and disappears in random positions in canvas? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to make an image appears and disappears in random positions in canvas?

JavaScript

5th Dec 2016, 3:23 AM
Mahmoud Abbas
Mahmoud Abbas - avatar
2 Answers
+ 3
[image].x = Math.random() * [canvas].width - [image].width; [image].x = Math.random() * [canvas].width - [image].width; is this what you mean?
15th Dec 2016, 5:18 PM
Sjoerd Flameling
Sjoerd Flameling - avatar
0
I'll try it and tell you
16th Dec 2016, 12:45 AM
Mahmoud Abbas
Mahmoud Abbas - avatar