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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -