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: Wed, 18 Mar 2020 17:44:29 +0000 (GMT) Organization: None Lines: 56 Message-ID: <5853462123basura@invalid.addr.uk> References: <5852bdfc1cbasura@invalid.addr.uk> X-Trace: individual.net NQ6Xd21HOIH15Xf79hDzIg3lS8hFBsKpT2PcyXyvAnY5osq3BP X-Orig-Path: uwclub.net!richard.ashbery Cancel-Lock: sha1:hE0lYAQfjg/U2VnPbJ3hzWRb5Nw= User-Agent: Pluto/3.16 (RISC OS/5.25) NewsHound/v1.52-32 Xref: csiph.com comp.sys.acorn.programmer:6031 In article , Steve Fryatt wrote: > On 17 Mar, Richard Ashbery wrote in message > <5852bdfc1cbasura@invalid.addr.uk>: > > How should I do this please? Some simple code examples would be > > appreciated. > Is there any chance of seeing your current code? MODE 1920,1080,32 : OFF T2=0 n=0 REM Set up rotation variable for square FOR m=0 TO 6*PI-PI/12 STEP PI/6 REM Set offset for ORIGIN (full circle) X1=SIN RAD(T2)*100 Y1=COS RAD(T2)*100 ORIGIN 1920+X1,1080+Y1 T2+=10 GCOL 3,63 : PROCdraw_square z=INKEY(10) REM Generate sprite group for animation MOVE-330,-330 MOVE 330,330 VDU 23,27,1,n| n+=1 REM Erase previous square after a delay GCOL 3,63 : PROCdraw_square NEXT m END DEF PROCdraw_square FOR T = 0 TO 2*PI STEP PI/2 X=SIN(T+m)*200 Y=COS(T+m)*200 IF T=0 THEN MOVE X,Y ELSE DRAW X,Y NEXT T ENDPROC As suggested by Chris I've eliminated CLG and substituted the EOR GCOL 3,63. Running program displays an offset square as expected but when the sprites are saved the offset is missing and clearly absent when viewing sprites in !Paint. Could this be a problem with the way the program collects the sprite data? The rather strange looking FOR m=0 TO 6*PI-PI/12 STEP PI/6 statement ensures the rotation of the shape returns to its start position and avoids judder when the animation starts again. Richard