Jump to content
IGNORED

bbc micro game help


Recommended Posts

10 print chr$(145);"bomb disposal"

20 let x= 4001

30 input x

40 if x=true then goto 60

50 if x=200 then goto 70

60 print "phew" (good end)

70 print "retry" (game over)

 

how do I save this program and expand it to allow sprites and graphics?

 

thanks in advance

 

by the way, are there any outside programs that allow poke commands?

Link to comment
Share on other sites

I don't know if you're using a taperecorder in that case it would be with:

SAVE"name"

Commands must be in capitals.

Most graphical stuff can be done with the VDU command, VDU 23 is (I assume) for making sprites.

Peek and poke as commands don't excist in BBC BASIC, more or less can be don with the question mark.

 

Greetings,

Theo

Link to comment
Share on other sites

A few days ago I compiled the Beebem emulator for this machine (Ubuntu) and I have an Acorn Electron for almost 33 years so I know a bit about BBC basic ;)

Due the fact that BBC basic has already has a built in assembler I guess PEEK and POKE instructions were unnecessary

If you don't mind I can put some example sprite etc in your listing, just to make an example?

Link to comment
Share on other sites

L.
10 MODE 2
20 REM SPRITE (VDU 23,REDEFCHARACTER,8 VALUES)
30 VDU 23,224,24,60,126,219,126,36,66,129
40 REM BLINKING COLOUR FOREGROUND
50 COLOUR 11
60 REM BACKGROUND COLOUR
70 COLOUR 128
80 CLS
90 REM PRINT THE SPRITES (224) BESIDES THE TEXT
100 PRINT CHR$(224); " Bomb disposal "; CHR$(224)
110 REM SET FOREGROUNDCOLOUR BACK TO WHITE
120 COLOUR 7
130 PRINT:PRINT
140 INPUT "Which number"; X
150 IF X=10 THEN 160 ELSE GOTO 180
160 PRINT:PRINT"Phew"
170 GOTO 190
180 PRINT:PRINT"Retry"
190 END
>

 

In line 30 is the sprite, with VDU 23 you can redefine characters (in this case 224). the values after that are from an 8 x 8 grid.

From left to right the values are : 128,64,32,16,8,4,2,1

 

000XX000 = 24

00XXXX00 = 60

0XXXXXX0 = 126

XX0XX0XX = 219

0XXXXXX0 = 126

00X00X00 = 36

0X0000X0 = 66

X000000X= 129

 

It isn't that difficult I believe.

The colours are random picks and there are lists which colours are possible in the different modes.

Good luck!

Link to comment
Share on other sites

10 print chr$(145);"bomb disposal"

20 let x= 4001

30 input x

40 if x=true then goto 60

50 if x=200 then goto 70

60 print "phew" (good end)

70 print "retry" (game over)

I know this is just an illustratrion but as a programmer must point out that this if .. then sequence is seriously flawed :)))))))))))

  • Like 1
Link to comment
Share on other sites

darn. hey, while we're on the subject, should i buy a commodore vic 20 or an atari 800?

 

Nothing against the VIC 20, but it's an upgraded PET in a small case. The 800 is better.

And about Beebem, I'm using the linux version without any troubles.

Link to comment
Share on other sites

The Atari 800 also cost about twice - or more - of what a VIC-20 cost. So yes, you got a lot more computer for your money but you also invested a lot more money to get a computer in the first place. Pick any two different cars from different price segments if you want. Both will hopefully take you from point A to point B, but your ride might be very different depending on which car you drive.

Link to comment
Share on other sites

@carisson you're right, the VIC-20 is a fine machine for it's money but it's in a different league than the 800. And some ports of games are really great (or maybe the best) on the VIC-20. Gridrunner 1 & 2 (Matrix) from Jeff Minter for example.

 

@2600 perhaps an advice, download a couple of (good) emulators and try it yourself. Both are fine machines, but different in capabilities and prices. What suits you the best is a personal thing.

Link to comment
Share on other sites

Atari 400 to Vic 20 is the fair comparison. And even then the 400 shits all over it. The Vic-20 is in many ways less powerful than a 2600 (no hardware sprites), but at least it had 3.5k of RAM and a nice 22 column text mode.

Link to comment
Share on other sites

PRINT PEEK(X) where X is a positive integer between 0 and 65535. On some systems you need to use the range -32768 to +32767 instead.

 

The Atari 400 still cost 50% more than the VIC-20 in mid-83 before the 400 got discontinued in favor of the XL series. As a customer, I would get disappointed if paying 50% more didn't get me 50% more computing power, which can be argued if the unexpanded 400 offers.

Link to comment
Share on other sites

There is no PEEK or POKE on the BBC, it's done differently, using Indirect Operators.

 

Use ? for byte, ! for word, $ for strings. & can be used to convert to hex.

 

e.g.

?16384 = 255

equivalent to POKE 16384,255

 

D=?16384

equivalent to D=PEEK(16384)

 

?&4000=&F0

eq to POKE 16384,240

 

PRINT ?&4000

if done after should return 240

 

$&4000="ABCDEF"

will store the string starting at that address, followed by CR ($0D). Unsure if the Return character can be omitted.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...