How to improve performance with many objects in game in HTML5?

后端 未结 2 1705
臣服心动
臣服心动 2021-01-23 21:27

What things can I do when it\'s necessary to show many objects and calculate position, collision detection, reaction, etc. and I want everything look smoothly? Here\'s an exampl

2条回答
  •  广开言路
    2021-01-23 22:10

    The basic steps to improve performance in canvas can be seen in this HTML5 Rock's Canvas Performance Tutorial.

    And, if you are free to handle collision detection without Box2D, check this quad-tree implementation. The quad-tree doesn't deals with collisions directly but can improve performance by reducing the amount of comparisons needed to detect the collisions.

    Articles suggestion for further reading:

    Broad Phase Collision Detection Using Spatial Partitioning

    Collision Detection and Response

    Making Games With Box2dWeb

提交回复
热议问题