My 1K Game Attempt
BreakthroughGame design by Dan Troyka (playable demo with dumb AI)Breakthrough is a fast paced board game with easy-to-learn rules. The winner is the first to get one of 14 pieces across to the last row. Pieces move forward one square vertically or diagonally, and they can capture diagonally. Because pieces always move forward, games end quickly. There are no draws.Your side is Silver. To move a piece, place the cursor there, hold the fire button, and push left or right to move diagonally or up to move vertically.Whether I succeed in making this a 1K game depends on how compact I can make the game logic and AI. I chose Breakthrough because the rules are so simple. I admit it's a long shot, but since I submitted a game last year, I feel comfortable taking more of a risk.The kernel alone is 580 bytes right now, but there is a lot of room for optimization. I could have re-used the Four-Play kernel, but it was fun to come up with something new. Does anyone care to guess how I managed 7 sprites with color changes (without using z26 tricks)? EDIT: Solved by supercat.For more information about Breakthrough, try Wikipedia.Here is the code for drawing and coloring the 7 shields:
;Values loaded by PLA serve three purposes. The high nybble;is used for shifting missiles, and the low nybble provides;shield color shading and also serves as an index for;looking up shield graphics.PLA_these .byte $0e,$0e,$0e,$0c,$0c,$0c,$0a,$0a,$0a,$08,$08,$08 .byte $F6,$06,$06,$F5,$05,$F4,$00DynamicCode sta HMOVE; Covers left stripe and moves missiles jmp StaticCode; Next few lines do not need to be in RAM. StaticCode ; These lines are separated in the actual code ora #$10; loaded by PLA. ORA forces color to gold tay ; number also serves as an index lda shield-16,y; obtain shield graphics. sta GRP0 sta GRP1+64-CURSORCOLOR,X; same as STA GRP1, but 1 cycle longer tya ; and #$0F; Forces color to silver jmp BackToRAMBackToRAM sta COLUP1; 1st piece. STA draws a silver shield sax COLUP1; 2nd piece. SAX draws a blank sty COLUP0; 4th piece. STY draws a gold shield stx COLUP1; 3rd piece. STX draws the cursor. ldx M0size-16,y stx NUSIZ0 ldx #CURSORCOLOR;The low nybble of X must be 0. sta COLUP0 sta COLUP1; M1: left side of 7th sprite sty COLUP0 sta COLUP0; M0: right side of 7th sprite pla sta HMM0 and #$1F ; Changes right shift to left sta HMM1 bne DynamicCode jmp ReturnFromDynamicCode; Will be changed to BRK during optimization
P.S. Manuel, you were actually right when you guessed I was doing a racing game! I only denied it before because I was thinking of something like Pole Position.
13 Comments
Recommended Comments