Jump to content
IGNORED

Adding a missile


Recommended Posts

Ok, I've followed Andrews great tutorials and am up to the point where I have a cool lil' guy running around the screen.

 

I am now attempting to add a "missile". I was reading the Stella programmers guide I gathered that to get a missile to display I just had to enable it with

lda #1

sta ENAM0

 

Then at the correct x position (which I just did after the xpositioning code of the player):

sta RESM1

 

I do that straight after the player positioning and I thought i would see a missile that was as tall as my screen a couple of pixels right of my player. But I saw nothing. Is there anything else I need to set?

 

Thanks!

Link to comment
Share on other sites

Actually, I have another question for you (well I have thousands of questions, but I'll stick to the one on the top of the heap...)

 

I have 3 objects on screen now, and in the vertical blank time I do a WSYNC, then run the XPosition code for player 1, then another WSYNC then x positiong for player 2 and another WSYNC then Missile 1 postioning all using the "Battlezone variant"

 

That works lovely. but the Y positioning - how do I fit in all the ypositioning code for all the objects into a scanline? I am using the "skipdraw" method (i think!) like so:

	sec
tya
sbc SpriteEnd
adc #SpriteHeight
bcs .MBDraw3

nop; Make y drawing always
nop; use same amount of cycles
sec

bcs .skipMBDraw3
			
.MBDraw3
lda (SpriteTablePtr),y
sta GRP0
sta GRP1
			
.skipMBDraw3

 

Do I just run exactly the same code for each object on screen? Is there a standard method to achieve the vertical positioning checks?

Link to comment
Share on other sites

Darrell's my name, SpiceWare's my alias. I've been doing software under SpiceWare name since the early 80s. here's an example of my logo from 88.

 

It's all tradeoffs when programming the Atari as there's a limited amount of time to do everything you have to do. In Medieval Mayhem I'm controlling 5 objects, the playfield, changing the playfield color and reading the paddles. There's no way I could do that on every scanline so I'm using a 2-line-kernel where most things are updated every other scanline(the playfield has to be updated every scanline).

 

One of the tricks I'm using is my sprites are limited in the Y range they can be drawn at, so I've chosen to pad the graphics with 0s:

TopShieldFacingDown
.byte zz________
.byte zz__XXXX__
.byte zz_XXXXXX_
.byte zzXXXXXXXX
.byte zzXXXXXXXX
.byte zzXX____XX
.byte zzX______X
.byte zz________

.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows

TopShieldFacingSideways
.byte zz________
.byte zzXXXXX___
.byte zz_XXXXX__
.byte zz__XXXXX_
.byte zz__XXXXX_
.byte zz__XXXXX_
.byte zz_XXXXX__
.byte zzXXXXX___

.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows

TopShieldFacingDiagonal
.byte zz___XXX__
.byte zz__XXXXX_
.byte zz_XXXXXXX
.byte zzXXXXXXXX
.byte zz___XXXXX
.byte zz____XXX_
.byte zz____XX__
.byte zz____X___
TopShieldDead
.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; 2 brick rows
.byte 0,0,0,0,0,0,0,0; for "dead" shape

 

and just draw the shields on every line w/out using any skipdraw logic

lda (P1Shield),y
sta GRP0
lda (P3Shield),y
sta GRP1

Link to comment
Share on other sites

It's different in that it's faster during the display kernel. I had too many things to display and could not spare SkipDraw's 17-18 cycles per player. The method I use only takes 8 cycles per player.

 

Outside of the kernel I have to add zeros to either side of the sprite image(taking up extra ROM space) and adjust the pointer to the sprite (the value in P1Shield) up/down based on the Y value.

Link to comment
Share on other sites

Is that the kind of technique they would have used to make a frogger style game? I was thinking of doing something like this as a project to bring together all the stuff I've been reading here - I've got it kinda working, but I've just been ignoring all the line-changes that the sprites do mid-frame :)

 

What would be the best way to store multiple sprites on fixed y coordinates a-la frogger?

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...