How to write games in BASIC
Forum rules
Post guides, tutorials, and other instructional content here.
This topic area requires approval, so please be patient while we review content to make sure it fits the expectations for this topic area.
Tech support questions should be asked in Hardware or Software support.
Post guides, tutorials, and other instructional content here.
This topic area requires approval, so please be patient while we review content to make sure it fits the expectations for this topic area.
Tech support questions should be asked in Hardware or Software support.
- DragonGaulois
- Posts: 16
- Joined: Mon Jan 31, 2022 4:13 pm
How to write games in BASIC
thank you for these tutorials ?
i like the graphics of the games, especially crazy boulders
- DusanStrakl
- Posts: 127
- Joined: Sun Apr 26, 2020 9:15 pm
- Location: Bay Area, California
- Contact:
How to write games in BASIC
On 11/13/2022 at 2:38 AM, DragonGaulois said:
thank you for these tutorials ?
i like the graphics of the games, especially crazy boulders
Thank you, I appreciate that. I draw all the graphics myself and typically it takes more time to design the game, make all the graphics than to write the code.
How to write games in BASIC
Hello.
From someone who tries to come back to 8 bit programming more than 30 years after his first lines of code : a great thank you !
PS : your ZX and Oric story reminds me of someone :);
Fred.
How to write games in BASIC
Hi !
As an X16 newbie, I tried to make your BASIC examples work for the r41.
Layer map now starts at: $1B000, so I found :
veradirect.bas :
10 POKE $9F25,0
20 POKE $9F20,0:POKE $9F21,$B0:POKE $9F22,$21
30 FOR N=1 TO 80:POKE $9F23,N:NEXT N
veraddirect2.bas :
10 POKE $9F25,0
20 POKE $9F20,0:POKE $9F21,$B0:POKE $9F22,$91
30 FOR N=1 TO 80:POKE $9F23,N:NEXT N
Hope it'll be useful for someone.
Thanks again !
Fred.
How to write games in BASIC
It looks like this program still has a bug: the second layr gets turned on, which causes some other problems.
On 1/3/2023 at 6:01 AM, 4094 said:
30 FOR N=1 TO 80:POKE $9F23,N:NEXT N
This is actually a problem... you have your auto-increment set for 256, so the program is writing a character on each line. The problem is that the frame buffer only has 60 lines, and you're writing 80 lines. This writes past the frame buffer into space that holds other data.
Here is a version that doesn't hammer VRAM past the frame buffer. It also shows 3 different ways of talking to VERA: the direct method, the VPOKE method, and the hybrid method.
The hybrid method takes advantage of VPOKE to set up the address registers, and then you can simply write to them directly with POKE after that to send more data to VERA. Of course, you still need to set the increment register, but this is a little more readable.
10 CLS:REM "DIRECT" POKE
20 POKE $9F25,0
30 POKE $9F20,0:POKE $9F21,$B0:POKE$9F22,$91
40 FOR N=1 TO 60:POKE $9F23,N:NEXT N
100 REM VPOKE EXAMPLE
110 P=$B010
120 VPOKE $1,P,0
130 FOR N=1 TO 60
140 VPOKE 1,P,N
150 P=P+$100
160 NEXT
210 REM HYBRID
220 VPOKE 1,$B020,0
230 POKE $9F22,$91 : REM SET AUTO-INCREMENT
240 FOR N=1 TO 60:POKE $9F23,N:NEXT N
How to write games in BASIC
Hi.
Stupid me probably copied the horizontal loop to build the vertical one ?.
Thx !
How to write games in BASIC
Just an idea. Maybe it would be possible to make multiple Basic interpretators run in parallel such that one program can handle game play, another graphics and a third sound etc? Separate variables etc and then exploit interrupts for pre-emptive multitasking?
How to write games in BASIC
When the CPU is running one process, it isn't running any of the others. Multitasking isn't really going to speed anything up. In fact, the contact switching is going to add overhead. And there will be contention for zero page and the stack, both of which are very limited resources.
Re: How to write games in BASIC
Am I missing something? I have no idea how to access any tutorials. Actually looks like the html is borked for some reason. Is it just me?
Re: How to write games in BASIC
Stuff written before Jan 10, 2023 is going to have some problems. We aren't able to fully convert HTML from the old forum software, because phpBB doesn't support arbitrary HTML in forum posts. Some things could be converted to BBCode tags, but things like YouTube embeds have to be re-done by hand.
If you see missing content, I encourage you to reach out to the original poster of the content, via the DM system, and ask if they can edit their posts and update links and/or embeds to work with BBCode.