retroshaun Posted August 31, 2012 Share Posted August 31, 2012 OK... another probably stupid question. I have a playfield set up in DPC+ with the screen res set with DF(0-3)FRACINC. All looks good. I have now added 3 sprites (player 0-2) and all I am doing is displaying them in a line across the screen and then I have a subroutine to increment their Y position so they effectively move down the screen, top to bottom. The weird part is, if I start them anywhere on the visible screen, they don't move at all!! However if I start them off screen (for example at Y=200) then they move just as expected, starting right at the screen top and moving off the bottom then cycling to the top again. What the hell? Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 31, 2012 Share Posted August 31, 2012 (edited) Best way to get help is to attach your code, it's hard to debug what you can't see. I just saw your other post about "non-internet laptop". Do you have a way to transfer files between it and the computer you're using online? Floppy, USB stick, etc. Edited August 31, 2012 by SpiceWare 1 Quote Link to comment Share on other sites More sharing options...
retroshaun Posted September 1, 2012 Author Share Posted September 1, 2012 No I was at work (long story on the internet thing!). At home now so all is well. I think theres a fundamental thing I am simply not "getting" about DPC+. I am playing around now with this code, simply setting the default Y position in a var and assigning that to player0y with... "unexpected" results. I can cycle through 0, 10, 20 etc but when I hit, for example, 60... the sprite disappears completely. Most odd. How is the screen space addressed? I have screen res and init set up as follows, and I admit to not really understanding the bank code at present, which may well be the problem! set kernel DPC+ set smartbranching on set optimization inlinerand set kernel_options collision(playfield,player1) set tv ntsc goto StartInBank2 bank2 bank 2 temp1 = temp1 StartInBank2 DF0FRACINC = 32 DF1FRACINC = 32 DF2FRACINC = 32 DF3FRACINC = 32 DF4FRACINC = 64 And the main sprite update code is: dim ey = 10 player0x = 30 main gosub moveSprites player0y = ey drawscreen goto main moveSprites ey = ey + 1 return Like I said - its **very** basic at this point as I am only experimenting. But as its set, this doesnt display the sprite. If I initially set player0x to, for example, 200... it works as expected. Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 1, 2012 Share Posted September 1, 2012 dim ey = 10 This isn't how you use dim. The item on the right of the equal sign should be a predefined bB variable, and the purpose of the command is to give that variable another name. (to make your code readable.) For the code you wrote here, I'd expect bB to set the label "ey" to memory location 10, which is a TIA hardware register... screwy results will naturally follow. Check out the dim section of the bB guide at Random Terrain's site for more info. [edit] also worth mentioning that there's no reason you can't directly manipulated player0y; "player0y=player0y+1" works just fine. Quote Link to comment Share on other sites More sharing options...
retroshaun Posted September 1, 2012 Author Share Posted September 1, 2012 (edited) dim ey = 10 This isn't how you use dim. The item on the right of the equal sign should be a predefined bB variable, and the purpose of the command is to give that variable another name. (to make your code readable.) For the code you wrote here, I'd expect bB to set the label "ey" to memory location 10, which is a TIA hardware register... screwy results will naturally follow. Check out the dim section of the bB guide at Random Terrain's site for more info. [edit] also worth mentioning that there's no reason you can't directly manipulated player0y; "player0y=player0y+1" works just fine. Ahhh OK I got it - I was reading some stuff on DIM in another post and I guess what was written there was incorrect. That would explain it Yes I realized I could increment player0y directly but I need to track the value for another use. Thanks! EDIT: All is working just fine now, thanks! Edited September 1, 2012 by retroshaun Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 1, 2012 Share Posted September 1, 2012 Glad it's working for you! Quote Link to comment Share on other sites More sharing options...
GodzillaIsMyCopilot Posted September 1, 2012 Share Posted September 1, 2012 I opened this thread, thinking it was some kind of video game character civil rights post. Boy, was I suckered. 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.