prOk Posted September 29, 2022 Share Posted September 29, 2022 Anyone got a bb snippet of how to grab and carry an object similar to say the sword in adventure and keep that object across multiple screens? I've sort of done it but it feels clunky, hoping to see better ways. Thanks! Quote Link to comment Share on other sites More sharing options...
KevKelley Posted September 29, 2022 Share Posted September 29, 2022 I’ve always done it by doing things like checking the collision of two objects and if a button is pressed. If it is pressed then the coordinates of the grabbed item would change to be tied to the player. I do this in my game Crossdock with the pallet jack. you also mention multiple screens. You could also set a bit that when something is grabbed it flips that hit and stays on. I do this in my game Crossdock when you pick up a box. While I don’t have multiple screens, this effect can be seen if you have a box and go to the bonus screen. Since I don’t reset the bit when you go back to main screen the box will reappear in your hands. I don’t have my computer available at the moment (everything is buried under our hurricane prep stuff) but I thought I have the .bas file in these forums if you look up “Crossdock.” 1 Quote Link to comment Share on other sites More sharing options...
rsiddall Posted September 29, 2022 Share Posted September 29, 2022 1 hour ago, KevKelley said: I’ve always done it by doing things like checking the collision of two objects and if a button is pressed. If it is pressed then the coordinates of the grabbed item would change to be tied to the player. I do this in my game Crossdock with the pallet jack. you also mention multiple screens. You could also set a bit that when something is grabbed it flips that hit and stays on. I do this in my game Crossdock when you pick up a box. While I don’t have multiple screens, this effect can be seen if you have a box and go to the bonus screen. Since I don’t reset the bit when you go back to main screen the box will reappear in your hands. I don’t have my computer available at the moment (everything is buried under our hurricane prep stuff) but I thought I have the .bas file in these forums if you look up “Crossdock.” Your grocery cart in "Bag Boy" would be another example... 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted September 30, 2022 Share Posted September 30, 2022 In my game Knabber Rob I change the player sprite to one with the item as part of the sprite (on top of his head). This uses more ROM but saves the second sprite for enemies and items still on the ground. I used a variable I named "p0type" to indicate which what the player was carrying. Say, 1 for yellow key, 2 for sword, etc.. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted October 3, 2022 Share Posted October 3, 2022 On 9/30/2022 at 9:10 AM, Gemintronic said: In my game Knabber Rob I change the player sprite to one with the item as part of the sprite (on top of his head). This uses more ROM but saves the second sprite for enemies and items still on the ground. I used a variable I named "p0type" to indicate which what the player was carrying. Say, 1 for yellow key, 2 for sword, etc.. I really like this idea. I can imagine doing things like just having a taller sprite and just changing the sprite height too depending on if it has something “grabbed” 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted October 3, 2022 Share Posted October 3, 2022 6 hours ago, KevKelley said: I really like this idea. I can imagine doing things like just having a taller sprite and just changing the sprite height too depending on if it has something “grabbed” I play with the player0pointerlo, player0pointerhi values to shorten sprites and/or hide parts of a sprite. But, I haven't mastered it by any means. Using them is so obscure even R.T.s amazing batari BASIC Command Reference has almost zero entries. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted October 3, 2022 Share Posted October 3, 2022 3 hours ago, Gemintronic said: I play with the player0pointerlo, player0pointerhi values to shorten sprites and/or hide parts of a sprite. But, I haven't mastered it by any means. Using them is so obscure even R.T.s amazing batari BASIC Command Reference has almost zero entries. Yeah; they aren't in the manual since they aren't really part of bB per se - they are variables used "under the hood". I'm curious how you use these pointer variables for the effects that you mentioned. For shortening sprites I would think it would be easier to decrease the playerXheight variable. 1 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.