home *** CD-ROM | disk | FTP | other *** search
File List | 1979-12-31 | 1.3 KB | 65 lines |
- ' Bewegtes Linienfeld
- ' Demonstration mit GfA Basic
- Option Base 0 !Felder beginnen mit 0
- Maxlines%=20
- Maxlines_1%=19
- Maxdrawlines%=100
- Dim Ball%(3),Vel%(3),Maxi%(3)
- Dim Linie%(Maxlines_1%,3)
- Resolution=2
- Max_x%=639
- Max_y%=399
- Min_x%=0
- Min_y%=0
- Maxi%(0)=Max_x%
- Maxi%(1)=Max_y%
- Maxi%(2)=Max_x%
- Maxi%(3)=Max_y%
- For I%=0 To 3
- Vel%(I%)=Random(16)-8
- Ball%(I%)=Random(Maxi%(I%)-100)+50
- Next I%
- Neu%=0
- Alt%=0
- Full!=False
- Cls
- Repeat
- For Index%=0 To Maxdrawlines%
- For I%=0 To 3
- T%=Ball%(I%)+Vel%(I%)
- If T%>=Maxi%(I%)
- T%=Maxi%(I%)*2-Ball%(I%)-Vel%(I%)
- Vel%(I%)=-Vel%(I%)
- Endif
- If (I% Mod 2)<>0
- Mini%=Min_y%
- Else
- Mini%=Min_x%
- Endif
- If T%<Mini%
- If T%<0
- T%=-T%
- Else
- T%=Mini%
- Endif
- Vel%(I%)=-Vel%(I%)
- Endif
- Ball%(I%)=T%
- Next I%
- If Full!
- Color 0
- Line Linie%(Alt%,0),Linie%(Alt%,1),Linie%(Alt%,2),Linie%(Alt%,3)
- Alt%=(Alt%+1) Mod Maxlines%
- Endif
- J%=(Neu% Mod Maxlines%)
- For K%=0 To 3
- Linie%(J%,K%)=Ball%(K%)
- Next K%
- Full!=Full! Or (Neu%=Maxlines%-1)
- Neu%=(Neu%+1) Mod Maxlines%
- Color 1
- Line Ball%(0),Ball%(1),Ball%(2),Ball%(3)
- Next Index%
- Until Mousek=3
- End