Developing TicToe HTML5/Implementing Client Entities: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann No edit summary |
imported>Hendrik Brummermann |
||
| Line 48: | Line 48: | ||
== Drawing the gameboard == |
== Drawing the gameboard == |
||
Okay, now we have (stupid) prototypes of all the important objects. Let's add a method to the gameboard prototype, which will draw it onto the screen |
Okay, now we have (stupid) prototypes of all the important objects. Let's add a method to the gameboard prototype, which will draw it onto the screen. |
||
The following method will create an img-tag in the HTML document and set the image file name and position. When the draw() method is called a second time, it will reuse the img-tag and adjust the parameter. For example, if the server has provided a new x-value in the mean time, the img-tag will be moved. |
|||
<source lang="javascript"> |
<source lang="javascript"> |
||
| Line 67: | Line 69: | ||
} |
} |
||
</source> |
</source> |
||
== Testing and Debugging == |
|||
{{TODO|Write this section}} |
|||