A couple Atari Basic programming examples.
The second design is created by having a constant offset, and repeatedly adding it to the X and Y axes. I explain how it's done below.
Lines 25 and 27 create a right border for the design.
On the Atari the X axis runs across the top of the screen from left to right. The Y axis goes from the top to the bottom of the screen.
Line 30 sets up a loop for a variable "I" that increments it (adds to it) by 5 rather than by 1.
A loop in Basic is a construct (a way of working) where a variable starts with an initial value (in this case 0). Then a set of "bracketed" instructions is executed (another way of explaining it is it's a set of instructions that are designated to be run repeatedly). These instructions may or may not use the loop variable. Then an additive offset is applied to the loop variable (in this case what happens to I is "Take the value of I, whatever it is, and add 5 to it"). Then the same set of designated instructions is executed again. This repeats until the end value for the loop variable is reached. In this case the end value is 135.
Lines 40 and 50 create the left side of the design, beginning each line on the left side (the X-coordinate=0 (and stays constant), the Y-coordinate uses the loop variable, which increases by 5 as it goes) and drawing a straight line to the bottom of it (where the X-coordinate uses the loop variable, which increases by 5 as it goes, and the Y-coordinate=135 (and stays constant)).
So on the left side it goes:
plot 0,0:drawto 0,135
plot 0,5:drawto 5,135
plot 0,10:drawto 10,135
etc.
Line 60 changes the tone of the sound you hear as the loop progresses.
Lines 70 and 80 do the same design along the right side by beginning each line on the top (where the X-coordinate uses the loop variable, which increases by 5 as it goes, and the Y-coordinate=0 (stays constant)) and drawing a straight line to the right side of it (where the X-coordinate=135 (stays constant), and the Y-coordinate uses the loop variable, which increases by 5 as it goes).
So on the right side it goes:
plot 0,0:drawto 135,0
plot 0,5:drawto 135,5
plot 0,10:drawto 135,10
etc.
Line 90 "brackets" the instructions in the for-loop.
Line 100 turns the sound off.
The cool thing is what gets created in the middle! Kind of looks like an "eye", doesn't it?
From what I understand there's some cool math concepts going on here which probably have something to do with calculus (tangents on a curve), but I'm embarrassed to say that I wouldn't really know how to explain it at this point. This is just a computer form of something we used to do by hand on graph paper for extra credit when I was in 5th grade. In fact we did it often enough that our teacher eventually said, "Alright! No more extra credit!" It was getting too easy.
Sadly its easier to write graphics and sound programs this way than to do it in a C++ environment. In the case of sound you don't get to do tones off the bat. only wav files. Graphics is doable but slow with what i was using anyways. DirectX is a nightmare.
NiTRoGLLYCERiN 1 week ago
@NiTRoGLLYCERiN
I've had experience with both (more advanced) console graphics and windowed graphics env's. I think what you're complaining about may be more due to the windowed env., because the app. model you're given makes it complicated. I wrote some 3D wireframe graphics in a console env. in C many years ago, and it wasn't that bad. It was almost as straightforward as this.
Too bad about DirectX. I thought they had improved it a lot with Ver. 9 & 10. Maybe just in .Net though.
mmille10 1 week ago
@NiTRoGLLYCERiN
As for the sound, yeah. The old Atari had a synthesizer chip, so it could generate its own tones. Computers like the C-64 and the TI-99/4A had this setup as well. On Windows the sound hardware is just a DAC. You can model sound waves in software. I've seen apps. that do it. They just feed digital data to the hardware to generate tones, emulating what a synthesizer chip would do.
mmille10 1 week ago
I no longer own a computer which I can program myself (I used to have a Sinclair Spectrum). Other than actually buying an old computer, is there any where on the net that I can program in Basic, just for fun? I'd really like to get back into it again. Great video btw.
CelticReject 10 months ago
@CelticReject
BTW, if you want to get nostalgic, there are 8-bit emulators available for Windows, Mac, and Linux that you can download and install for free. They just run as regular apps. on your OS. You could probably find a Spectrum emulator if you wanted one. :) I used an emulator to create this video. Glad you liked it.
mmille10 10 months ago
@mmille10 For the Spectrum, Spectaculator (10 on a 1-10 scale) is the best but it's shareware/1 month trial. (I bought it/$30). Nearly as good are ZXSpin & EmuZwin (9 & 8 respectively) followed by several dozen more assorted Spec Emus of varying quality. Emulators are awesome aren't they? BTW mmille10, are you using Atari800Win+? If so, ever try/use the Kaillera netpla option? I'm looking for people to play Atari 8-bit online but I can't find anybody. Let me know if you're interested?
gjc82071 7 months ago
@gjc82071
Yes, I was using Atari800WinPlus here. In my version there was a built-in option, as I recall, for playing multiplayer, emulating people plugged into the joystick ports. I never tried it. I don't think I'd be that interested in trying it now. I've used emulators mainly for reminiscing, not for regular use.
mmille10 7 months ago