PaQman game

Anything QL Software or Programming Related.
Post Reply
stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

PaQman game

Post 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 101 times


stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

Re: PaQman game

Post by stevepoole »

Hi again,

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

Regards,

Steve.


User avatar
Sparrowhawk
Super Gold Card
Posts: 648
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: PaQman game

Post 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


a.k.a. Jean-Yves
User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: PaQman game

Post 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


User avatar
Andrew
Aurora
Posts: 795
Joined: Tue Jul 17, 2018 9:10 pm

Re: PaQman game

Post 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?


stevepoole
Super Gold Card
Posts: 715
Joined: Mon Nov 24, 2014 2:03 pm

Re: PaQman game

Post 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 85 times


User avatar
Sparrowhawk
Super Gold Card
Posts: 648
Joined: Wed Dec 15, 2010 12:33 pm
Location: @131072
Contact:

Re: PaQman game

Post by Sparrowhawk »

Running OK now, thanks :)


a.k.a. Jean-Yves
Post Reply