Jump to content
Sign in to follow this  
esplonky

problem, PLEASE HELP!

Recommended Posts

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

Share this post


Link to post
Share on other sites

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).

  • Like 1

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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 by RevEng

Share this post


Link to post
Share on other sites

thanks! that's why it was black because the playfield was not working, thanks a ton!

Share this post


Link to post
Share on other sites

i want to make the background green, and the characters skin color, like 2e colored. how do i do that?

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...