Created
September 20, 2021 17:49
-
-
Save skymonsters-Ks/1999e6db259bd2dd04824262f5a00919 to your computer and use it in GitHub Desktop.
viewcalcで画面を揺らす
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
#include "hsp3dish.as" | |
wx = 854 | |
wy = 480 | |
screen 0, wx, wy | |
es_ini | |
buffer 1 | |
picload dir_tv + "ball64.png" | |
es_size 64, 64 | |
es_pat 0, 0, 0 | |
gsel 0 | |
es_area 0, 0, wx - 64, wy - 64 | |
repeat 20 | |
es_set cnt, rnd(wx) - 64, rnd(wy) - 64, 0 | |
es_adir cnt, rnd(64), 500 | |
es_flag cnt, ESSPFLAG_XBOUNCE + ESSPFLAG_YBOUNCE + ESSPFLAG_MOVE | |
loop | |
font "arial", 40, 19 | |
*mainLoop | |
redraw 0 | |
stick key | |
if key & 16 : shake = 30 : ang = 0.01 * rnd(628) | |
if shake > 0 { | |
viewcalc vptype_translate, cos(ang) * shake, sin(ang) * shake | |
viewcalc vptype_2d, 1, 1 | |
shake-- | |
ang += M_PI / 2 + 0.01 * rnd(314) | |
} else { | |
viewcalc vptype_off | |
} | |
color : boxf | |
rgbcolor $8080ff | |
line wx, wy, 0, 0 | |
es_draw | |
pos wx / 2 - 200, wy / 2 - 20 | |
rgbcolor $ffffff | |
mes "SPACE key de SHAKE! " + shake | |
redraw 1 | |
await 16 | |
goto *mainLoop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://twitter.com/skymonsters_Ks/status/1440012457485877257