Coolcrab Posted January 21, 2018 Share Posted January 21, 2018 I was wondering if there is any way to get the PFpixel coordinates of the PFpixel that is touched by the player during a collision. (I want to remove blocks that are touched by a player) Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 21, 2018 Share Posted January 21, 2018 X_POSITION / 4 will get you started. In assembly that'd be: lda X_POSITION lsr ; divide by 2 lsr ; divide by 2 But by saying PFpixel I gather you're using batari Basic, so you'd be better off looking for help it its forum as the Newbies forum is really geared towards assembly. Also, if I recall correctly, bB only uses the middle 32 playfield pixels so you'll need to use an offset along with the divide by 4. Something along the lines of (X_POSITION - 16) / 4. You'll likely need to fine-tune the 16 +/- 1 or 2. 1 Quote Link to comment Share on other sites More sharing options...
Coolcrab Posted January 22, 2018 Author Share Posted January 22, 2018 Ah ok, I thought that this forum was also for bB. Sorry for that then. Could a mod maybe move it to the bB section? I tried your solution though, and it seems to semi work. Oddly enough only if the player moves into the block and not of the block moves into the player. (the play field is scrolling down.) Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted January 22, 2018 Share Posted January 22, 2018 One thing to consider is an 8 pixel player can collide with up to 3 playfield pixels, so once you've done this(or whatever that 16 ends up being): pfx = (xpos - 16)/4 the player could also have collided with pfx+1 and/or pfx+2. Quote Link to comment Share on other sites More sharing options...
Coolcrab Posted January 22, 2018 Author Share Posted January 22, 2018 Yes, but in this case thats a feature rather than a bug, as the player can only move in one line and has to remove all blocks it touches. 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.