/game_things

basic_game_stuff

Primary LanguageHTML

a place to play with basic .js game ideas



includes use of canvas:
beginPath()       // starts drawing the path
closePath()       // stops drawing the path

rect(x, y, width, height) 
arc(x, x, radius, startAngle, endAngle, counterclockwise) 
ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, counterclockwise)

fill():  
 fill(path), 
 fill(fillRule), 
 fill(path, fillRule) 
stroke()
also:
Math.PI
Math.random()          // pseudo-random number generator
math.floor(x)           // returns rounded down int

setInterval(code, delay)            // runs code per delay in ms
requestAnimationFrame(callback) 
and:
clearRect(x, y, width, height)                  // sets all pixels in defined rectangle to transparent black 
addEventListener(type, listener, options)        // adds 'listener' to trigger named function on event, eg 'keydown'

(haven't been updating this list religiously. more to add, maybe when i have time/focus to spare)