Retrospect Posted November 2, 2012 Share Posted November 2, 2012 (edited) Hi. To help me further along with my games, what commands / lines of code would detect a coincidence between a sprite and an ordinary defined character? (in Ext. Basic) Feedback would be muchly appreciated Edited November 2, 2012 by Retrospect Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted November 2, 2012 Share Posted November 2, 2012 CALL COINC assigns a value to tell if sprites or a sprite and a point on the screen are at or near the same location on the screen. CALL DISTANCE indicates the distance between two sprites or a sprite and a point on the screen. CALL COINC( #sprite-number, dot-row, dot-column, tolerance, numeric-variable ) A sprite and a location are coincident if the upper left hand corner of the sprite and the position specified by dot-row and dot-column are within the value specified by tolerance. These coincidents are reported even if there is no apparent overlap of the sprites or the sprite and the position. CALL DISTANCE( #sprite-number, dot-row, dot-column, numeric-variable ) The position of each sprite is considered to be its upper left hand corner. The squared distance is returned in numeric-variable. Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted November 2, 2012 Share Posted November 2, 2012 Using CALL POSITION and then converting the dot information to row and column, and then using CALL GCHAR might be better. Only thing is, CALL GCHAR, IIRC, is rather slow, but if you're compiling then that should not be a problem. 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted November 2, 2012 Author Share Posted November 2, 2012 Using CALL POSITION and then converting the dot information to row and column, and then using CALL GCHAR might be better. Only thing is, CALL GCHAR, IIRC, is rather slow, but if you're compiling then that should not be a problem. Thanks .... yeah, I'll give that a try. Yes I will be compiling my code, I do with almost all my stuff nowadays. It makes everything so much tighter and the sprites actually behave themselves. You should have seen the state of "Freeway" before it was compiled. The chickens were practically invulnerable and the only point of recognition was when they hit the top of the screen! Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted November 2, 2012 Share Posted November 2, 2012 Even if people bought the XB, no Expansion Memory, then games didn't get that much more effective. Sprites were nice, but collision detection were always jerky. If they only had done a ON COINC (like ON ERROR). Quote Link to comment Share on other sites More sharing options...
slinkeey Posted November 2, 2012 Share Posted November 2, 2012 I just read somewhere that Commodore got the idea from TI for the concept of Sprites. Quote Link to comment Share on other sites More sharing options...
Retrospect Posted November 2, 2012 Author Share Posted November 2, 2012 I just read somewhere that Commodore got the idea from TI for the concept of Sprites. From Wikipedia; The VIC-II chip was designed primarily by Al Charpentier and Charles Winterble at MOS Technology, Inc. as a successor to the MOS Technology 6560 "VIC". The team at MOS Technology had previously failed to produce two graphics chips named MOS Technology 6562 for the Commodore TOI computer, and MOS Technology 6564 for the Color PET, due to memory speed constraints.[1] In order to construct the VIC-II, Charpentier and Winterble made a market survey of current home computersand video games, listing up the current features, and what features they wanted to have in the VIC-II. The idea of adding sprites came from the Texas Instruments TI-99/4A computer and its TMS9918 graphics coprocessor.[2] About 3/4 of the chip surface is used for the sprite functionality. Quote Link to comment Share on other sites More sharing options...
slinkeey Posted November 2, 2012 Share Posted November 2, 2012 That kind of gives me a fuzzy feeling.. You have Commodore folks that claim the TI was a pile of garbage all while it influenced their machine. 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted November 2, 2012 Author Share Posted November 2, 2012 That kind of gives me a fuzzy feeling.. You have Commodore folks that claim the TI was a pile of garbage all while it influenced their machine. Yes I most agree. Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted November 2, 2012 Share Posted November 2, 2012 One thing you should know about when using CALL COINC is that the manual does not describe it quite accurately. According to the manual if the distance is greater than the tolerance then there is no coinc. Actually, if either the x distance or the y distance is <= the tolerance then coinc is reported. So if the tolerance is 10, the X distance is 10 and the Y distance is 10 then coinc is detected even though the distance is actually 14.14 pixels. 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted November 2, 2012 Share Posted November 2, 2012 Look in the GPL manual it explains the Sprites very well and the later Editor Assembler book copied most of this info. http://www.retroclouds.de/atariage/gpl_programmers_guide.pdf 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted November 2, 2012 Author Share Posted November 2, 2012 (edited) Look in the GPL manual it explains the Sprites very well and the later Editor Assembler book copied most of this info. http://www.retroclou...mmers_guide.pdf Ahhh Rich ,,. there you are. You just reminded me, I am intending to make a text adventure for use with RXB2012. (possibly early 2013) I like the CALL HPUT command because it allows 32 characters across, and without looking back again at the manual I'm thinking there was 40-character mode too? Edited November 2, 2012 by Retrospect Quote Link to comment Share on other sites More sharing options...
RXB Posted November 2, 2012 Share Posted November 2, 2012 Well if you put the video mode into 40 column mode it will do the HPUT but you will get some odd behaviors. As the video mode changes the X and Y values of the DCHAR buffer Row and Col buffers. So I would use the MOVES command instead as it does not care what Video mode you are in and would even work for Multi or Bit Map. Of course then you have to re-arrange Video memory before you screw up something in string space. Now HPUT in 40 col mode will put stuff where you want but sees only 768 characters on the screen so will not go beyond that limit. HGET would work the same way. 100 WD$="This is a test screen of 40 column mode and we can see that unless we redefine the characters and length we get problems." 110 CALL MOVES("$V",76,WD$,47) This would work better, but then at end you screen you have to keep track to not put stuff over the screen size limit. Quote Link to comment Share on other sites More sharing options...
sometimes99er Posted December 11, 2012 Share Posted December 11, 2012 ! Color the sky 100 CALL CLEAR::CALL CHAR(33,"8")::CALL COLOR(2,3,3)::CALL SPRITE(#1,33,2,96,128,6,3) 110 CALL POSITION(#1,Y,X)::IF Y<193 THEN CALL HCHAR(INT((Y-1)/8)+1,INT((X-1)/8)+1,40)::GOTO 110 120 CALL LOCATE(#1,192/2,256/2)::CALL MOTION(#1,RND*12-6,RND*12-6)::GOTO 110 ! Walk on by 100 CALL CLEAR::CALL CHAR(33,"8")::CALL COLOR(2,3,3)::for x=1 to 8::call hchar(rnd*23+1,rnd*31+1,40,rnd*31+1) 110 call vchar(rnd*23+1,rnd*31+1,40,rnd*23+1)::next x::CALL SPRITE(#1,33,2,96,128,6,3) 120 CALL POSITION(#1,Y,X)::IF Y>192 THEN CALL LOCATE(#1,192/2,256/2)::CALL MOTION(#1,RND*12-6,RND*12-6)::GOTO 120 130 CALL GCHAR(INT((Y-1)/8)+1,INT((X-1)/8)+1,G)::IF G=32 THEN 120 ELSE CALL SOUND(-150,110,0)::GOTO 120 1 Quote Link to comment Share on other sites More sharing options...
unhuman Posted December 12, 2012 Share Posted December 12, 2012 Did you play my Toilet Adventure? 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.