Re: [stella] AOTM AFOS

Subject: Re: [stella] AOTM AFOS
From: zu03776 <zu03776@xxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Jun 2004 22:18:50 -0500
S> Recently, I made my first try to make something playable. It took
S> me 3 days of almost non-stop programming, and tons of frustration.

What did you find frustrating about writing the code?  [reads code]
Oh, pretty much everything.  :)  I feel like that alot.  So many
mysteries of timing.  I like how you solved the asymmetric playfield
problem.  <:

S> I know that at this stage it is rather "something" than a game, but
S> if you could look at this (and the code) I'd be extremely grateful.

I found your "something" interesting from a sound and color palette
standpoint.  The two-voice harmonies are very nice on the title
screen.  I may have to borrow that myself...

S> This code is probably the most
S> inefficient code you all ever seen... but I had to start with
S> something. I wonder if there are some hints about optimization I
S> could use.

Ideas are more important than optimization.  There's plenty of people
who can help tweak code and get features implemented.
As Knuth once said, "Premature optimization is the root of all evil."

As suggestions, it's too easy to fire at the UFO in the mid-game,
since it always starts in the same place.  If you used a byte of
memory to "count frames (0-255)", and then used that byte as the start
position of the UFO instead of always using #200, it would be more
challenging (along with the UFO direction, use the low bit of the
frame byte for the starting direction.)  Maybe something like this...

       LDA FrameCount
       CMP #30       ; compare value in FrameCount to #30
       BCS UfoLowOK  ; if greater than or equal, it's fine
       LDA #30
       CMP #180      ; compare value to #180
       BCC UfoHighOK ; if less than #180, it's fine
       LDA #180

In the later, "how can it drop that fast?!" stages, this is not so
important.  Hitting that tiny UFO object is nearly impossible!

I think this is a great game.  I've now spent over an hour playing it.
On the list of bugs, the last player death doesn't activate the "you
died" screen.

I'm still puzzling over how you position the UFO; it looks like you
just set the HMP1 and let Stella do her thing at HMOVE time.  But the
initial position of the UFO, where's that set?

There is some easy fruit for optimization, like at the RestOfCode
label, why not try:

        LDA Player_Missile_Y            ;now, we move the missile
        BEQ NoMovePlayerMissile
        ADC #8
        CMP #234  ; is value in A greater than or equal to #234
        BCC NoMorePlayerMissile
        LDA #0    ; reset missile position to zero
        STA Player_Missile_Y

Current Thread