This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
shapes-juke/sjscript/test/test01.sj

40 lines
908 B
Plaintext
Raw Permalink Normal View History

2019-10-04 00:00:00 +00:00
// this is comment
$define sinwave {
translate_x = $sinwave_add_x + sin(rtime * $sinwave_hz) * $sinwave_amp_x;
translate_y = $sinwave_add_y + cos(rtime * $sinwave_hz) * $sinwave_amp_y;
}
2019-10-04 00:00:00 +00:00
$define horming {
translate_x += cos(atan(player_y, player_x)) * $horming_speed;
translate_y += sin(atan(player_y, player_x)) * $horming_speed;
}
$define shoot {
__dir_x := cos(atan(player_y, player_x)) * $shoot_speed;
__dir_y := sin(atan(player_y, player_x)) * $shoot_speed;
2019-10-04 00:00:00 +00:00
translate_x += __dir_x;
translate_y += __dir_y;
2019-10-04 00:00:00 +00:00
}
$define beat {sin(PI/4)}
A [$beat..$beat+10] {
$define sinwave_add_x {0.5}
$define sinwave_add_y {0.5}
$define sinwave_amp_x {0.5}
$define sinwave_amp_y {0.5}
$define sinwave_hz {2}
$sinwave
}
$define beat {10}
B [$beat..$beat+10/2] {
2019-10-04 00:00:00 +00:00
$define horming_speed {0.1}
$horming
}
$define beat {20}
C [$beat..$beat+10/2] {
$define shoot_speed {0.1}
$shoot
}