Re: [stella] Generic kernal or just build a game?

Subject: Re: [stella] Generic kernal or just build a game?
From: Manuel Rotschkar <cybergoth@xxxxxxxx>
Date: Mon, 29 Mar 2004 23:07:49 +0200
Hi there!

Just had some more thoughts about playfield destruction.
When you have the PF refelected like this:

PF0 PF1 PF2 PF2 PF1 PF0

The (r)eversed vs. (u)nreversed bit readings should be like

PF0 PF1 PF2 PF2 PF1 PF0
u   r   u   r   u   r

So if you use PF1 and PF2 _only_, you have "r u" repeating twice!
That means, you should get away with one 16 byte AND table, starting
reversed:

disintigratetab
    .byte %11111110
    .byte %11111101
    .byte %11111011
    .byte %11110111
    .byte %11101111
    .byte %11011111
    .byte %10111111
    .byte %01111111
    .byte %01111111
    .byte %10111111
    .byte %11011111
    .byte %11101111
    .byte %11110111
    .byte %11111011
    .byte %11111101
    .byte %11111110

Now you should be able to erase the "right" block horizontally for _any_ possible position with code as simple as:

LDA xpos
LSR
LSR		; divide by 4
SEC
SBC #$04	; skip PF0
AND #$0F 	; limit to our table range
TAX
LDA disintigratetab,X

Cool, or? :-)

Ah, and for your ball it looks like this, right:

x.##..
.####.
######
.####.
..##..

The x is indicating the x/y coordinates where it's drawing starts.
Now, in case of a collision, you have to move the x around, according to your movement direction, for example, when moving straight right:


y.##..
.####.
#####x
.####.
..##..

you should add 5 to the x position and 3 to the y position. so you're not checking which block is on the original coordinates (y), but which block was hit by the rightmost spot of your ball...

Just ideas, hope they help... :-)

Greetings,
	Manuel
----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread