html5 - Changing the speed of the moving ball in Canvas pure Javascript -


so i'm following step-by-step tutorial create simple mdn breakout game written entirely in pure javascript , rendered on html5 . can find link , code here https://developer.mozilla.org/en-us/docs/games/tutorials/2d_breakout_game_pure_javascript/move_the_ball. i'm trying change speed of moving ball, i'm new javascript, appreciate help.

you can change dx , dy:

var dx = 4; var dy = -4; 

or change interval:

setinterval(draw, 5); 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -