digdugnate Posted August 5, 2017 Share Posted August 5, 2017 (edited) Apologies in advance if this has been answered before, but I can't quite get my hands around how the CALL SPRITE command works. I have a 4x4 block of characters defined (so 4 strings per 'line', 4 lines tall) and would like to move the entire thing as a sprite (like diagonally across the screen). here's my pseudocode: * Define character sets A$="hex" through P$="hex" * Color character sets (with example colors) CALL COLOR(9,7,12) CALL COLOR(10,7,12) * Display character sets (with examples) CALL VCHAR(12,16,96) :: CALL CHAR(96, A$) CALL VCHAR(12,17,97) :: CALL CHAR(97, B$) (and so on until 4 rows across and 4 rows down are defined) So... according to the XB manual i want to do something similar to CALL SPRITE(#1, 96, 5, 124), but instead where it takes my entire 16 block 'graphic' and moves it across the screen, but I can't quite figure out *how* to make it work. Thanks in advance! Edited August 5, 2017 by digdugnate Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted August 5, 2017 Share Posted August 5, 2017 Call motion Sent from my LG-H830 using Tapatalk Quote Link to comment Share on other sites More sharing options...
digdugnate Posted August 5, 2017 Author Share Posted August 5, 2017 ok- i've got my book out. CALL SPRITE(#1,33,5,96,124) - would define it FOR XVEL=-16 TO 16 STEP 2 FOR YVEL=-16 TO 16 STEP 2 - sets values for motion of sprite DISPLAY AT (12,11):XVEL;YVEL - displays current values of motion of sprite CALL MOTION(#1, XVEL, YVEL) - sets sprite in motion NEXT XVEL - completes the loops NEXT YVEL -- so the next question i have is that if i've defined characters like 96 - 110 how to i get them all to move 'at once'? Quote Link to comment Share on other sites More sharing options...
RXB Posted August 5, 2017 Share Posted August 5, 2017 (edited) Hmmm CALL MOTION automatically moves SPRITES. 100 CALL CLEAR :: CALL MAGNIFY(2) :: CALL SCREEN(15) 110 FOR S=1 TO 28 120 CALL SPRITE(#S,64+S,INT(RND*16)+1,20+S,50+S,INT(A(RND*1))*INT(RND*32),INT(A(RND*1))*INT(RND*32)) 130 CALL MOTION(#S,INT(RND*99),INT(RND*99)) 140 NEXT S 150 GOTO 150 You seem to think you have to move the sprites yourself, you can do that using CALL LOCATE(#sprite,row,col) so see XB manual. By the way Sprite row is 1 to 192 and sprite column is 1 to 256 Edited August 5, 2017 by RXB 2 Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 5, 2017 Share Posted August 5, 2017 The XB sprite commands allow you to repeat the parameters for a little more speed (ie: CALL MOTION(#1,10,10,#2,10,10,#3,10,10) works to move sprites 1-3). The problem is that the interpreter is still too slow. You can usually get away with moving two sprites together if you only set the motion once, but more often than not more than that, or any updates, will just cause them to drift apart. Of course, you could try accounting for the motion lag with the initial position, it would probably work most of the time (ie: offset by a pixel or so based on the gaps you observe ). 2 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted August 5, 2017 Share Posted August 5, 2017 Could it help to inhibit sprite motion with the flag byte (83C2) until all motions are set? 2 Quote Link to comment Share on other sites More sharing options...
digdugnate Posted August 5, 2017 Author Share Posted August 5, 2017 thanks all i have what i think i need now. Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 5, 2017 Share Posted August 5, 2017 Could it help to inhibit sprite motion with the flag byte (83C2) until all motions are set? It might, though then you are requiring 32k so CALL LOAD is available. Not a huge limit in this day and age. Quote Link to comment Share on other sites More sharing options...
digdugnate Posted August 5, 2017 Author Share Posted August 5, 2017 that shouldn't be a super big deal- i have a PEB with the 32k I was disheartened, somewhat, because i was halfway through my program and i pressed fn-= instead of shift for the 'plus' sign. I went and took care of laundry instead 3 Quote Link to comment Share on other sites More sharing options...
RXB Posted August 6, 2017 Share Posted August 6, 2017 (edited) that shouldn't be a super big deal- i have a PEB with the 32k I was disheartened, somewhat, because i was halfway through my program and i pressed fn-= instead of shift for the 'plus' sign. I went and took care of laundry instead RXB starts out with the QUIT KEY DISABLED, in order to use the Quit Key in RXB you have to use: CALL QUITON Turns on quit key. and CALL QUITOFF Turns quit key off. Edited August 6, 2017 by RXB 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 6, 2017 Share Posted August 6, 2017 that shouldn't be a super big deal- i have a PEB with the 32k I was disheartened, somewhat, because i was halfway through my program and i pressed fn-= instead of shift for the 'plus' sign. I went and took care of laundry instead I did worse once, and learned about ghost keys the hard way. After several hours of coding and fighting bugs, with it not working, I slapped the keyboard in frustration. It retaliated by resetting. I tested afterwards, and yes, there are combinations of many keys that get misread as FCTN-=. Don't slap your TI. 3 Quote Link to comment Share on other sites More sharing options...
RXB Posted August 6, 2017 Share Posted August 6, 2017 Other combinations do not work for Quit in RXB I turned off the CRU access to get that number from keys. (And if you find one that does work tell me and I will fix it.) 1 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted August 6, 2017 Share Posted August 6, 2017 But isn't the thing asked here about how to move a graphic block that's not defined as a sprite, or several sprites, but just as normal graphics? That's completely different. 1 Quote Link to comment Share on other sites More sharing options...
digdugnate Posted August 6, 2017 Author Share Posted August 6, 2017 it is.. but in a roundabout way i figured out what i needed for my program- not withstanding me quitting my program by miskeying, lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.