Jump to content

Best way to draw balls - graphics, bitmapData or image?


tomsawyer
 Share

Recommended Posts

I actually experimented with this some time ago and graphics is really bad.

These are some of those.

https://jsfiddle.net/j9kzwyqv/ - using sprites and webgl

https://jsfiddle.net/7a87eL9n/1/ - using direct canvas draw with webgl

https://jsfiddle.net/rf2gcfnz/1/ - using texture with webgl

The example with sprites and webgl was the fastest by far, but using Phaser.Image should be the fastest of them all. I don't have all the experiments anymore but you can fiddle with the links I gave and try out different stuff.

I'd go for sprites tho. You make images that look like balls then load then add them as sprites and reuse them. Particles would be even better depending on what you want to achieve. http://phaser.io/examples/v2/category/particles

 

Link to comment
Share on other sites

9 hours ago, symof said:

I actually experimented with this some time ago and graphics is really bad.

These are some of those.

https://jsfiddle.net/j9kzwyqv/ - using sprites and webgl

https://jsfiddle.net/7a87eL9n/1/ - using direct canvas draw with webgl

https://jsfiddle.net/rf2gcfnz/1/ - using texture with webgl

The example with sprites and webgl was the fastest by far, but using Phaser.Image should be the fastest of them all. I don't have all the experiments anymore but you can fiddle with the links I gave and try out different stuff.

I'd go for sprites tho. You make images that look like balls then load then add them as sprites and reuse them. Particles would be even better depending on what you want to achieve. http://phaser.io/examples/v2/category/particles

 

Thanks to all of you, I thought using vector is faster because the game like slither.io , it uses bitmapdata ?

What's about high resolution sprite for smartphone?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...