Jump to content
IGNORED

Batari Basic Question


Recommended Posts

Hi all

 

I've been having a go with Batari Basic and I've found a strange bug with my game that I don't know whether it is a limitation of the engine or something I'm doing stupid!

 

I'm trying to scroll the enemy player from right to left and when it reaches the left-hand side of the screen, restart from the right at a random y position.

 

It works - but sometimes, when the enemy sprite is scrolling right to left, it goes all the way to the side of the screen and sometimes it only gets 2/3s of the way there and then restarts.

 

I used the code:

if l=1 || player1x=0 then player1x=150: player1y=(rand&76)+9: goto jump2
player1x=player1x-1
Note l is just the loop iteration so starts the enemy sprite moving on first iteration
player1 coordinates are not in the code anywhere else other than the initial locations which are outside of the game loop and defined up with the variables.
Any idea why this is happening?
Thanks for any help
TR
Link to comment
Share on other sites

Actually can somebody please help again - I'm tearing my hair out with this!

So using the example above, I added a title screen - and that worked fine, but now I need to add more enemy sprites to make the game that I want to so I need to use either the multisprite kernel or DPC+

I got DPC+ working but the screen area shrunk dramatically and the missile for player0 did not work all of the time - and when it did work it was extremely flickery. I tried to change the screensize using DFxFRACINC but that seems to be more related to playfields than the screen size itself (not sure if I've got that right?). Is there any way to change the screensize to what it was pre-DPC+?

So I tried multisprite kernel and came to conclusion that it won't work with title screens created with the title screen editor (?). So after ripping out my title screen, I'm still failing to compile my code and I'm now getting the error:
2600 Basic compilation failed!
LINE --> set kernel multisprite
--VERBOSE ERROR MESSAGE --
batari Basic v1.01dreveng40 ©2005-2017
Cannot open multisprite.inc for reading

 

I'm using BB.1.1d.reveng40.zip which had worked fine up until this point. I did try using 1.0 instead but that didn't work either.

 

I'm sure I'm doing something stupid but I'm not sure what!! Could anyone please help?

 

Thanks in advance for any help

Link to comment
Share on other sites

Thank you Mountain King - that seems to compile now and has the multisprite kernel so hopefully that means I can this idea of a game working.

However for some reason I seem to have lost the asteroid on screen in your fixed version, not sure why - I'll have a good look through the code.

 

As for the DPC+ version, I was supposed to attach that as well. I did get that working but the screen size became very small I couldn't find a way to push it back to the standard 88 rows resolution.

It should be attached now.

 

Thanks again for your help on this.

Example2.bas

Link to comment
Share on other sites


Mountain King's version of mutisprite


Added rand16

_COLUP1 instead of COLUP1

player1x<9

player1y = (rand&63)+16

moved JUMP2



bytes are 8 bits


bits 0..7 (right to left) are powers of 2

2^0 = 1

2^1 = 2

2^2 = 4

2^3 = 8

etc


AND is (bits)


0 AND 0 = 0

0 AND 1 = 0

1 AND 0 = 0

1 AND 1 = 1


& is a bitwise AND (bytes a & b = c, bits a0 AND b0 = c0, a1 AND b1 = c1, etc)


63 = 00111111 = 32 + 16 + 8 + 4 + 2 + 1

76 = 01001100 = 64 + 8 + 4


you'll only get a bit where you've got two ones

so ANDing something with 76 will only give you numbers

that are the sum of three of 64, 8, 4, 0, 0, 0 (the corresponding power of 2 or 0, for each bit)

that's 8 different possibilities (3 bits set, 2^3 = 8 possibilities)




Example_MK.bas

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...