Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Richard Ashbery Newsgroups: comp.sys.acorn.programmer Subject: Re: Saving animated sprites from a simple BASIC graphic program Date: Thu, 19 Mar 2020 20:05:53 +0000 (GMT) Organization: None Lines: 56 Message-ID: <5853d6e7f9basura@invalid.addr.uk> References: <5852bdfc1cbasura@invalid.addr.uk> <5853462123basura@invalid.addr.uk> X-Trace: individual.net VgOHMIm323BNHazCycK08g5bzHbiEqHlnIP9gDH9Ze9fafOYby X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:FsxaRffxlV1L03QAXfCPafzLUqE= User-Agent: Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:6040 In article , Steve Fryatt wrote: > On 19 Mar, Steve Fryatt wrote in message > : > > On 18 Mar, Richard Ashbery wrote in message > > <5853462123basura@invalid.addr.uk>: > > > be a problem with the way the program collects the sprite data? > > > > As Druck says, VDU23,27,1,n| is ugly, and quite dated. I wouldn't > > be completely surprised if it doesn't take the ORIGIN setting > > into account, but I can't see any reference to that foible in the > > manual. > You're grabbing a screenshot from (-330,-330) to (330,330) relative > to the current origin (0,0), but at the same time, you're moving > that origin around to shift the centre of your square. But, of > course, this /also/ moves the centre of the (-330,-330) to > (330,330) screen grab, so the grabbed area will /always/ be > perfectly centred on the square that you've just plotted. Ah! yes obvious when I think about it. > I still don't like VDU23,27,1,n| though... Although this method of creating a sprite group is probably poor/deprecated it's easy to understand. I need to get my head round the alternative (OS_SpriteOp). Although I've been told its easy the last time I looked I didn't find it plain sailing - I need a good tutorial - I'll do a web search and see what turns up. > > However, using ORIGIN seems unnecessary anyway. Why not just plot > > at the required coordinates, and bypass all of the problems? > By not moving the (0,0) point around, but instead plotting the > square at the desired coordinates relative to a single, fixed > origin, the square will, of course, move within the static > (-330,-330) to (330,330) rectangle as intended. Excellent explanation - thanks :-) Of course your program changes work superbly. Again thanks. > I would suggest treating ORIGIN as a command to call once, after > MODE. After that, always calculate the exact coordinates that you > need for each stage of the graphic. This is no harder than moving > the origin, as you can see from my code, and completely avoids this > kind of confusion. Yes, I see that now and is vastly better. Richard