stevepoole wrote:Hi Dilwyn,
I am in an embarassing situation here : On holiday in the Alps with no QL documents to fall back on !
What...nothing QL with you on holiday, shock horror!!!
stevepoole wrote:
In the early QL days, I read that RND(-5,9) would select either -5 or 9 as a return. (At the time I had a JM), and used the feature often.
I have never noticed that this feature had changed, not having used it for decades...
A lot of things changed very slightly in those early days, as the designers tried to fit everything in. Would be interesting to see if the original early pre-release syntax definitions included this, as it would seem a natural extension for the RND function, to select from a list of random number values as opposed to a range. Shame this was not kept in. On the other hand it may possibly have been a side effect if there was incomplete error trapping when parsing parameters, for example.
Of course, you could always do some simple basic code to simulate it:
LET number=RND(1 TO 3)
SELect ON number:=1:number=100:=2:number=200:=3:number=300
(hope I got the syntax of the single line SELect correct there, I rarely use the single line form).
Or for large 'random' data sets, keep them in an array() and do something like LET number=array(RND(1 to however_many)) if what you wanted to do was to choose one from a range of possible random values.
stevepoole wrote:As for dynamic sprites, I used to use a font editor to design these, and animate them using CURSOR positioning ( in #1, origin 0,0 only, due to a bug).
OK, so using emulators you now need toolkits to access fonts etc, but that is the price to pay for having bells and whistles.
For larger sprites, join several font elements in big groups, moved simultaneously. Then animation is as fast as XORed character printing....
All this is relatively simple, compared to animated-3D-perspective-sprite handling !! But that stretches the 128ko QL to its limits.
Steve.
I think this is at the heart of what has been discussed here, in that the term "sprite" is used in two different ways, which leads to misunderstandings:
1. PE Sprite: a pointer environment object called a sprite, which includes a dynamic sprite. Generally used as a pointer, cursor or icon. Has its own file formats, unrelated to the games graphics or text fonts.
2. Game sprite: a games graphic unrelated to the above, which may be programmed in a completely different way (e.g. character graphics as you have discussed)
The use of PE sprites (for want of a better term to distinguish between the two types) is what I was discussing in relation to my program, then the thread went towards Game Sprites, which Tinyfpga has kindly moved to a new thread, which will hopefully result in greater discussion of that kind of sprite.
I'll probably have a think and write some text about what may be needed, to contribute to Tinyfpga's new thread, in the hope that it might persuade someone cleverer than me to write such code.