@@ -143,19 +143,19 @@ litecanvas()
143143function draw () {
144144 cls (0 )
145145
146- // draw a color filled rectangle at x=0 and y=0
146+ // draw a color filled rectangle at x=10 and y=20
147147 // with width=32 and height=32
148148 // and color=3 (white)
149- rectfill (0 , 0 , 32 , 32 , 3 )
149+ rectfill (10 , 20 , 32 , 32 , 3 )
150150
151- // draw a circle outline at x=64 and y=32
152- // with radius=40
151+ // draw a circle outline at x=64 and y=96
152+ // with radius=50
153153 // and color=5 (yellow)
154- circ (64 , 64 , 40 , 5 )
154+ circ (64 , 96 , 50 , 5 )
155155}
156156```
157157
158- [ Live Demo] ( https://litecanvas.js.org?c=eJxljkEKwyAQRfeeYpYKgUpisvMwoiYKg4IxTUPp3as2oYuII6Pf%2Bf%2Bhz1ar8FQrZYTMW9DZxwAmqZ0yeBMoS%2BNKeVFr%2F3g0DRToiDHB7BGtgWR1VmFBCyrDS3JQwcAh%2BTWz%2B%2BzKYbKTQ99EZ%2F3icrldX%2Bpj85QD0N0VLtakal1TKO%2Bg7KE%2F6w7kky4AccvowwkyiZPkn9NQkjJ%2BW6Xg9%2FQR6GER4%2F6Lr650Eh3UEgVgZOTzBZepVrE%3D )
158+ [ Live Demo] ( https://litecanvas.js.org?c=eJxljk0KwyAQhfc5xSwNBGJ%2BFLrwMKImCoOCMU1D6d2rabIoGZhBfeN7H7pklPRPuZC6qqbVq%2BSCBx3lRmp4V5BL4UJoVsu5bQ8NJKiAIcLkEI2GaFSSfkYDMsFLdBSk17CLnl6%2FNpdsHjpZMfSHao2bbcq3a6U8Hq5iALLZTFYfUjEvOaSjDfS5h%2F7sO5SLKkOENaHzJwwfT5gH%2F4OJUrt1EYze8xmQ3SCG7QdQXAkfG3jwBlgGYHX1%2BQLFaFeI )
159159
160160### Drawing sprites
161161
@@ -168,7 +168,7 @@ litecanvas({
168168// each visible char is a pixel
169169// numbers are colors
170170// dots are transparent pixels
171- let smile = `
171+ let smile8x8 = `
172172 .555555.
173173 55555555
174174 55055055
@@ -182,9 +182,9 @@ function draw() {
182182 cls (0 )
183183
184184 spr (
185- 0 , 0 , // position X Y
186- 8 , 8 , // sprite Width and Height
187- smile // the pixels
185+ 0 , 0 , // position X Y
186+ 8 , 8 , // the sprite Width and Height
187+ smile8x8 // the sprite Pixels
188188 )
189189}
190190```
@@ -214,9 +214,9 @@ function draw() {
214214
215215 // draw the japanFlag image
216216 image (
217- W / 2 - japan .width / 2 , // game screen center X
218- H / 2 - japan .height / 2 , // game screen center Y
219- japanFlag // the image
217+ W / 2 - japanFlag .width / 2 , // game screen center X
218+ H / 2 - japanFlag .height / 2 , // game screen center Y
219+ japanFlag // the image
220220 )
221221}
222222```
@@ -272,8 +272,6 @@ function update() {
272272
273273 // Returns the last key pressed in your keyboard.
274274 let key = lastkey ()
275-
276- console .log (key)
277275}
278276```
279277
0 commit comments