Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
42
Task/Animation/Wren/animation.wren
Normal file
42
Task/Animation/Wren/animation.wren
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import "graphics" for Canvas, Color
|
||||
import "dome" for Window
|
||||
import "input" for Mouse
|
||||
|
||||
var RIGHT = true
|
||||
|
||||
class Animation {
|
||||
construct new() {
|
||||
Window.title = "Animation"
|
||||
_fore = Color.white
|
||||
}
|
||||
|
||||
init() {
|
||||
_text = "Hello World! "
|
||||
_frame = 0
|
||||
Canvas.print(_text, 10, 10, _fore)
|
||||
}
|
||||
|
||||
update() {
|
||||
_frame = _frame + 1
|
||||
if (_frame == 1200) _frame = 0
|
||||
if (!Mouse.hidden && Mouse.isButtonPressed("left")) {
|
||||
Mouse.hidden = true
|
||||
RIGHT = !RIGHT
|
||||
}
|
||||
if (_frame % 60 == 0) {
|
||||
if (RIGHT) {
|
||||
_text = _text[-1] + _text[0..-2]
|
||||
} else {
|
||||
_text = _text[1..-1] + _text[0]
|
||||
}
|
||||
Mouse.hidden = false
|
||||
}
|
||||
}
|
||||
|
||||
draw(alpha) {
|
||||
Canvas.cls()
|
||||
Canvas.print(_text, 10, 10, _fore)
|
||||
}
|
||||
}
|
||||
|
||||
var Game = Animation.new()
|
||||
Loading…
Add table
Add a link
Reference in a new issue