Re: [stella] Confused newbie...

Subject: Re: [stella] Confused newbie...
From: Kevin Lipe <kevin.lipe@xxxxxxxxx>
Date: Wed, 6 Oct 2004 18:18:38 -0500
Thanks... the only place on this screen that the sprites can't go are
the far left and far right pixels of the playfield, which are the
walls of the five-level thing... so would I just remove the smallest
and largest values from posLst and make that work?

Also, in your code you reference the posLst, list of horizontal
positions... what would this look like? I don't understand how to make
such a list in my code.

Thanks for all the help, I'm now on my way to having a game, or at
least a moving sprite :)

~ Kevin


On Wed, 6 Oct 2004 09:23:49 +0200, Thomas Jentzsch <tjentzsch@xxxxxx> wrote:
> Kevin Lipe wrote:
> > What would be the best way to position sprites and such in a kernel
> > for the game concept I was talking about in the above thread? Attached
> > is the code I've got right now, which just makes a really pretty
> > playfield and nothing else.
> 
> I suppose you want to reposition your sprites *inside* the kernel, right?
> 
> The most simple code for this would look like this:
>   ldx   index    ; the current sprite index
>   lda   posLst,x ; a list containing all horizontal positions (0..159)
>   sta   WSYNC
> ----------------
>   sec            ; 2
> .wait:
>   sbc   #15      ; 2
>   bcs   .wait    ; 2/3
>   eor   #$07     ; 2
>   asl            ; 2
>   asl            ; 2
>   asl            ; 2
>   asl            ; 2
>   sta   HMP0     ; 3
>   sta.w RESP0    ; 4  @23+n*5
>   sta   WSYNC    ; 3
> ----------------
>   sta   HMOVE
> 
> This is however a general solution, which allows positioning sprite 0 across
> the whole screen and uses one whole scanline
> 
> For your kernel you may need something more specialized, e.g.
> - objects cannot move accross the whole screen, so you can free some
>   cycles for other kernel stuff
> - you don't have that much free time inside your kernel, then you should
>   calculate the fine and coarse positioning values outside the kernel. This
>   saves a few cycles and allows additional tricks (e.g. two different codes
>   for positioning objects on the left and right, giving you more free cycles
>   for other stuff)
> - ...
> 
> So this can get quite complicated later, but for a start I suppose using
> something like the code above.
> 
> Have fun!
> Thomas
> _______________________________________________________
> Thomas Jentzsch         | *** Every bit is sacred ! ***
> tjentzsch at web dot de |
> ____________________________________________________
> Aufnehmen, abschicken, nah sein - So einfach ist
> WEB.DE Video-Mail: http://freemail.web.de/?mc=021200
> 
> 
> 
> 
> Archives (includes files) at http://www.biglist.com/lists/stella/archives/
> Unsub & more at http://stella.biglist.com
> --+----------------------------------------------------------------
> You are subscribed as: kevin.lipe@xxxxxxxxx
> To unsubscribe, send email to:
>   stella-unsub-191764@xxxxxxxxxxxxxxxxxx
> Or go to:
>   http://stella.biglist.com/unsub/stella/kevin.lipe@xxxxxxxxx
> --+--
> 
>

Current Thread