Rainbow Snake (new game - kind of!)
Pages: 1 2
David Williams (2619) 103 posts |
Here’s the RISC OS version of my BB4W/BBCSDL game, ‘Rainbow Snake’: http://www.proggies.uk/riscosstuff/riscos/zip/rainbowsnake_riscos.zip The game is frame-rate independent so should run well across a wide range of RISC OS 5-based machines and screen refresh rates. |
David Williams (2619) 103 posts |
Thanks, David. :) I’m probably going to spend the rest of the night tidying up the source code. There’s a lot of garbage in there. |
Kevin (224) 322 posts |
It works on the ARMX6 and the PiHard FOURtress. A pause key would be a nice addition if possible. |
David Williams (2619) 103 posts |
It works on the ARMX6 and the PiHard FOURtress. Thanks for checking. A pause key would be a nice addition if possible. Now implemented. The download has been updated. |
Willard Goosey (5119) 257 posts |
fun and pretty. I like it! |
David Williams (2619) 103 posts |
fun and pretty. I like it! Thanks. It’s fun to be dabbling with RISC OS again. :) |
Terry Swanborough (61) 152 posts |
Thanks for the game , surprisingly addictive and colourful :-) Looks like we are having a flurry of games. |
Steve Drain (222) 1620 posts |
I echo that. I noticed that you crunched it using StrongBS. Was that on a 26-bit machine, or have you a reliable 32-bit version? Out of interest, I crunched it using my Crunchie and was very pleased to see that it runs, if used with the switches I was not expecting that. ;-) |
Andreas Skyman (8677) 170 posts |
Runs well on RPCEMU (RO 5.59). Good work! |
David Williams (2619) 103 posts |
@ Terry: Thanks for the game , surprisingly addictive and colourful :-) Cheers. I’m thinking of converting some my other BB4W/BBCSDL games – a task not made easy by the fact that I’ve lost the source code for many of them. :-( Perhaps it’s better to focus on new projects instead. @ Steve: I noticed that you crunched it using StrongBS. Was that on a 26-bit machine, or have you a reliable 32-bit version? As with my recently released ‘Gorillas’ game, the conversion (and subsequent crunching) was done on RPCEmu running RISC OS 5.27, using StrongBS 3.05a. I rarely have problems with it as far as pure BASIC code is concerned (although see below), and it’s always a bit of a relief when a large-ish BASIC program is successfully crunched and runs as it should. Problems sometimes occur when there’s sections of assembler code – like, IIRC, when StrongBS mistakenly appends variables X or x to the branch instruction B, or the variables W or w to MOV. That can be annoying! Out of interest, I crunched it using my Crunchie and was very pleased to see that it runs I think it’s about time I acquainted myself with Crunchie, so will download it this evening. It’s always good to have another option! StrongBS seems mostly fine and capable as far as I’m concerned (notwithstanding potential ASM section woes). Here’s a StrongBS bug which made me temporarily break out in a cold sweat a few days ago. In the Gorillas program, I had a statement something like: r = 0.01 + 0.1*(a + b)which got crunched to the form r=.01+.(a+b)which causes an error. I tried to reproduce this bug just now, but StrongBS is now bloody behaving itself! The bug is obviously of the intermittent variety, and depends on currently unknown factors. @ Andreas: Runs well on RPCEMU (RO 5.59). Good work! Thanks. I think you meant 5.29, though :) |
Ronald (387) 195 posts |
a wide range of RISC OS 5-based machines My Iyonix 5.28 finds an error at line 100, however double clicking the two modules and then the uncrunched !RunImage and it runs OK. |
Steve Drain (222) 1620 posts |
That’s why I used the word ‘reliable’. ;-) Cruchie started as a bit of a ‘toy program’, written in BASIC, but it grew and grew. It is capable, but nowhere near as ambitious as StrongBS. It can do assembly, but is a bit cranky about what and how. There are still a few bugs (hello Msrtin), but nothing big, I think. I would be interested in your opinion. |
David Williams (2619) 103 posts |
Ah, intriguing. Can you tell me what the error message is? Line 100 of crunched !RunImageX (assuming version 1.02 of the program) is to do with loading the high-score data file from the directory $.!Boot.Choices.RainbowSnake if it exists. If it can’t find the file then it assumes (perhaps stupidly) that the directory doesn’t exist either, in which case it attempts to create it (RainbowSnake) in $.!Boot.Choices. The OS doesn’t raise an error if the directory already exists. So I wonder what’s going on here (if indeed the error is anything to with the high score file or the directory it’s meant to reside in)? |
Ronald (387) 195 posts |
Can you tell me what the error message is? ‘Not found at line 100’ |
Julie Stamp (8365) 474 posts |
That’s such a happy game! :-D And its little tongue pokes out ^ – ^
Assuming the location of Choices like that is not reliable: it might not be in !Boot, and !Boot might not be in $, or the current FS/drive might not be the one with !Boot on. A way to do this would be something like
|
Martin Avison (27) 1494 posts |
With v1.03 there is a significant problem – it can attempt to close ALL open files, which can cause other applications to fail in unexpected ways. In source line 850 it tries to open file “$.!Boot.Choices.RainbowSnake.HiScore”. If the file does not exist, F% will be zero, but it then does CLOSE#F% which will close all files. CLOSE# variable should only ever be done if variable is non-zero. You may find my small StopClose0 module useful to discover such nasty bugs – see www.avisoft.f9.co.uk – and it allows you to fail the program, ignore the CLOSE#0 and continue, or allow the CLOSE (dangerous). |
Martin Avison (27) 1494 posts |
It is also not a good idea to *RMKill modules that you may, or may not have loaded, if they could also be used by other applications. Certainly I use TimerMod elsewhere, and I noticed RainbowSnake had killed it. Incidentally, the latest TimerMod is v4.18 (12 Apr 2020). The game itself looks good, after a quick play here! Well done. |
Ronald (387) 195 posts |
the location of Choices like that is not reliable Yes, I think when I switch some activity to RAM, that becomes the current FS, so $.!Boot will not get found. |
Steve Fryatt (216) 2105 posts |
Assuming that Choices hasn’t been (legitimately) moved from within !Boot. Julie’s solution was correct: always read from |
David Williams (2619) 103 posts |
@ Julie @ Martin — Rainbow Snake v1.04: |
Ronald (387) 195 posts |
Assuming that Choices hasn’t been legitimly moved. Is it legal to move the settings to a local directory of an applicstion? I think that would be a big time saver and would make the the app portable to copy intact to another computer. |
Stuart Painting (5389) 714 posts |
Pros: Easier to move the application to another computer. Cons: Upgrading the application just got harder. You can’t delete the old application and copy the new one across as that zaps your choices; likewise a “merge” approach has its problems. Something like PackMan should be able to handle the process, but People Are Impatient… |
Ronald (387) 195 posts |
An upgrade wouldn’t have to have the settings directory so it wouldn’t over write it. They have to create one if it is not already there. I guess if you were doing a complete replacement you would drsg a copy of the settings to RAM first. This sort of thing has many easy fixes in RISC OS |
Stuart Painting (5389) 714 posts |
But why are you having to come up with “fixes” for a problem of your own making? Putting an application’s choices inside the application complicates the process of upgrading the application. The only actual benefit accruing is the ease of transferring the application (including choices) to another computer. The other “benefit” quoted upthread isn’t all that persuasive. If you’re worried about a rogue application messing up the contents of !Boot.Choices, what’s to stop it from messing up other things as well? Can you truly trust anything on that disc after running the rogue application? |
Stuart Swales (1481) 351 posts |
We have a long-established mechanism that most are content with. |
Pages: 1 2