T
T
tenaro2015-11-28 22:33:40
JavaScript
tenaro, 2015-11-28 22:33:40

JS / How to make background in 2d game?

Classic background in 2d games, background 40000x650px (png) should move to the left in 2 minutes. Play in full browser screen.
I tried to animate via
css: left:-40000 and transition:120,
animate, setinterval, tweenmax,
canvas (here the max size is about 32000, but even at 8k you can see the brakes)
split into 10 blocks of 4000px each, and tried to scroll them
Problem: A little twitching , it is clear that the animation is not smooth, and it is clear that this is not a framerate problem, all these jerks are not uniform.
How is it generally right to do it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2015-11-29
@ACCNCC

Tin)) in general for smooth animation and made canvas.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question