disjaukifa Posted September 20, 2009 Share Posted September 20, 2009 Hey Guys, Hoping I can get some help here. I have been reading for hours and I can't figure out how to make enemy ships. I really could use a tutorial to help me out here. Also I keep seeing this about frames and I don't exactly understand them. If someone could give me a good tutorial or even a simple piece of code that showed how either works, I can not tell you how helpful that would be!!!! I feel bad for starting a thread about this, but I have search this forum for the past two hours looking for the information I need and I just can't seem to find it!!!! Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted September 20, 2009 Share Posted September 20, 2009 If you're using player0 for the ship at the bottom, use player1 for the enemy ship (or vice versa.) You can also have players 2, 3, 4, and 5 be more enemy ships if you use the multisprite kernel. 1 Quote Link to comment Share on other sites More sharing options...
bongomeno Posted September 20, 2009 Share Posted September 20, 2009 Or you could only use player0 for the player and player1 for the enemies and simply flicker it in different places as if you are using many sprites. I am doing that in a game I am working on and it works fine. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 Or you could only use player0 for the player and player1 for the enemies and simply flicker it in different places as if you are using many sprites. I am doing that in a game I am working on and it works fine. How exactly do you do that? I am about to post what I have in my other thread which I admit is not much, but considering I have only been doing this since friday, I am happy with it. What worried me is I think I am going to have to upgrade this program to a 8k, only have 2167 bytes of space left, which I know is 2K but still, I am a little concerned. But I digress, can you send a me a code sample so I can see how its done? Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted September 20, 2009 Share Posted September 20, 2009 (edited) Player0 and Player1 can be on the screen at the same time. There's no need to flicker it if you want only one ship. I would go with the multisprite kernel on this if you want more than one. Just put in "set kernel multisprite" at the beginning at the program, then use players 2-5 as if they were players 1 and 0. Of course the playfield must be symmetrical, but you appear not to have any pfblocks in your program, so that doesn't matter. Edited September 20, 2009 by atari2600land 1 Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 Player0 and Player1 can be on the screen at the same time. There's no need to flicker it if you want only one ship. I would go with the multisprite kernel on this if you want more than one. Just put in "set kernel multisprite" at the beginning at the program, then use players 2-5 as if they were players 1 and 0. Of course the playfield must be symmetrical, but you appear not to have any pfblocks in your program, so that doesn't matter. Yeah I was reading about that, I might try tomorrow, I was hoping to have more than 5 enemy ships at one time but maybe I can modify their attributes so that they do not explode of the fire shot . . . . hmmm that is a really good idea atari2600land!!!! Thanks for all your responses, its really helpful! -Disjaukifa Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 Or you could only use player0 for the player and player1 for the enemies and simply flicker it in different places as if you are using many sprites. I am doing that in a game I am working on and it works fine. Hey if you get a chance please send me that code on how to flicker the image, I think it would be good to know regardless Player0 and Player1 can be on the screen at the same time. There's no need to flicker it if you want only one ship. I would go with the multisprite kernel on this if you want more than one. Just put in "set kernel multisprite" at the beginning at the program, then use players 2-5 as if they were players 1 and 0. Of course the playfield must be symmetrical, but you appear not to have any pfblocks in your program, so that doesn't matter. Hey I was just messing with that set kernel multisprite option and now I can't seem to get my player1 enemy ship to appear on the screen anymore. Do I have to put player1 symmetrically on the screen as well? Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
bongomeno Posted September 20, 2009 Share Posted September 20, 2009 (edited) well here is an example snippet of code to flicker an image: enemy=enemy+1 if enemy>1 then goto enemy2 player1: 000000 %01000010 000000 000000 %01000010 %01111110 000000 000000 end player1x=enemy1x player1y=enemy1y goto skipenemy enemy2 if enemy>2 then goto e3 player1: 000000 %01000010 000000 000000 %01000010 %01111110 000000 000000 end player2x=enemy2x player2y=enemy2y goto skipenemy e3 if enemy>3 then goto skipenemy player1: 000000 %01000010 000000 000000 %01000010 %01111110 000000 000000 end player2x=enemy2x player2y=enemy2y skipenemy if e=3 then e=0 sumthin like that that way player1 is in a different spot each loop EDIT: THIS EDITOR DOES SOMETHING WIERD TO MAH CODEZ!! Edited September 20, 2009 by bongomeno 1 Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 20, 2009 Share Posted September 20, 2009 Hey I was just messing with that set kernel multisprite option and now I can't seem to get my player1 enemy ship to appear on the screen anymore. Do I have to put player1 symmetrically on the screen as well? The symmetric thing is only for playfield data. The multisprite kernel doesn't use the same variables for player1 that the regular kernel does. You're probably not using the right variables... From RT's online copy of the bB guide: ...The virtual sprites also are given their own virtual color and NUSIZ registers. COLUP2-COLUP5 and NUSIZ2-NUSIZ5 correspond to sprites 2-5. For sprite 1, use _COLUP1 and _NUSIZ1. Although these look like TIA registers, they are not; they point to the 2600's RAM. The actual TIA registers COLUP1 and NUSIZ1 can be set but they will probably have no effect in the multisprite kernel... Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 Hey I was just messing with that set kernel multisprite option and now I can't seem to get my player1 enemy ship to appear on the screen anymore. Do I have to put player1 symmetrically on the screen as well? The symmetric thing is only for playfield data. The multisprite kernel doesn't use the same variables for player1 that the regular kernel does. You're probably not using the right variables... From RT's online copy of the bB guide: ...The virtual sprites also are given their own virtual color and NUSIZ registers. COLUP2-COLUP5 and NUSIZ2-NUSIZ5 correspond to sprites 2-5. For sprite 1, use _COLUP1 and _NUSIZ1. Although these look like TIA registers, they are not; they point to the 2600's RAM. The actual TIA registers COLUP1 and NUSIZ1 can be set but they will probably have no effect in the multisprite kernel... I just read up on that, and I think that is what my problem, however I can seem to get the code to compile, I changed my player1 to _NUSIZ1 and everywhere I use _NUSIZ1 it tells me its an unknown variable. I have the set kernel multisprite set, so am I just doing something blatantly wrong here? Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 20, 2009 Share Posted September 20, 2009 You'll sometimes find that a syntax error elsewhere will trigger this kind of odd error. Without the source code its hard to say more. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 (edited) You'll sometimes find that a syntax error elsewhere will trigger this kind of odd error. Without the source code its hard to say more. Ok I have attached my code. Here is how I define player1 without the multisprite kernel if hit=0 then player1 %00111100 %01000010 %10011001 %10011001 %10011001 %01000010 %00111100 end Then you can move it and do collision detection with it on the screen as well. When I do that for the set kernel multisprite I can seem to get player 1 to show up on the screen, HOWEVER I was just messing with it and I can hit player1 which is of screen sometimes I just noticed because my points counters goes up. I have attached the binary and source. Let me know what you think. I have posted my code as well, its kind of a mess but I have tried to label everything. What I don't understand is am I suppose to define player1 sprite with _NUZIS1? I have tried doing that and I get a syntax error. Thanks Disjaukifa multi_earth_invaders.bas.bin multi_earth_invaders.bas Edited September 20, 2009 by disjaukifa Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted September 20, 2009 Share Posted September 20, 2009 Check out the code here and see if it is helpful: http://www.atariage.com/forums/blog/90/entry-4002-bbasic-adding-some-collision-detection/ 1 Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 Check out the code here and see if it is helpful: http://www.atariage.com/forums/blog/90/entry-4002-bbasic-adding-some-collision-detection/ That link was very helpful . . . this is SO impressing . . . I forgot to set the color, so the ship was always there . . . it was just the same color as the backgroud. So YEAH thank you so much for all the information, I am noticed my code does not utlitze goto but so far that hasn't been an issue . . . . but that might change. Thank you so much for all your help!!!! -Disjaukifa Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 20, 2009 Author Share Posted September 20, 2009 (edited) Hey Guys, I just noticed that my ships changes size or something when you move it to the left of the screen. Is this a bug with the multisprite??? Nevermind, I had a weird variable setting. I have question about flickering, you won't notice a flicker as long as its not in the same Y-axis meaning the following: Y Y Y no flicker Y Y Y Flicker Correct??? Thanks Disjaukifa Edited September 20, 2009 by disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 21, 2009 Share Posted September 21, 2009 It's the other way around. The multisprites flicker when they're all in a horizontal line. YYYY = lots of flicker Y Y Y Y = no flicker Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 21, 2009 Author Share Posted September 21, 2009 It's the other way around. The multisprites flicker when they're all in a horizontal line. YYYY = lots of flicker Y Y Y Y = no flicker Thank you RevEng!!! I thought I might have it backwards. I'm just one of those people that has to "see" it to understand it if you know what I mean. Let me ask anyother question to go with the one you just answer. If I do the following will I have flicker? P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 being Player1 etc on the multisprite kernel. Since none of them are on the same horizontal line, it shouldn't flicker right? Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 21, 2009 Share Posted September 21, 2009 The multisprite kernel actually uses the real P1 to draw all of the virtual P1 through P5 sprites. So any of the following will cause *some* flicker... P1 P2 P2 P3 P3 P4 You are guaranteed to get no flicker in the following cases... P0 P1 P0 P3 P0 P4 In the example you gave... P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 ...you'd probably get a whole lot of flicker. If you're looking to recreate a Space Invaders pattern without flicker you need a custom kernel. This requires a deep understanding of assembly language and VCS internals. You might instead try grouping your ships more organically or staggered vertically, and you also may want to use one of the virtual sprites for your ship instead of P0, since the other sprites won't frequently sit in a horizontal line with your ship. (though that will complicate collision detection) Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 21, 2009 Author Share Posted September 21, 2009 The multisprite kernel actually uses the real P1 to draw all of the virtual P1 through P5 sprites. So any of the following will cause *some* flicker... P1 P2 P2 P3 P3 P4 You are guaranteed to get no flicker in the following cases... P0 P1 P0 P3 P0 P4 In the example you gave... P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 P1 P2 P3 P4 P5 ...you'd probably get a whole lot of flicker. If you're looking to recreate a Space Invaders pattern without flicker you need a custom kernel. This requires a deep understanding of assembly language and VCS internals. You might instead try grouping your ships more organically or staggered vertically, and you also may want to use one of the virtual sprites for your ship instead of P0, since the other sprites won't frequently sit in a horizontal line with your ship. (though that will complicate collision detection) Wow thanks for the writeup RevEng. that is all really good information to take into consideration. I posted this last night on my Earth Invaders thread, I am currently scrapping most of the code except for the player and enemy designs I have. I wrote everything in just the main loop of the program and when I tried to separate it into subroutines, I couldn't get anything to work. I am not sure I want that many enemys on the screen at one, I was thinking about just have 4 of 5 and making them really difficult to defeat. After the information you just gave me, which is very informative, I think I will just have 4 ~ 5 ships on the screen. Thanks Disjaukifa Quote Link to comment Share on other sites More sharing options...
+batari Posted September 22, 2009 Share Posted September 22, 2009 Let me repost my Invaders demo. This uses the standard kernel and has no flicker. Feel free to use parts of this code in your own games. bBinv8.bas bBinv8.bas.bin Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 22, 2009 Author Share Posted September 22, 2009 Let me repost my Invaders demo. This uses the standard kernel and has no flicker. Feel free to use parts of this code in your own games. Hey Batari, Thanks for the code sample, I will have to look at it, I am very interested to see how you did that. I'm in the middle on a re-write at the moment because I didn't know what I was doing . -Disjaukifa Quote Link to comment Share on other sites More sharing options...
RevEng Posted September 22, 2009 Share Posted September 22, 2009 I am very interested to see how you did that. NUSIZ0/NUSIZ1 is the key. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 22, 2009 Author Share Posted September 22, 2009 I am very interested to see how you did that. NUSIZ0/NUSIZ1 is the key. I know I have said this before but I really really need to read up on NUSIZ0 and NUSIZ1, sounds like they are the solution to alot of my issues I am having with Earth Invaders. -Disjaukifa Quote Link to comment Share on other sites More sharing options...
+batari Posted September 22, 2009 Share Posted September 22, 2009 NUSIZ0/1 is only part of it. This uses the standard kernel, and both sprites are tall sprites consisting of all invaders. They are both black in color, and the invaders are actually invader-shaped holes - what you are seeing are playfield blocks through the holes. The trick is to keep the playfield blocks and invader holes aligned and just turn off the individual playfield blocks when an invader is shot. If you modify the source and change the background color and sprite colors, you can see how this works. It has been over 3 years since I've played with this, so I don't remember all of the details. Quote Link to comment Share on other sites More sharing options...
disjaukifa Posted September 22, 2009 Author Share Posted September 22, 2009 Hey Guys, I have a different question, but this is something I have been wondering. Lets say I have a two player game and both players are going to look exactly the same, is there a way I can write a subroutine or generic player that player0 and player1 could be assigned? For instance have something like this player: %11111111 %10000001 %10000001 %10000001 %10000001 %10000001 %10000001 %11111111 end player0=player player1=player I trying to figure out how to reuse code instead of having to copy could which takes up alot of space very quickly. Thanks Disjaukifa 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.