Last active
August 29, 2015 14:01
-
-
Save st98/158918921f8ed11027e6 to your computer and use it in GitHub Desktop.
何となく HSP を書きたくなったので。筆先が回転するお絵描きツール。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*init | |
screen 0, 256, 256 | |
title "お絵かけない" | |
angle = 0 | |
pressed = 0 | |
px = 0 | |
py = 0 | |
color 53, 122, 48 | |
boxf | |
*main | |
repeat | |
redraw 0 | |
stick k, 768 | |
if k { | |
if k & 256 { | |
color 255, 255, 255 | |
} else : if k & 512 { | |
color 255, 144, 144 | |
} | |
x = mousex + 25.0 * sin(double(angle) * M_PI / 180) | |
y = mousey + 25.0 * cos(double(angle) * M_PI / 180) | |
if pressed { | |
line px, py, x, y | |
} else { | |
pset x, y | |
} | |
pressed = 1 | |
px = x | |
py = y | |
} else { | |
pressed = 0 | |
} | |
angle = (angle + 25) \ 36 | |
redraw 1 | |
await 17 | |
loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
27 行目を
x = mousex
に、28 行目をy = mousey
に書き換えると普通のお絵描きツールになります。