esplonky #1 Posted January 6, 2011 okay, first i had a compile problem but it turned out that i didnt indent right, and so i compiled and now all i get is a black screen in stella, and on stella psp if makes random noises. here is the code, if i can get somebody to help me, or to fix it for me that would help alot, thanks! and also, its a .txt file, so you need to copy and paste the code. default.txt Quote Share this post Link to post Share on other sites
Nukey Shay #2 Posted January 6, 2011 Shouldn't data tables be seperate from program code? Your program is using GOTO to jump right to the data (thus misinterpreting the byte values as opcodes and crashing the program). 1 Quote Share this post Link to post Share on other sites
esplonky #3 Posted January 6, 2011 here is the code not in a .txt playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ end COLUBK = $20 COLUPF = 212 player0x=0:player0y=10 player1x=20:player0y=20 missile0height=4:missle0y=255 NUSIZ0 = 16 sprites player0: 000000 %01000100 %01000100 %01000100 111000 111000 111000 111000 111000 111000 111000 111000 111000 %11111110 %10111010 %10111010 %10111010 111000 111000 000000 end player1: 000000 100100 011000 111100 011000 011000 111100 000000 end if missile0y>240 then goto skip missile0y = missile0y-2:goto draw_loop skip if joy0fire then missile0y = player0y-2:missile0x =player0x+4 draw_loop drawscreen if player1y < player0y then player1y = player1y+1 if player1y > player0y then player1y = player1y-1 if player1x < player0x then player1x = player1x+1 if player1x > player0x then player1x = player1x-1 player1x = player1x:player1y = player1y if joy0up then player0y = player0y-1: goto jump if joy0down then player0y = player0y+1: goto jump if joy0left then player0x = player0x-1: goto jump if joy0right then player0x = player0x+1: goto jump if collision(missile0,player1) then score=score+1:player1x=rand/2:player1y=0:missile0y=255 if collision(player0,player1) then score=score-1:player1x=rand/2:player1y=0:missile0y=255 jump goto sprites Quote Share this post Link to post Share on other sites
esplonky #4 Posted January 6, 2011 well i used tinkernut's tutorial, and everyone who used it was succesful, and i'm very new to visual bb so i'm kinda slow at this, so can you show me what it's supposed to look like? Quote Share this post Link to post Share on other sites
+RevEng #5 Posted January 6, 2011 (edited) Shouldn't data tables be seperate from program code? Your program is using GOTO to jump right to the data (thus misinterpreting the byte values as opcodes and crashing the program). With the playfield and player data commands, the data actually gets put elsewhere, away from the code. The assembly code generated by those statements just sets the relevant hi/lo bytes to point to the data. okay, first i had a compile problem but it turned out that i didnt indent right, and so i compiled and now all i get is a black screen in stella, and on stella psp if makes random noises. here is the code, if i can get somebody to help me, or to fix it for me that would help alot, thanks! Problem 1 - the "playfield" keyword wasn't indented. Add a space in front. Problem 2 - you've misspelled "missile0y" as "missle0y" With those changes I was able to compile and run your program correctly. Edited January 6, 2011 by RevEng Quote Share this post Link to post Share on other sites
esplonky #6 Posted January 6, 2011 thanks! that's why it was black because the playfield was not working, thanks a ton! Quote Share this post Link to post Share on other sites
esplonky #7 Posted January 7, 2011 i want to make the background green, and the characters skin color, like 2e colored. how do i do that? Quote Share this post Link to post Share on other sites
+RevEng #8 Posted January 7, 2011 i want to make the background green, and the characters skin color, like 2e colored. how do i do that? You set the background color just by setting the COLUBK variable. The character is created with player0, so you set the COLUP0 variable for it. Check out Random Terrain's batari Basic commands page. If you look up "colors" on the index, it has all kinds of detailed information! Quote Share this post Link to post Share on other sites
Nukey Shay #9 Posted January 7, 2011 COLUBK/COLUP0 aren't variables...but write-only system registers Might as well mention that now so they aren't attempted to be used as read/write variables later. Quote Share this post Link to post Share on other sites
+RevEng #10 Posted January 7, 2011 COLUBK/COLUP0 aren't variables...but write-only system registers Might as well mention that now so they aren't attempted to be used as read/write variables later. Yup, good point. Sometimes I try to simplify too much. Quote Share this post Link to post Share on other sites
esplonky #11 Posted January 9, 2011 i looked at random terrains page and it helped alot! Quote Share this post Link to post Share on other sites
+Random Terrain #12 Posted January 9, 2011 I looked at Random Terrain's page and it helped a lot! Just to be clear for any new users reading this, I maintain that page, but most of the text is from batari. Some text is also from AA members such as SeaGtGruff, RevEng, and Robert M. All I mostly do is edit the page once in a while and add stupid little charts here and there. The info will be moved to an AtariAge wiki one of these days and my version of the page will be deleted. All batari Basic users will finally be able to edit the batari Basic wiki right here at AtariAge. Quote Share this post Link to post Share on other sites