EasyManua.ls Logo

Commodore 128D - Page 259

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...
COLLISION
—Define
handling
for
sprite
collision
interrupt
COLLISION
type
^statement]
type.
statement
.Type
of
interrupt,
as
follows:
1
=
Sprite-to-sprite
collision
2
=
Sprite-to-display
data
collision
3
=
Light
pen
(40
column
screen
only)
.BASIC
line
number
of
a
subroutine
When
the
specified
situatioh
occurs,
BASIC
will
finish
processing
the
currently
executing
instruction
and
perform
a
GOSUB
to
the
line
number
given.
When
the
subroutine
terminates
(it
must
end
with
a
RETURN),
BASIC
will
resume
processing
where
it
left
off.
Interrupt
action
continues
until
a
COLLISION
of
the
same
type
without
a
line
number
is
specified.
More
than
one
type
of
interrupt
may
be
enabled
at
the
same
time,
but
only
one
interrupt
can
be
handled
at
a
time
(i.e.,
there
can
be
no
recursion
and
no
nesting
of
interrupts).
The
cause
of
an
interrupt
may
continue
causing
interrupts
for
some
time
unless
the
situation
is
altered
or
the
interrupt
disabled.
When
a
sprite
is
completely
off-screen
and
not
visible,
it
cannot
gen
erate
an
interrupt.
To
determine
which
sprites
have
collided
since
the
last
check,
use
the
BUMP
function.
EXAMPLE:
COLLISION
1,
5000
COLLISION
1
COLLISION
2,1000
Detects
a
sprite-to-sprite
collision
and
program
control
sent
to
subroutine
at
line
5000.
Stops
interrupt
action
which
was
initiated
in
above
example.
Detects
sprite-to-dal?
collision
and
program
control
directed
to
subroutine
in
line
1000.
251
BASIC
7.0
ENCYCLOPEDIA—Basic
Commands
and
Statements

Table of Contents

Other manuals for Commodore 128D

Related product manuals