Skip to content

Instantly share code, notes, and snippets.

@RKX1209
Created April 24, 2016 10:11
Show Gist options
  • Save RKX1209/b8af5956324a9e3ed5605200ddd0af51 to your computer and use it in GitHub Desktop.
Save RKX1209/b8af5956324a9e3ed5605200ddd0af51 to your computer and use it in GitHub Desktop.
let GetX = 0;
let GetY = 0;
let frame = 0;
let angleBase = 90;
let YELLOW01 = 1;
let WHITE01 = 10;
function script_enemy_main() {
let imgBoss = "script\img\ExRumia.png";
let frame = 0;
let res = frame * 3 + angleBase / 2;
return res;
}
function Initialize() {
}
function nway(dir, way, span, color) {
way = dir[++span];
dir[++span] = way;
while(dir[span] > 0) {
++span;
dir[span] -= dir[span - 1];
}
return;
}
function @MainLoop() {
++frame;
if(frame == 30) {
nway(angleBase, 3, 5, YELLOW01);
angleBase += 8;
}
else { }
if(frame == 60) {
nway(angleBase, 5, 3, WHITE01);
angleBase += 8;
frame = 0;
}
else { }
}
function @DrawLoop() {
}
function @Finalize() {
}
(DECL GetX 0)
(DECL GetY 0)
(DECL frame 0)
(DECL angleBase 90)
(DECL YELLOW01 1)
(DECL WHITE01 10)
(FUNC_DEF script_enemy_main PARAM
(BLOCK
(DECL imgBoss script\img\ExRumia.png)
(DECL frame 0)
(DECL res (+ (* frame 3) (/ angleBase 2))) (RETURN res)))
(FUNC_DEF Initialize PARAM BLOCK)
(FUNC_DEF nway
(PARAM dir way span color)
(BLOCK (ASSIGN way =
(AREF dir (++ span))) (ASSIGN
(AREF dir (++ span)) = way) (WHILE (>
(AREF dir span) 0)
(BLOCK (++ span) (ASSIGN
(AREF dir span) -=
(AREF dir (- span 1))))) RETURN))
(FUNC_DEF @MainLoop PARAM
(BLOCK (++ frame) (IF (== frame 30)
(BLOCK
(CALL nway angleBase 3 5 YELLOW01) (ASSIGN angleBase += 8)) BLOCK) (IF (== frame 60)
(BLOCK
(CALL nway angleBase 5 3 WHITE01) (ASSIGN angleBase += 8) (ASSIGN frame = 0)) BLOCK)))
(FUNC_DEF @DrawLoop PARAM BLOCK)
(FUNC_DEF @Finalize PARAM BLOCK)
Semantics: complete
r0 = 0
GetX=r0
r1 = 0
GetY=r1
r2 = 0
frame=r2
r3 = 90
angleBase=r3
r4 = 1
YELLOW01=r4
r5 = 10
WHITE01=r5
r6 = script\img\ExRumia.png
imgBoss=r6
r7 = 0
frame=r7
r8 = 3
r9 = frame * r8
r10 = 2
r11 = angleBase / r10
r12 = r9 + r11
res=r12
r13 = ++span
r14 = r13 * 4
way = dir [ r14 ]
r15 = ++span
r16 = r15 * 4
dir [ r16 ] = way
label0:
r17 = span * 4
r18 = 0
if r17 > r18 goto label1
goto label2
label1:
r19 = ++span
r20 = span * 4
r21 = 1
r22 = span - r21
r23 = r22 * 4
dir [ r20 ] -= r23
goto label0
label2:
r24 = ++frame
r25 = 30
if frame == r25 goto label3
goto label4
label3:
r28 = 8
angleBase += r28
goto label5
label4:
r28 = 8
angleBase += r28
label5:
r29 = 60
if frame == r29 goto label6
goto label7
label6:
r32 = 8
angleBase += r32
r33 = 0
frame = r33
goto label8
label7:
r32 = 8
angleBase += r32
r33 = 0
frame = r33
label8:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment