mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2024-12-27 09:58:44 +01:00
canvas work in progress
This commit is contained in:
parent
1323c934ba
commit
4053fcee3a
1 changed files with 6 additions and 3 deletions
|
@ -132,9 +132,12 @@ function format_level( state, text ) {
|
||||||
}
|
}
|
||||||
function display_on_canvas( state, canvas_elt ) {
|
function display_on_canvas( state, canvas_elt ) {
|
||||||
var ctx= document.getElementById( canvas_elt ).getContext( '2d' );
|
var ctx= document.getElementById( canvas_elt ).getContext( '2d' );
|
||||||
|
for ( var i=0 ; i < LEVEL_HEIGHT ; i++ ) {
|
||||||
ctx.translate( 100, 100 );
|
for ( var j=0 ; j < LEVEL_WIDTH ; j++ ) {
|
||||||
ctx.drawImage( sprites.ball, -3.5, -3.5 );
|
ctx.translate( j * board_infos.cell_dimensions.width, i * board_infos.cell_dimensions.height );
|
||||||
|
ctx.drawImage( sprites.ball, j * board_infos.cell_dimensions.width, i * board_infos.cell_dimensions.height );
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function format_infos( state ) {
|
function format_infos( state ) {
|
||||||
var infos = "<h1>Star5</h1><br />";
|
var infos = "<h1>Star5</h1><br />";
|
||||||
|
|
Loading…
Reference in a new issue