[vcf-midatlantic] Collision detection 101
ragooman at gmail.com
Sat Apr 8 11:28:14 EDT 2017
On Sat, Apr 8, 2017 at 12:36 AM, Evan Koblentz via vcf-midatlantic <
vcf-midatlantic at lists.vintagecomputerfederation.org> wrote:
> Get rid of the flicker
> When I reduced the redrawing speed (for-next delay) then the flicker
> lessens but the point movement is clunky vs. physical joystick movement.
> That's a reality of doing this in BASIC: I've got to keep looping for the
> joystick input and replotting the coordinates.
> If you know a trick around this then teach me, Obi-Dan.
I'm not sure what the latest code you have so far
I'm just going by this you posted a few days ago
20 PLOT 10,10
70 IF X>39 THEN X=39:IF Y>39 THEN Y=39
80 PLOT X,Y:PRINT INT(X),INT(Y)
90 FOR W=1 TO 50: NEXT W
100 COLOR=0:PLOT X,Y:COLOR=2
110 GOTO 30
In your code,
you continually refresh the screen by overwriting the "sprite" with another
even if you're at the same coordinates, which produces the flicker.
even though the computer has memory, doesn't mean the software knows how to
use it, you have to tell it.
The first method of creating memory is to use a variable, ie. "Remember
what I have"
And that's what every beginning programmer learns to use.
sometimes you need to have a sort of persistent memory, ie. "Remember what
So you need another level of variables to save the last move, eg, your last
And so you would compare the current coordinates to the previous
If they are equal, that means you didn't move and so you're sitting in the
then there is no need to refresh the screen, eg. don't jump to subroutine
and the flickering will stop
More information about the vcf-midatlantic