My first try at BASIC collision detection: "find the kitten". https://drive.google.com/open?id=0B5thK4McllfJOWVMQy1HWDItM1E Next I'll experiment with making the hidden spot random. Problem is it'll be a PITA to test! :) (Just kidding. I will print its coordinates so I know it's working. Hide them in the real version and make it more than just a point so it's not too difficult.) ________________________________ Evan Koblentz, director Vintage Computer Federation a 501(c)(3) educational non-profit evan@vcfed.org (646) 546-9999 www.vcfed.org facebook.com/vcfederation twitter.com/vcfederation instagram.com/vcfederation
On Apr 7, 2017 8:44 AM, "Evan Koblentz via vcf-midatlantic" < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
My first try at BASIC collision detection: "find the kitten".
https://drive.google.com/open?id=0B5thK4McllfJOWVMQy1HWDItM1E
Next I'll experiment with making the hidden spot random. Problem is it'll
be a PITA to test! :) (Just kidding. I will print its coordinates so I know it's working. Hide them in the real version and make it more than just a point so it's not too difficult.)
Get rid of the flicker
Get rid of the flicker
How? 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. ________________________________ Evan Koblentz, director Vintage Computer Federation a 501(c)(3) educational non-profit evan@vcfed.org (646) 546-9999 www.vcfed.org facebook.com/vcfederation twitter.com/vcfederation instagram.com/vcfederation
On Sat, Apr 8, 2017 at 12:36 AM, Evan Koblentz via vcf-midatlantic < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
Get rid of the flicker
How?
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 10 GR:COLOR=2 20 PLOT 10,10 30 X=PDL(0):Y=PDL(1) 40 X=X/6.4:Y=Y/6.4 50 X=X+0.5:Y=Y+0.5 60 X=INT(X):Y=INT(Y) 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 one, even if you're at the same coordinates, which produces the flicker. Basically, 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. But, sometimes you need to have a sort of persistent memory, ie. "Remember what I did" So you need another level of variables to save the last move, eg, your last X,Y coordinates And so you would compare the current coordinates to the previous coordinates, If they are equal, that means you didn't move and so you're sitting in the same spot, then there is no need to refresh the screen, eg. don't jump to subroutine 'Refresh' <hint> and the flickering will stop Dan
In your code, you continually refresh the screen by overwriting the "sprite" with another one, even if you're at the same coordinates, which produces the flicker. ... So you need another level of variables to save the last move, eg, your last X,Y coordinates ... And so you would compare the current coordinates to the previous coordinates, If they are equal, that means you didn't move and so you're sitting in the same spot, then there is no need to refresh the screen, eg. don't jump to subroutine 'Refresh' <hint> and the flickering will stop
Okay that's kind of what I figured. Apparently I've been using (gasp) applied knowledge :) and starting to understand what all these problems have in common... sounds easy to implement this fix in just a line or to before I make the plot. Will try it tonight. Thanks!
On Sat, Apr 8, 2017 at 11:39 AM, Evan Koblentz via vcf-midatlantic < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
Okay that's kind of what I figured. Apparently I've been using (gasp) applied knowledge :) and starting to understand what all these problems have in common... sounds easy to implement this fix in just a line or to before I make the plot. Will try it tonight. Thanks!
is it just me, or did Evan's post arrive late I saw this happen before and ignored it But it always happens with his posts now It just arrived a couple minutes ago, but it says he wrote it 6hrs ago
It might be possible to convince me to write your detect code in assembly.
On Apr 8, 2017, at 12:28 AM, Dan Roganti via vcf-midatlantic <vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
On Apr 7, 2017 8:44 AM, "Evan Koblentz via vcf-midatlantic" < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
My first try at BASIC collision detection: "find the kitten".
https://drive.google.com/open?id=0B5thK4McllfJOWVMQy1HWDItM1E
Next I'll experiment with making the hidden spot random. Problem is it'll
be a PITA to test! :) (Just kidding. I will print its coordinates so I know it's working. Hide them in the real version and make it more than just a point so it's not too difficult.)
Get rid of the flicker
It might be possible to convince me to write your detect code in assembly.
Thanks for offering, but no. The final game code will be on a big poster in our museum. I've got to be able to explain it for kids (and non-technical adults) and they've got to be able to understand. Thus all BASIC.
Gotcha.
On Apr 8, 2017, at 11:34 AM, Evan Koblentz via vcf-midatlantic <vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
It might be possible to convince me to write your detect code in assembly.
Thanks for offering, but no. The final game code will be on a big poster in our museum. I've got to be able to explain it for kids (and non-technical adults) and they've got to be able to understand. Thus all BASIC.
Dan showed me how to change my program to not flicker (constantly redraw the joystick plot) by having it always check the state of where it just was before plotting. Now the plot moves around the screen and looks MUCH better.
Dan showed me how to change my program to not flicker (constantly redraw the joystick plot) by having it always check the state of where it just was before plotting.
Now the plot moves around the screen and looks MUCH better.
If anyone's still reading ... I also changed the target point to white so it is easier to see/differentiate vs. the joystick point, and I added a line that re-generates the "random" number is R=19 or 20 because one time I played and it automatically jumped the "you won" screen ... I realized if the number is 19 or 20 then it could conflict with the default centered status of the joystick and you don't get the chance to play. So, this stage of the game is mostly finished. Next I have to work on making the sprite (robot status indicator) into something more than just a single point. Dan gave me some tips for that. Then I'll add more obstacles. Some of them will cost you points. Some of them will give you points. One of them finds the kitten... The hardest part -- maybe easy on paper, not so much in reality -- will be merging in the Lego robot code. and figuring out how much real-life robot movement to equate to on-screen sprite movement. ________________________________ Evan Koblentz, director Vintage Computer Federation a 501(c)(3) educational non-profit evan@vcfed.org (646) 546-9999 www.vcfed.org facebook.com/vcfederation twitter.com/vcfederation instagram.com/vcfederation
Did the extra code slow the program down much? On Apr 9, 2017, at 12:03 AM, Evan Koblentz via vcf-midatlantic <vcf-midatlantic@lists.vintagecomputerfederation.org> wrote: Dan showed me how to change my program to not flicker (constantly redraw the joystick plot) by having it always check the state of where it just was before plotting. Now the plot moves around the screen and looks MUCH better.
On Sun, Apr 9, 2017 at 3:54 PM, chrisjpf33--- via vcf-midatlantic < vcf-midatlantic@lists.vintagecomputerfederation.org> wrote:
Did the extra code slow the program down much?
I guess Evan can chime in here for this But from what I heard, the extra time from the couple lines of code that I added to this was still negligible Dan
participants (4)
-
chrisjpf33@gmail.com -
Dan Roganti -
David Hoelzer -
Evan Koblentz