1st color computer game: awari (updated with software attached)
coco2 color computer programming
few days ago I commented on re-evaluating the Color Computer and
how I now appreciate the simplicity of it's design.
Well, I wrote my 1st program for it: Awari.
I originally wrote Awari for the TI-99 (see post in TI-99 IUG).
When I found the IUG files on the TI99 archive I pulled out the
games I thought where mine, one being Awari. (oddly I found that
the game had had a bug all these years and never worked right.
I have fixed it.)
Awari was a game I originally typed in from David Ahl's book
of computer games. I later modified it for TI99 for graphics
then submitted to the TI IUG.
I have also recreated it in Atari Microsoft BASIC (a future post).
As I said, this is my 1st game on the CoCo2. Here are some thoughts
on programming the CoCo.
1st, the version of BASIC I used was the CoCo2 extended disk BASIC.
Extended disk BASIC is a full featured Microsoft BASIC. All the
commands you would expect which made the translation from
Atari Microsoft BASIC (I had just translated from TI-XB) was
straight forward with little translation.
The only real translation was in the print at commands which
where both unique to each system (and the TI99 as well).
In Atari Microsoft BASIC to print to a location on the screen
you type 'Print at(x,y)"text"'
TI-99 XB it's 'Display at(y,x):"text"' (notice the reversed way
TI99 places things on the screen. Everyone else uses x,y; the
TI99 use row,column or y,x!)
The Coco positions out the screen for it's print at starting
with top left being position 0 and bottom right being position
511, a little bit unconventional.
To make the conversion from the Atari MSB a little easier I
wrote a function to translate the x,y coordinates to the
DEF FN Y(A)=X+(A*32)
Then at the line: X=(x coor) : ? @(FN Y(y coor)),"text" , easy!
Now one limiting thing about coco text is that you can not
redefine the character set. The character set is all upper
case and inverse upper case of dark green on green that's it
so live with it!
(later models did have lower case but they were limited).
On this program that wasn't so much of a limitation as it
really didn't need fancy text graphics. But I can see where it
would be limiting in some other cases. Both the TI99 and the
Atari 8-bit has re-definable text.
The oddest quirk to the coco, though, has got to be it's
program editor. The program editor is a line editor like the
TI-99 has but with several editing key combinations.
Some examples; to edit a line you type EDIT line#. Simple enough.
what you see will be the enter line and then the cursor at
the beginning on the line below the display of the entire line
above. First time i saw that I thought, "OK, now what."
Now what is the special edit keys.
Press the SPACE BAR and you can step through the line with
the line being displayed to the right. BACK SPACE and you
can go back through the line removing characters as you go.
In both cases you can't change or delete or insert characters.
To change a character you position the cursor to the right of
the character you want to change then press C then type
the new character where the old, and unseen, character was.
Delete, press D which deletes a character to the right. You
just have to trust that it was the right one you wanted.
Insert you press, you guessed it, I which puts you in the
insert mode. Again you don't see anything to the right of
what you are inserting.
There are other commands such as X to display whole line and H
to hack off everything after the current position and.
And you can put a number before the C or D but not the I to
change or delete a X number of characters.
It, took a little to get used to, to say the least. biggest
problem I had was pressing the wrong key of pressing C then
the number of characters I want to change messing up the line.
Insert was my biggest annoyance. I would be in the Insert mode
and want to jump to Change or Delete and forget to exit Insert
and start typing in C and D into the insert.
But, all computers have their quirks.
To end, enjoy the game, more maybe coming.