I have a couple of questions/suggestions. Since
pfscroll up takes care of the scrolling, seems like you wouldn't need this in your main loop:
pfpixel g j on : pfpixel h k on
You could put it at the end of
get_rock2x instead so it would only be used when needed. I tried it and it works fine.
Speaking of that rock section of code, here's what you have now:
get_rock1x
w=0
z{0}=0
j=11
g=rand
if g<1 then goto get_rock1x
if g>24 then goto get_rock1x
if g<11 then goto g_0
if g>10 then goto g_1
if g>20 then goto g_2
g_0
if g=1 then l=20
if g=2 then l=24
if g=3 then l=28
if g=4 then l=32
if g=5 then l=36
if g=6 then l=40
if g=7 then l=44
if g=8 then l=48
if g=9 then l=52
if g=10 then l=56
goto get_rock2x
g_1
if g=11 then l=60
if g=12 then l=64
if g=13 then l=68
if g=14 then l=72
if g=15 then l=76
if g=16 then l=80
if g=17 then l=84
if g=18 then l=88
if g=19 then l=92
if g=20 then l=96
goto get_rock2x
g_2
if g=21 then l=100
if g=22 then l=104
if g=23 then l=108
if g=24 then l=112
get_rock2x
k=11
h=g+5
pfclear
m=l+20
pfpixel g j on : pfpixel h k on
goto main
Does that save more cycles than just doing this:
get_rock1x
w=0
z{0}=0
j=11
g=(rand&24)+1
if g=1 then l=20
if g=2 then l=24
if g=3 then l=28
if g=4 then l=32
if g=5 then l=36
if g=6 then l=40
if g=7 then l=44
if g=8 then l=48
if g=9 then l=52
if g=10 then l=56
if g=11 then l=60
if g=12 then l=64
if g=13 then l=68
if g=14 then l=72
if g=15 then l=76
if g=16 then l=80
if g=17 then l=84
if g=18 then l=88
if g=19 then l=92
if g=20 then l=96
if g=21 then l=100
if g=22 then l=104
if g=23 then l=108
if g=24 then l=112
k=11
h=g+5
pfclear
m=l+20
pfpixel g j on : pfpixel h k on
goto main
I'm still pretty new at this, so I don't know how many cycles are used for various things like if-then statements. Is it best to chop it up like you did? If it saves time, do you know how many if-then statements in a row is the limit before things start to slow down too much?
I think the following two if-then statements could be trimmed:
if a>b && q<7 then a=0 : q=q+1 : pfpixel g j off : pfpixel h k off : pfscroll up
if a>b && q=7 then q=0 : pfpixel g j off : pfpixel h k off : j=j-1 : k=k-1 : pfscroll up
Instead of that, I think you could just use this:
if a>b && q<7 then a=0 : q=q+1 : pfscroll up
if a>b && q=7 then q=0 : j=j-1 : k=k-1
I tried that and it seems to work without a problem. That
pfpixel stuff didn't seem to be necessary and the extra
pfscroll up didn't seem to be needed either.
Another thing I wandered is if you could test to see which side the guy is on and make sure the arrow comes from the opposite side. I've been on one side and had the arrow hit me without even a fraction of a second to react. If the arrow always comes from the opposite side, the player will have a chance to move.
That's all I have for now.
Thanks.