Rabbit 2600 Posted June 11, 2013 Share Posted June 11, 2013 (edited) I'm fiddling with multisprites, but I can only seem to get player0 and player1 on the screen. What have I done wrong? set kernel multisprite player0x = 50 player0y = 50 player1x = 40 player1y = 40 player2x = 60 player2y = 60 Level_1 COLUP0 = $B6 COLUP1 = $AE COLUP2 = $1E player0: %00100100 %00100100 %00011000 %00011000 %01111110 %00000000 %00011000 %00011000 end player1: %00000000 %00000000 %10000001 %01111110 %00100100 %00100100 %01111110 %10000001 end player2: %00000000 %00000000 %10000001 %01111110 %00100100 %00100100 %01111110 %10000001 end drawscreen goto Level_1 Edited June 11, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted June 11, 2013 Share Posted June 11, 2013 In multisprite mode, COLUP1 should be replaced with _COLUP1 (note the underscore.) Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 11, 2013 Author Share Posted June 11, 2013 Ahh, cheers =) Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 11, 2013 Author Share Posted June 11, 2013 (edited) Hm, I can make player1 move about, but not player2. How come? EDIT Nevermind, managed to get movement on the other players going Edited June 11, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 11, 2013 Author Share Posted June 11, 2013 (edited) About collisions, how do I set up collisions between missile0 and player2-4? Source - default.bas Edited June 11, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 12, 2013 Share Posted June 12, 2013 I dunno if this will work. You need to do collisions with virtual sprites in software. This uses all the temp variables as arguments. You must use them to fill in the boundaries of the missile0 and then the boundaries of the second object you want to test to see if its intersecting. _function softcol_missile0 _rem x1 as missile0x, y1 as missile0y, x2 as temp1, y2 as temp2, x3 as temp3, y3 as temp4, x4 as temp5, y4 as temp6 _if missile0x > temp5 then return 0 _if temp1 < temp3 then return 0 _if missile0y > temp6 then return 0 _if temp2 < temp4 then return 0 _return 1 end Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 Ahh! I'm gonna have a go and see if I can get things working. Thanks! (first time I'm working with "temp" Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 (edited) Hm, do I just copy and paste it, or do I need to edit it in some way? I'm not sure I understood. Edited June 12, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 12, 2013 Share Posted June 12, 2013 Hm, do I just copy and paste it, or do I need to edit it in some way? I'm not sure I understood. Nah, I didn't (and continue not to) explain how it works properly. Before you use the function you have to fill out the far x and far y values for missile0 - not just the origin (missile0x & missile0y). Then you have to fill the other temp variables with the origin x and origin y and far x and far y of whatever you want to check for collisions. Again, I'm being a dork and not explaining it properly. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 (edited) Hm, how are values for far set up? Edited June 12, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 12, 2013 Share Posted June 12, 2013 Hm, how are values for far set up? Normally stuff like missile0x and missile0y just refers to the very top-left edge of the sprite (I think?) for software collision you need to specify the top-left coodinates AND the bottom right x/y values. I'm afriad I'm not good at explaining this because honestly *I'm* having a tough time grasping software collisions Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 Aha, then atleast I know what it is =) Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 I think I need a good clean example.bas if I'm ever gonna understand this. =/ Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted June 12, 2013 Share Posted June 12, 2013 About collisions, how do I set up collisions between missile0 and player2-4? IIRC Player1 represents all of the players 1-5, so your command "if collision(missile0,player1) then player1x = 255 : player1y = 255" should work for all of them (for the collision part anyway). You might have to repeat the collision command for each player, as in "if collision(missile0,player1) then player2x = 255 : player2y = 255" etc. I'm really rusty so I'm not sure if my comments are correct or not. Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 12, 2013 Author Share Posted June 12, 2013 Hm, now things are beginning to happen. I have experimented with the same thing you describe. "if collision(missile0,player1) then player1x = 255 : player1y = 255" Works. But when adding "if collision(missile0,player1) then player2x = 255 : player2y = 255" both player1 and player2 dissapears. Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted June 13, 2013 Share Posted June 13, 2013 Hm, now things are beginning to happen. I have experimented with the same thing you describe. "if collision(missile0,player1) then player1x = 255 : player1y = 255" Works. But when adding "if collision(missile0,player1) then player2x = 255 : player2y = 255" both player1 and player2 dissapears. I would try changing the location of player2 to a different location of player1 to see what happens. Something like: if collision(missile0,player1) then player1x = 255 : player1y = 255 : player2x = 255 : player2y = 245 Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 13, 2013 Author Share Posted June 13, 2013 Hm, I still get the same effect. Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 13, 2013 Share Posted June 13, 2013 Here is the same collision function except for a Sega Genesis dialect of BASIC: declare function rectRect(x1 as integer, y1 as integer, x2 as integer, y2 as integer, x3 as integer, y3 as integer, x4 as integer, y4 as integer) as integer if x1 > x4 then return 0 if x2 < x3 then return 0 if y1 > y4 then return 0 if y2 < y3 then return 0 return 1 end function x1 is the origin x coordinate for sprite 1 x2 is the far x coordinate for sprite 1 y1 is the origin y coordinate for sprite 1 y2 is the far y coordinate for sprite 1 x3 is the origin x coordinate for sprite 2 x4 is the far x coordinate for sprite 2 y3 is the origin y coordinate for sprite 2 y4 is the far y coordinate for sprite 2 Basically, the routine checks to see if any of those coordinates intersect. You could remake this soft collision routine in batari BASIC in your own fashion. Maybe that would work better! Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 13, 2013 Author Share Posted June 13, 2013 I'll experiment with it and see if I can make something work =) Another question, this time about the playfield. I find it extremely hard to make levels when everything is inverted. I can't even make a box outline, any words on what lines I should focus on? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 13, 2013 Share Posted June 13, 2013 I'll experiment with it and see if I can make something work =) Another question, this time about the playfield. I find it extremely hard to make levels when everything is inverted. I can't even make a box outline, any words on what lines I should focus on? Are you using VisualbB to create your playfields? It has a check box for a mirrored playfield. I gotta admit it IS hard to get used to drawing a mirrored playfield Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 13, 2013 Author Share Posted June 13, 2013 (edited) Yeah, I'm using VBB to make playfield, didn't know it had that feature, thanks =) Made a playfield with the mirror feature, but the screen has to be half the size it would normaly be, can it be expanded? Edited June 13, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 13, 2013 Share Posted June 13, 2013 Yeah, I'm using VBB to make playfield, didn't know it had that feature, thanks =) Made a playfield with the mirror feature, bit only half shows =/ I got nothin for ya dude. I just created a new playfield IMMEDIATLY checked [x] mirrored playfield Set the Playfield Color to something Started drawing without issue. Also, to create the sides of a boxed-in playfield, remember you can use PF0 =%11111111 just before the drawscreen command to create a border on the sides. http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#pf0 Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 13, 2013 Author Share Posted June 13, 2013 (edited) Ahh, cheers! Got the playfield working as I want it now =) Managed to get the player to go to a randomly selected room when exiting through a door too, and make him come out at the correct coordinates! Yay me! Edited June 13, 2013 by Rabbit 2600 Quote Link to comment Share on other sites More sharing options...
accousticguitar Posted June 13, 2013 Share Posted June 13, 2013 How about this? if g = 1 then player0x = 120 : goto Level_1 if g = 2 then player0x = 120 : goto Level_2 if g = 3 then player0x = 120 : goto Level_3 Quote Link to comment Share on other sites More sharing options...
Rabbit 2600 Posted June 13, 2013 Author Share Posted June 13, 2013 (edited) Thanks accousticguitar! Having a wee bit of memory issue here. I'm not that experienced with memory saving tricks so I'm asking, is there anything I can do with my code to save some memory? SOURCE - default.bas Edited June 13, 2013 by Rabbit 2600 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.