Jump to content
IGNORED

Space Wars - game in development


sometimes99er

Recommended Posts

A motion of 16 (>10) with XB moves a sprite one pixel every frame. The lower 4 bits of the motion parameter are auxiliary data. If you have a motion of one (>01) it will add to the auxiliary data 16 times before the sprite is moved one pixel.

 

I use 16 bit words in CPU RAM with the upper 8 bits being the sprite position. Sprite motion etc. is handled with 16 bit operations (A), and the actual sprite location is then handled (transfered to the VDP) with a simple 8 bit operation (MOVB).

 

I use a 20 word lookup table for sine and cosine. I was sure I could use the same table to fire the missile, but it proved a challenge. Main problem was, with a location (sprite is without fraction), you can add without moving it, but you only need subtract once to move it. So I had to get position of spaceship, loose fractions, and then add to internal location to locate between pixels and go from there. Well, if I wanted missiles to shoot perfectly.

 

:)

Edited by sometimes99er
  • Like 2
Link to comment
Share on other sites

I've been thinking about how to store the map.

 

So I made an initial tile template. Half bitmap. 8 characters wide and 32 characters high. The upper part of characters has horizontal wall designs, and the lower part has vertical walls.

 

My map data structure becomes, one word for screen location or end of map, one byte for starting character (tells if we're going horizontal or vertical) and one byte for length. Horizontal walls are 2 characters high, and vertical walls are 3 characters wide.

 

This test screen below has a map size of 78 bytes. A perhaps more traditional layout of 2 by 2 character tiles for the complete screen would always have 768 / 2 / 2 = 192 bytes per screen. 25 screens would then take 4,800 bytes. Perhaps with a bit of compression. Perhaps 4 by 4 characters would do. That would only be 48 bytes per screen, but I'd only have 16 tiles, unless I went full bitmap. And then I guess there has to be room for damage meter, score etc.

 

It would be nice not to edit maps by hand in data statements. And I think it would be easier for me to make a new and dedicated mapper rather than forking or shoehorning into Magellan.

 

Maybe I should define each room by the exits and have a random seed cleverly draw the rest.

 

spacewar15.png

Edited by sometimes99er
  • Like 8
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...