_

Discussions related to graphics (2D and 3D), animation and games programming
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

_

Post by p_m21987 »

.
Last edited by p_m21987 on Sat 08 Dec 2018, 14:50, edited 2 times in total.
guest

Re: 2D game using SDL functions. Should I continue this project?

Post by guest »

Patrick M wrote: Fri 30 Nov 2018, 22:46I've recently been working on an idea for a 2D game, where you can control a man who runs and jumps.
To satisfy my curiosity, how is this related to the program of the same name that you've written for Matrix Brandy? Are they essentially the same code? I doubt that many people will have tried to target both platforms simultaneously so there may well be valuable lessons to learn from your experience.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: 2D game using SDL functions. Should I continue this project?

Post by p_m21987 »

_
Last edited by p_m21987 on Sat 08 Dec 2018, 14:51, edited 1 time in total.
guest

Re: 2D game using SDL functions. Should I continue this project?

Post by guest »

Patrick M wrote: Fri 30 Nov 2018, 23:49It seemed to get confused by something somewhere in the code. I realised that something was wrong when I noticed that the automatic indentation didn't look correct (for example, there were two ENDIFS next to each other at the same horizontal position), and the program didn't behave correctly when I ran it.
If you can reproduce the problem (or if you saved a copy of the program) please list the troublesome section of code here. What I would say, however, is that (unlike Python!) indentation has only cosmetic significance, and can't of itself have any effect on the running program. The BBCSDL interpreter doesn't even see it, because leading spaces are stripped off program lines (and of course you can disable indentation in the Options menu).
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: 2D game using SDL functions. Should I continue this project?

Post by p_m21987 »

_
Last edited by p_m21987 on Sat 08 Dec 2018, 14:51, edited 1 time in total.
guest

Re: 2D game using SDL functions. Should I continue this project?

Post by guest »

Patrick M wrote: Sat 01 Dec 2018, 12:28 I can reproduce the problem.
Too late for the next release of BBCSDL I'm afraid (I'm not holding it back for what sounds like a minor problem, and one I've never come across). You can always try switching to the other IDE to see if that works better; in my experience Andy Parkes' IDE is considerably more stable than mine (he hasn't sent me any updates or bug fixes for months).
Does anyone have an answer to my question about whether or not I should bother continuing with this project?
Surely that must be a decision for you? If it's giving you enjoyment and/or satisfaction, carry on. I know from my own bitter experience that if you write any software in the hope of it being appreciated by others you are likely to be disappointed. ;)
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: 2D game using SDL functions. Should I continue this project?

Post by p_m21987 »

_
Last edited by p_m21987 on Sat 08 Dec 2018, 14:52, edited 1 time in total.
guest

Re: 2D game using SDL functions. Should I continue this project?

Post by guest »

Patrick M wrote: Sat 01 Dec 2018, 14:384. Renumber the program. Examine lines 2250 and 3020. Note that the indentation is incorrect.
It's a fault in your file, not in SDLIDE: both those lines have a trailing space. As you know, in an IF … THEN line there must be nothing after the THEN (not even a REM, or indeed a space) because it's being the last token on the line that indicates that it's the start of a multi-line IF...ENDIF clause rather than a single-line IF statement. Technically the explanation for this restriction is that when BBC BASIC 'searches forwards' for a possible nested IF...ENDIF clause it looks only at the last byte of every line (for maximum speed).

The reason that editing the lines fixes the problem is that it causes the lines to be re-tokenised, and a side-effect of the re-tokenisation is that any trailing spaces are stripped. In principle SDLIDE could strip trailing spaces when the program is read from a file too, but currently it assumes that the file corresponds to a valid BBC BASIC program and therefore does not expect to need to.

I wonder how those spaces got there in the first place. Did you create the program in a regular text editor rather than a specific BBC BASIC editor such BB4W, BBCSDL or BBCEdit (or indeed one of the many other BBC BASIC editors)? I would not expect a BBC BASIC editor to export a file with trailing spaces, but of course a regular text editor might.
Fair enough. I'll probably not continue working on this project since nobody is interested.
I wouldn't say nobody is interested - I am interested in any program written in BBC BASIC, more so if it has a unique property such as having been written to run in both Matrix Brandy and BBCSDL! But I am not a games enthusiast, not least because I'm hopeless at playing them, so it's not a program that I would be very likely to use myself other than for the interest of seeing it run.
p_m21987
Posts: 177
Joined: Mon 02 Apr 2018, 21:51

Re: 2D game using SDL functions. Should I continue this project?

Post by p_m21987 »

_
Last edited by p_m21987 on Sat 08 Dec 2018, 14:51, edited 1 time in total.
guest

Re: 2D game using SDL functions. Should I continue this project?

Post by guest »

Patrick M wrote: Sun 02 Dec 2018, 00:50 I knew that when you type into SDLIDE it automatically removed the trailing spaces, so I expected that it would behave the same when importing a text file. I'll be aware of this from now on.
It wouldn't be difficult to modify SDLIDE to work as you expected. If people are going to use a regular text editor it probably should strip trailing (and leading) spaces so I'll add it to the 'wish list' for the next release.
I did, as it started out as a Matrix Brandy program.
Has nobody written an IDE for Brandy? You could perhaps adapt SDLIDE.bbc, which I don't think relies on many language extensions that Matrix Brandy doesn't have (ON TIME is probably the most problematical one); the GUI is created entirely using regular BBC BASIC plotting statements so should be quite portable. Admittedly 'dlglib.bbc' which SDLIDE uses to display its 'dialogue boxes' makes extensive use of structures so that would need some work.