Page 2 of 3

How to write games in BASIC

Posted: Sun Nov 13, 2022 10:38 am
by DragonGaulois

thank you for these tutorials ?

i like the graphics of the games, especially crazy boulders


How to write games in BASIC

Posted: Sat Nov 19, 2022 7:38 pm
by DusanStrakl


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

Posted: Mon Jan 02, 2023 3:45 pm
by 4094

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

Posted: Tue Jan 03, 2023 2:01 pm
by 4094

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

Posted: Tue Jan 03, 2023 10:05 pm
by TomXP411

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

Posted: Tue Jan 03, 2023 11:05 pm
by 4094

Hi.

Stupid me probably copied the horizontal loop to build the vertical one ?.

Thx !


How to write games in BASIC

Posted: Thu Jan 05, 2023 12:07 am
by neutrino

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

Posted: Thu Jan 05, 2023 3:56 am
by kelli217

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

Posted: Tue Feb 21, 2023 7:16 pm
by Uhfgood
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

Posted: Tue Feb 21, 2023 7:31 pm
by TomXP411
Uhfgood wrote: Tue Feb 21, 2023 7:16 pm 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?
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.