pec Posted May 25 Share Posted May 25 Hi, I perfectly understand Y positioning, and after following explanations (docs and samples provided here and newbies pdfs) I see how X positionning can be done for one sprite. But I haven't found any doc on 2 sprites when they are on the same Y : as there is a loop for positionning in X it has to be cut in two, depending on which P1 or P0 has the lower X (I guesss) but what if they are close ? Would there be a sample / doc / tutorial about this ? I only found for one sprite (which seems a 'simple' case) Cheers, Pe Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/ Share on other sites More sharing options...
LatchKeyKid Posted May 25 Share Posted May 25 You might have to clarify whether you're talking about two different sprites (like P0 and P1) or if you're referring to doubles/triples of the same sprite or the a single sprite using alternate frames/flicker to imitate being two different sprites. Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5473918 Share on other sites More sharing options...
pec Posted May 26 Author Share Posted May 26 6 hours ago, LatchKeyKid said: You might have to clarify whether you're talking about two different sprites (like P0 and P1) or if you're referring to doubles/triples of the same sprite or the a single sprite using alternate frames/flicker to imitate being two different sprites. Yep, right, I mean P0 and P1 on the same line for instance. I may ask myself too much question but : I first need to order x0 and x1: put the smallest value in A, in highest in B. loop from 0 to A, trigger drawing PA, then loop from A (minus the number of cycles spent in drawing A or not drawing A) to B, then trigger PB wondering if I'm doing to much work, of this is the way to go ? Cheers Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474104 Share on other sites More sharing options...
+splendidnut Posted May 26 Share Posted May 26 15 hours ago, pec said: But I haven't found any doc on 2 sprites when they are on the same Y : as there is a loop for positionning in X it has to be cut in two, depending on which P1 or P0 has the lower X (I guesss) but what if they are close ? The standard method is to position one sprite at a time, since the standard horizontal positioning routines require a scanline to position one sprite. It would be difficult to make a general horizontal positioning routine that could handle setting more than one object position within a scanline. It's not impossible to do but a bit difficult. It would have constraints and require handling a few different situations. Generally, if you're reusing the player sprites on a single screen (for example, sprites at top, reused at bottom), you would do positioning at the top and then somewhere on the scanlines between the sprite groups, and flicker within the groups if needed (i.e. if more than 2, and unable to use duplicate/triplicate mode). For situations in which you only use the 5 TIA objects as they are (and not try to reuse them more than once on the screen), all positioning could be done off screen with the standard method... which would take at least 5 scanlines to accomplish. Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474272 Share on other sites More sharing options...
pec Posted May 26 Author Share Posted May 26 (edited) 1 hour ago, splendidnut said: For situations in which you only use the 5 TIA objects Thanks a lot for your answer, I see .. but that means that these limitations have visual impacts: sprites can't have full horizontal resolution. Arrh.. Thanks a lot for clarification, long road in front of me then ! Edited May 26 by pec error Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474316 Share on other sites More sharing options...
+splendidnut Posted May 26 Share Posted May 26 All depends on what you're trying to accomplish. Positioning two sprites (using P0 and P1 TIA objects) anywhere horizontally at the same Y coordinate is possible... just requires two scanlines to be used to do the horizontal positioning before the scanlines at which they are drawn. Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474353 Share on other sites More sharing options...
glurk Posted May 26 Share Posted May 26 (edited) @pec What you (may) be missing is that when you set the X position of P0 or P1 or whatever, it STAYS set until you change it again. So many games set the X at the top of screen or whatever and the sprites are only drawn when needed at their proper Y coordinates. It's perfectly OK, for example to set an X position and not even draw the sprite. Two independent things. Edited May 26 by glurk mistake Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474490 Share on other sites More sharing options...
pec Posted May 27 Author Share Posted May 27 (edited) 18 hours ago, glurk said: @pec What you (may) be missing is that when you set the X position of P0 or P1 or whatever, it STAYS set until you change it again. So many games set the X at the top of screen or whatever and the sprites are only drawn when needed at their proper Y coordinates. It's perfectly OK, for example to set an X position and not even draw the sprite. Two independent things. whoooo ... you are right ! I can write to Resp0 and resp1 while being in overscan, reserving 2 lines for that, so i can then position them anywhere, even on top of each others and without doubling the height. and only put values different from 0 into GRPO and GRP1 when Y gets to the Y of each sprites Oh ! So much simpler.. Thx a lot ! Edited May 27 by pec Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5474861 Share on other sites More sharing options...
+SpiceWare Posted May 27 Share Posted May 27 You might like to check out my tutorial which covers writing a 2K game from start to finish. The game uses both players, both missiles, the ball, and playfield. 1 Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5475077 Share on other sites More sharing options...
LatchKeyKid Posted May 28 Share Posted May 28 I'm pretty sure that I've mentioned it before but just in case I'll say it here... I really love the dragon sprite! 1 Quote Link to comment https://forums.atariage.com/topic/367116-2-sprites-on-the-same-line/#findComment-5475222 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.