EasyManua.ls Logo

Radio Shack TRS-80 - Page 117

Radio Shack TRS-80
236 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
10
INPUT
"VERTICAL
ADDRESS
C0
TO
47) "jY
20
INPUT
"STEP SIZE"
;S
30 CLS
40
FOR
X
=
TO
127 STEP S
50
SET
(X,Y)
60
NEXT
X
99
GOTO
99
RUN this program
with
various values of S. Note
that
as you increase
S,
the line is drawn
much faster
(since the
Computer has less work to do). In fact, for
S=10
or
more, you
can
hardly see
the line being drawn. This is
how
a TV picture is created
since it too is drawn
one
unit at
a
time (but so fast you
don't
notice the "drawing time").
Change
the program as
follows
:
55
RESET
(X.Y-1
)
70 Y
= Y+l
80
GOTO
40
If
S is
small, you can see the
lines
being formed and cleared. But
if
S
is fairly
large
(try
10),
the line
seems
to move in
somewhat
"old-time movie" fashion.
This is
the way the illusion
of motion
is created
on a TV
set and in some of
the popular
video games.
Now
try
this next program (clear out
the
old
one).
It
paints a dot on the screen
and moves
it
up and
down.
10
INPUT
"HORIZONTAL STARTING
POINT
(0
TO
127)";X
20
INPUT
"VERTICAL STARTING
POINT
(0
TO 47)
";Y
30 CLS
40
RESET
(X.Y-1
1
50
SET (X,Y)
H
115

Other manuals for Radio Shack TRS-80

Related product manuals