EasyManua.ls Logo

Commodore 128D - Page 324

Commodore 128D
427 pages
Print Icon
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...
BUMP
CHR$
COS
—Return
sprite
collision
information
BUMP(N)
To
determine
which
sprites
have
collided
since
the
last
check,
use
the
BUMP
function.
BUMP(1)
records
which
sprites
have
collided
with
each
other
and
BUMP(2)
records
which
sprites
have
collided
with
other
objects
on
the
screen.
COLLISION
need
not
be
active
to
use
BUMP.
The
bit
positions
(0-7)
in
the
BUMP
value
correspond
to
sprites
1
through
8
respectively.
BUMP(n)
is
reset
to
zero
after
each
call.
The
value
returned
by
BUMP
is
the
result
of
two
raised
to
the
power
of
the
bit
position.
For
example,
if
BUMP
returned
a
value
of
16,
sprite
5
was
involved
in
a
collision
since
2
raised
to
the
power
of
4
(bit
position)
equals
16.
Here's
how
the
sprite
numbers
and
BUMP
values
returned
correspond:
BUMP
Value:
128
Bit
Position:
7
Sprite
Number:
8
64
6
7
32
5
6
16
4
5
8
3
4
4
2
3
2
1
2
1
0
1
EXAMPLES:
PRINT
BUMP
(1)
12
Indicates
that
sprite
3
and
4
have
collided.
PRINT
BUMP
(2)
32
Indicates
that
sprite
6
has
collided
with
an
object
on
the
screen.
—Return
character
for
specified
CBM
ASCII
code
CHR$(X)
This
is
the
opposite
of
ASC
and
returns
the
string
character
whose
CBM
ASCII
code
is
X.
Refer
to
Appendix
E
for
a
table
of
CHR$
codes.
EXAMPLES:
PRINT
CHR$
(65)
Prints
the
A
character.
A
PRINT
CHR$
(147)
Clears
the
text
screen.
—Return
cosine
for
angle
of
X
radians
COS(X)
This
function
returns
the
value
of
the
cosine
of X,
where
X
is
an
angle
measured
in
radians.
EXAMPLE:
PRINT
COS
(tt/3)
.5
i
I
S
i
r
i
u
u
LJ
U
U
316
BASIC
7.0
ENCYCLOPEDIA—Basic
Functions

Table of Contents

Other manuals for Commodore 128D

Related product manuals