Snake in Maze

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

Snake in Maze

Post by stevepoole »

Hi,

Here is a game (which I failed to zip previously to upload to the Forum), tested on Qemulator, QPC2, SGC, and Turbo'ed with 15 Ko of data space.

It is a snake game, but with added obstacles to avoid ! (Beta tested).

Each time you begin a session, type 'start' to initialise the high-scores file. Then just RUN, and choose a difficulty level, '1' being easiest.
It then draws the obstacles, and next the fruit. When the QL growls, use the arrow keys to navigate around the maze. (Press the ESCape key if no fruit appears).
Either you navigate successfully, or you crash, and get your score. Then hit (Y)es to play again, or (N)o to Quit.

Change the wait (w) variable value (on line 120) to suit your system if need be....

Covid has got me back to the keyboard...
Steve.
snake4_bas.zip
(2.39 KiB) Downloaded 100 times


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

Re: Snake in Maze

Post by stevepoole »

Hi,

I just ran the game on a bare 128 Ko QL with no Hard disk...
So Change lines 290, 1540 & 1690 from win1_ to ram1_ !

Regards,
Steve.
______________


nikosdoykas
Over Heated PSU
Posts: 134
Joined: Tue Oct 09, 2018 4:20 am

Re: Snake in Maze

Post by nikosdoykas »

to run on a >128k??


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

Re: Snake in Maze

Post by stevepoole »

Hi Nikos,

What is the problem ?

I must admit that my 'bare' QL has SuperHermes fitted permanently...

Does this change anything ?

Regards,

Steve.


nikosdoykas
Over Heated PSU
Posts: 134
Joined: Tue Oct 09, 2018 4:20 am

Re: Snake in Maze

Post by nikosdoykas »

i have a qubide+640k so i can run it????


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Snake in Maze

Post by EmmBee »

stevepoole wrote:Hi,

I just ran the game on a bare 128 Ko QL with no Hard disk...
So Change lines 290, 1540 & 1690 from win1_ to ram1_ !

Regards,
Steve.
______________
Hi,

I had a JM QL once, a long time ago. From memory, there was no ram driver.
Perhaps Nicos should try changing lines 290, 1540 & 1690 from win1_ to mdv1_ or flp1_ perhaps.

EmmBee


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

Re: Snake in Maze

Post by stevepoole »

Hi,

Yes, the program runs fine with mdv1_ , but with flp1_ you must have toolkit2, and invoke TK2_ext.

I use floppies to transfer programs between PC and QL, and they are far more reliable than microdrives...

Regards,
Steve.


Derek_Stewart
Font of All Knowledge
Posts: 3957
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Snake in Maze

Post by Derek_Stewart »

Hi,

I think he said, he had a 640K Qubide QL, so there will be a WIN device, Toolkit 2 with RAM disc if the driver is loaded.

I would load all the software over hte QL Network, which will load software onto a 128K QL with Toolkit 2 on board.


Regards,

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

Re: Snake in Maze

Post by stevepoole »

Hi Folks,

More progress has been achieved on QL Basic to JavaScript as I learn the ropes.

My latest attempt was to transcode a QL SNAKE program for PCs, Tablets and SmartPhones.

This is OK, but I had to exclude difficulty levels, because JavaScript matrix arrays are not straightforward to implement. (I am learning though).

I had to use strings with MODulo calculations to get row and column indexation for the output....

UNZIP, then click on the file run it. Use the arrow-keys to move the (S)nake, eat (O)fruit and avoid (X)obstacles. Once started, the snake continues moving.

Currently I am trying to transcode a program which draws epicyclic orbits, but am having difficulty in PAUSEing graphics output. (Impossible in JavaScript ?).

Happy New Year

Steve.

snake5.zip
(4.27 KiB) Downloaded 90 times


Post Reply