Nevermind, I figured out how to use pfvline and even how I set the speed. Now, I have another question that is related too pfvline.
How would I go about if I wanted a hole too appear at a random spot on the line?
I'm using this for my horizontal scrolling:
dim rand16 = z pfvline 0 0 10 on pfvline 31 4 8 off pfvline 8 2 4 flip main
u=u+1 if u=15 then u=1
if u=1 then pfscroll left if playfieldpos <> 8 then goto __Skip_Draw temp5 = rand : temp6 = rand/2 if temp5 > temp6 then var44 = 0 : var45 = 0 : var46 = 0 : var47 = 0 : goto __Skip_Draw var44 = rand : var45 = rand : var46 = rand : var47 = rand __Skip_Draw
draw_loop goto main
Entire game source:
rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288
set smartbranching on
player0x = 30
player0y = 50
player1x=135
player1y=50
scorecolor = $68
ballx = 200
bally = 200
dim rand16 = z
pfvline 0 0 10 on
pfvline 31 4 8 off
pfvline 8 2 4 flip
main
COLUP0 = $2E
COLUP1 = $3A
COLUPF = $0A
dim _P0_L_R = player0x.a
dim _P0_U_D = player0y.b
dim _P1_L_R = player1x.c
dim _P1_U_D = player1y.d
g=g
u=u+1
if u=15 then u=1
f=f+1
rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME...
if f = 10 then player0:
%00100100
%00100100
%00100100
%00100100
%00100100
%00011000
%00011000
%00011000
%00011000
%00011000
%00011110
%00000011
%00011000
%00011000
%00011100
%00011000
end
if f = 20 then player0:
%01000010
%01000010
%01000010
%00100100
%00100100
%00011000
%00011000
%00011000
%00011000
%00011000
%00011110
%00000011
%00011000
%00011000
%00011100
%00011000
end
if f=20 then f=0
h=h+1
rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME...
if h = 10 then player1:
%00100100
%00100100
%00100100
%00100100
%00100100
%00011000
%00011000
%00011000
%00011110
%00011000
%00011111
%00000000
%00011000
%00011000
%00011000
%00011000
end
if h = 20 then player1:
%01000010
%01000010
%01000010
%00100100
%00100100
%00011000
%00011000
%00011000
%00011110
%00011000
%00011111
%00000000
%00011000
%00011000
%00011000
%00011000
end
if h=20 then h=0
if u=1 then pfscroll left
if playfieldpos <> 8 then goto __Skip_Draw
temp5 = rand : temp6 = rand/2
if temp5 > temp6 then var44 = 0 : var45 = 0 : var46 = 0 : var47 = 0 : goto __Skip_Draw
var44 = rand : var45 = rand : var46 = rand : var47 = rand
__Skip_Draw
drawscreen
if k > 0 then AUDV0 = 8 : AUDC0 = 7 : AUDF0 = 30 : k = k - 1 : if k = 0 then AUDV0 = 0
if r > 0 then AUDV0 = 8 : AUDC0 = 8 : AUDF0 = 10 : r = r - 1 : if r = 0 then AUDV0 = 0
if joy0up then _P0_U_D = _P0_U_D - 1
if joy0down then _P0_U_D = _P0_U_D + 1
if collision(ball,player1) then player1y=rand:player1x=135 : score=score+10 : ballx=200 : bally=200 : r=10
if player1y < 25 then player1y=rand
if player1y > 80 then player1y=rand
_P1_L_R=_P1_L_R - 0.3 : REFP1 = 8
if ballx>135 then goto skip
ballx = ballx+2:goto draw_loop
skip
if joy0fire then k=10 : ballx = player0x+7:bally=player0y-12
draw_loop
goto main