Page 1 of 1

PaQman game

Posted: Thu Dec 03, 2020 10:18 am
by stevepoole
Hi,

More Qovid revision going on : This time I have dug out paqman and updated it, removing the one remaining quirk.

Just unzip it, LRUN, enter the required difficulty, then use the arrow keys or ESCape.

Tested ok on QPC2, SGCqdos and SGCsmsq/e (with SH). All GOTOs removed and all variables LOCALised.

Should be ok on other QL configurations ?

My grandchildren enjoy it...

Best wishes,

Steve.
PacMan3_bas.zip
(2.42 KiB) Downloaded 110 times

Re: PaQman game

Posted: Thu Dec 03, 2020 10:50 am
by stevepoole
Hi again,

If you remove the CLEAR statement, the program will Turbo-compile and EXEC ok with 15ko of dataspace.

Regards,

Steve.

Re: PaQman game

Posted: Thu Dec 03, 2020 2:19 pm
by Sparrowhawk
Hi there,

I get:

Code: Select all

RUN
At line 200 Bad name
I just started up Q-emuLator 2 (macOS) and set the QL to JS ROM Gold Card with 640K - TK2 enabled.

Does this need SMSQE?

Thanks,
JY

Re: PaQman game

Posted: Thu Dec 03, 2020 4:04 pm
by dilwyn
Sparrowhawk wrote:Hi there,

I get:

Code: Select all

RUN
At line 200 Bad name
I just started up Q-emuLator 2 (macOS) and set the QL to JS ROM Gold Card with 640K - TK2 enabled.

Does this need SMSQE?

Thanks,
JY
You may find that there's more than just "bad parameter" here - this is our old friend the "more than 9 local parameters" bug, lines 150 to 190, discussed on the Forum recently.

Screen dump taken on QemuLator 3.3.1 Windoze with JS ROM attached to show what happens to lines after the LOCal parameters on a QDOS systems (it runs fine in SBASIC - I just ran it on QPC2).
nineparamsbug.jpg

Re: PaQman game

Posted: Thu Dec 03, 2020 4:30 pm
by Andrew
@stevepoole What is the use of i1$, i2$,i3$ and i4$ ?

Code: Select all

1220 DEFine PROCedure flash_pacman
1230  INK 6
1240  pr my,mx,'O': i1$=INKEY$(#1,PS)
1250  pr my,mx,'O': i2$=INKEY$(#1,PS)
1260  pr my,mx,'C': i3$=INKEY$(#1,PS)
1270  pr my,mx,'C': i4$=INKEY$(#1,PS)
1280 END DEFine
1290 :

1330 :
1340 DEFine PROCedure move_pacman
1345 LOCal test
1350  REMark get all previous keystrokes:
1360   i$=i1$&i2$&i3$&i4$
1370    IF i$='': is=0: ELSE is=CODE(i$) 
is will always be code(i1$) because code(i1$&i2$&i3$&i4$)=code(i1$)
and i2$, i3$ and i4$ are never parsed - so only 1 in 4 keystrokes are processed by the game.
Am I missing something here?

Re: PaQman game

Posted: Thu Dec 03, 2020 8:27 pm
by stevepoole
Hi All,

1) SparrowHawk : Sorry I don't have QEmulator to test on ! I have got rid of the multiple LOCals which may fix the problem ? Please let me know...

2) Andrew : Well spotted, i2$,i3$ and i4$ are unecessary ! This happened because in an early prototype, there were 8 seperate inkey$ calls, which I regrouped in the 'pr' routine, and forgot to reduce them to one.

3) Thanks Dilwyn for the screen shot. Do you know if SuperHermes invokes smsq/e ? (I had thought not).

4) Beware : two zombies on one cell XOR each other out, so they may tempoarily disappear, and ressucitate !

5) Be sure to always get rid of any CLEAR before compiling, else the executed program will halt...

6) I have not completely tidied up the listing, in case SparrowHawk discovers more problems with Qdos. But tested ok on my setups.

Steve.
pacman5_bas.zip
(2.43 KiB) Downloaded 93 times

Re: PaQman game

Posted: Fri Dec 04, 2020 9:54 am
by Sparrowhawk
Running OK now, thanks :)