HSPやって重力を再現しようとしてたら謎プログラムができたよ!
皆さんやってみて!
皆さんやってみて!
#define GN 6.6743
#include "hsp3util.as"
#include "d3m.hsp"
ax = 40.0
ay = 0.0
as = atan(ax, ay)
g = 90.8
v0 = 20.0
vx = v0 * cos(as) + g * cos(as)
vy = v0 * sin(as) + g * sin(as)
mx = 320
my = 240
r = 1
r2 = 1
oldtime = d3timer()
mes oldtime
while 1
t = d3timer()
t = 0.001 * (t - oldtime)
as = atan(ax, ay)
vx = v0 * cos(as) - g * cos(as)
vy = v0 * sin(as) - g * sin(as)
s = cos(t * M_PI)
r = t*M_PI//v0 * sin(s) * t - g*t*t/2
ax = cos(s) * vx * r
ay = sin(s) * vy * r
line ax + mx, ay + my
wait 0
wend