Skip to content

Instantly share code, notes, and snippets.

@skymonsters-Ks
Last active March 31, 2019 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skymonsters-Ks/1155c82c30d8502ad5b31cddf09cee5d to your computer and use it in GitHub Desktop.
Save skymonsters-Ks/1155c82c30d8502ad5b31cddf09cee5d to your computer and use it in GitHub Desktop.
宇宙を進む
randomize
screenW = ginfo_sx
screenH = ginfo_sy
centerX = screenW / 2
centerY = screenH / 2
num = 200
ddim posx, num
ddim posy, num
ddim size, num
repeat num
new cnt
loop
*mainLoop
redraw 0
color
boxf
repeat num
; サイズ・座標の更新
size(cnt) *= 1.01
aj = size(cnt) / 500 ; 加速感・立体感の味付け
posx(cnt) *= 1.002 + aj
posy(cnt) *= 1.002 + aj
; 仮想座標からスクリーン座標に変換
x = posx(cnt) * centerX + centerX
y = posy(cnt) * centerY + centerY
if size(cnt) > 20 || x < 0 || x > screenW || y < 0 || y > screenH {
new cnt
}
hsvcolor 0, 0, limit(size(cnt) * 120, 0, 255)
if (size(cnt) < 2) {
pset x, y
} else {
grect x, y, 0, size(cnt), size(cnt)
}
loop
redraw 1
await 15
goto *mainLoop
#deffunc new int i
; -1 ~ 1 の仮想座標に設置
posx(i) = 0.001 * rnd(2000) - 1
posy(i) = 0.001 * rnd(2000) - 1
size(i) = 0.5
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment