How to move the entire queue and depict it with canvas.

to complete the following effect diagram, the move: method cannot achieve the desired automatic movement at the speed shift 2,
.png


.png

.
Feb.28,2021

set the timer in the move method. The timer executes the draw method.
in addition, it is not good to create objects all the time in the draw method.
you can create an init method first. After the object has been created, it is stored in the array. The draw method can modify the properties of the object


. I think your structure is very bad, so that your subsequent code can no longer be written.
try to change the way of thinking. A game has a startup entry. We call it Game
and use the timing function in Game. That is, requestAnimation constantly executes the function to be brushed
the two most important methods in the function to be brushed
A update is used to update the location information of all objects in your scene. Update calls the update of all objects in your scene to update the position
a render is used to draw all objects in your scene. Render calls the draw method of all objects to draw the image
then you will find that you need a global data. To manage this information
and abstract the Enemy, If you want more Enemy, new a
https://codeshelper.com/a/11.. You can take a look at this analysis of Wechat's Mini Game jerking off demo. I hope it can help you


recommend https://www.github.com/PengJi.
, which is a canvas 2d rendering library. Small size, powerful, support for drawing, graphics binding time, drag, zoom in and out, and so on.


the amount of call position translation in requestanimationframe is (2 Math.sin (offsetAngle) / 60, 2 Math.cos (offsetAngle) / 60)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b31cce-2bdca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b31cce-2bdca.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?