Captain Spazer Posted January 29, 2019 Share Posted January 29, 2019 (edited) I just started fiddling with DPC+, it is awesome, but some things are different so it takes some getting used too. My first question on how to do stuff in DPC+ is: If I want a wider player0 sprite, how do I do that? The usual NUSIZ0= $07 doesn't do anything it seems? EDIT: I found the problem, I placed it in the wrong spot Edited January 29, 2019 by Captain Spazer Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 29, 2019 Share Posted January 29, 2019 NUSIZ0 should work as normal. Make sure it is set in your game loop. Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 29, 2019 Author Share Posted January 29, 2019 Yes, I corrected that mistake. Another question, I know pfscroll 1 4 4 scrolls the pfcolors up, how do I scroll the pfcolors down? Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted January 29, 2019 Share Posted January 29, 2019 Yes, I corrected that mistake. Another question, I know pfscroll 1 4 4 scrolls the pfcolors up, how do I scroll the pfcolors down? It says how right here: randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_pfscroll "The playfield strips are 256 bytes in size, so if you want to scroll down, use "pfscroll 255" to scroll down by 1, "pfscroll 254" to scroll down by 2, and so on." 2 Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 29, 2019 Author Share Posted January 29, 2019 Ahh, I missed that, thank you. Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 30, 2019 Author Share Posted January 30, 2019 (edited) Making progress, I think I'm starting to get the hang of things with dpc+ now, it's still a little tricky but I adore the features, don't know how I managed without them. I have an issue with a piece of code, I'm not sure if it has something to do with how dpc+ works or if it's me that written the code badly, to me it looks fine. The idea is that there is a random chance that a car appears on screen, then travels down, then repeats the cycle of randomly deciding whether to put it back top or not, problem is the code never starts, it's placed in the main loop. Any thoughts? rem player1 is car if d = 0 then (e = rand&3) if d = 0 && e = 2 then d = 1 if d = 1 then player1x = 70 : player1y = 78 : d = 2 if d = 2 then player1y = player1y + 1 : player1x = player1x - 1 if collision(player1,playfield) then player1x = player1x + 1 if player1y > 150 then d = 0 if d = 0 then player1x = 200 : player1y = 200 Edited January 30, 2019 by Captain Spazer Quote Link to comment Share on other sites More sharing options...
+Lewis2907 Posted January 30, 2019 Share Posted January 30, 2019 (edited) It would help if you dim _name = d. This helps to track your variables and if you name it that helps what you want to do.dim appear= adim appear = rand&3If appear = 2 then ....Just a quick FYI, using the old memory bag on this one. Edited January 30, 2019 by Lewis2907 Quote Link to comment Share on other sites More sharing options...
+Lewis2907 Posted January 30, 2019 Share Posted January 30, 2019 http://atariage.com/forums/index.php?app=core&module=attach§ion=attach&attach_id=464717 May help. It's a lot of borrow code. There was a programmer making a Grand Theft Auto style game. I found that code and expanded non it to learn more. My notes are not as detailed as my newer programs, but the thread should help with DPC as I was still learning and the others in the forum helped me. Hope this helps. Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 30, 2019 Author Share Posted January 30, 2019 Thank you for providing the code, it answers a lot of my questions Quote Link to comment Share on other sites More sharing options...
+Karl G Posted January 30, 2019 Share Posted January 30, 2019 I don't know if it will help, but I would try rewriting this line: if d = 0 then (e = rand&3) As this: if d = 0 then e = (rand&3) Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted January 30, 2019 Share Posted January 30, 2019 d also has to be 0 to begin with for it to do anything Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 30, 2019 Author Share Posted January 30, 2019 Collision in DPC+ is something I don't understand quite yet, but if I'm on the right track, I need to see if for example player1y is = to player0y + - height and player1x = player0 + - width? Quote Link to comment Share on other sites More sharing options...
Lillapojkenpåön Posted January 30, 2019 Share Posted January 30, 2019 There's one player0 and nine player1, only way to differentiate between the player1's is by their x and y variables so you create hitboxes, How complex they need to be depends on how your players move If they move left and right and up and down completely freely all over the place you would need to create an entire box let's assume they are both 8 pixels wide if player0x<=player1x+8 then ; if left side of player0 is smaller than or equal to right side of player1 That's a start but it will be true even if player0 is all the way to left side of the screen and player1 all the way to the right, so we need to box it in even more.. if player0x<=player1x+8 && player0x+8>=player1x then ; and right side of player0 is greater than or equal to left side of player1 now it's true if they touch or overlap horisontally, but it will still be true even if one player is at the top of the screen and one at the bottom, so box in some more.. if player0x<=player1x+8 && player0x+8>=player1x && player1y+player1height>=player0y ; and bottom of player1 is bigger than or equal to top of player0 if player0x<=player1x+8 && player0x+8>=player1x && player1y+player1height>=player0y && player1y <= player0y+player0height ; and top of player1 less than or equal to bottom of player0 Now you have a complete box Since boxes are square and most sprites are not you can skip the collision check if there's no hardware detection between player0 and player1 if !collision(player1,player0) then goto _skipcheck ; skips if no pixels are overlapping if player0x<=player1x+8 && player0x+8>=player1x && player1y+player1height>=player0y && player1y <= player0y+player0height then.. if player0x<=player2x+8 && player0x+8>=player2x && player2y+player2height>=player0y && player2y <= player0y+player0height then.. _skipcheck that should make it pixel perfect. This example is very good, he changes the width of player0, so the width is stored in temp5 http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#dpc_collision_detection Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 30, 2019 Share Posted January 30, 2019 I was soon to ask this question regarding collision. I was getting tripped up and making all sorts of weird code to try and get it hammered out. I will have to try this out tomorrow. Hopefully I have time. I have jury duty so plan on sitting around all day at the courthouse. Quote Link to comment Share on other sites More sharing options...
Captain Spazer Posted January 30, 2019 Author Share Posted January 30, 2019 So far so good, that made things work out! Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 30, 2019 Share Posted January 30, 2019 Cool. Quote Link to comment Share on other sites More sharing options...
KevKelley Posted January 30, 2019 Share Posted January 30, 2019 I was confused at first when every time I had a collision between player0 and player 2-4 my player1 sprite kept bouncing around. I had to reread the DPC+ page a few times but had a hard time understanding it at first. 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.