Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
21
Task/Draw-a-pixel/Wren/draw-a-pixel.wren
Normal file
21
Task/Draw-a-pixel/Wren/draw-a-pixel.wren
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import "dome" for Window
|
||||
import "graphics" for Canvas, Color
|
||||
|
||||
class Game {
|
||||
static init() {
|
||||
Window.title = "Draw a pixel"
|
||||
Window.resize(320, 240)
|
||||
Canvas.resize(320, 240)
|
||||
var red = Color.rgb(255, 0, 0)
|
||||
Canvas.pset(100, 100, red)
|
||||
// check it worked
|
||||
var col = Canvas.pget(100, 100)
|
||||
System.print("The color of the pixel at (100, 100) is %(getRGB(col))")
|
||||
}
|
||||
|
||||
static update() {}
|
||||
|
||||
static draw(dt) {}
|
||||
|
||||
static getRGB(col) { "{%(col.r), %(col.g), %(col.b)}" }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue