+ 6
SVG or Canvas
Hi, I am working on online browser game and I have a little problem... In this game will be used many animations and effects. Should i use Canvas for rendering objects or SVG? I read some articles about this problem. SVG is supposedly slow, but I cannot imagine animations in Canvas. Thanks for help.
7 ответов
+ 9
Definitely. With SVG one character will be ok. 30 would have so much lag that the game would be unplayable.
+ 9
Do you remember these lessons? I think they will answer your questions.
https://www.sololearn.com/learn/HTML/2202/
https://www.sololearn.com/learn/HTML/2203/
+ 9
Yes, I would be looking at objects for this, it will make creation and management much easier.
https://www.sololearn.com/learn/JavaScript/1152/?ref=app
Nice Character!
+ 5
Thank you for response. This methods can rotate, translate and scale canvas... So I need function, which will calculate positions and rotations of each element (e.g. 30 players, each player has character - head, legs, arms...) and in interval draw these elements? I have prototype using svg ( http://ageofdanrolius.herokuapp.com/character.html ). You can look at it.
+ 4
Thank you so much!
+ 3
Okay, so definitively canvas?
+ 2
Use pixi.js. Definitely the best library for canvas drawing.