Jump to content
IGNORED

Getting ahead of myself but is this possible on a 2600?


Recommended Posts

So I'm still learning this stuff but is it possible to have a sprite such as the cannon in space invaders

 

and then mirror that sprite so you can display it as

 

post-1544-1175124659.gif

 

or

 

post-1544-1175125605.jpg

 

easily as one entity such as the bi-planes in combat

 

I have a basic idea of sprites and I know that in games like Combat you can display 2 or 3 of the same sprite but can you display two mirrored copies at the same time

 

or would you need to work some magic to do this?

 

I wanna try a shooter where you have two shots but you can flip your second cannon any way you like

 

If it's both cannons facing up you get two shots like the fried version of SI

 

But I wanna be able to rotate the second cannon to the right, down of left as the pictures suggest

post-1544-1175124701.jpg

Link to comment
Share on other sites

First of all, terminology: your first pair of images show the sprite "rotated" 90 degrees, the second and third pairs show it "flipped" (mirrored is not a noticeable change with this sprite since it's horizontally symmetrical!)

 

Flipping a sprite in software is easily doable, as is mirroring. Rotating 90 degrees is not too difficult but is easiest if it's square.

 

The VCS has no provision to do any of these "automatically", nor can it display a single shape in multiple orientations by using the standard multiple-copies method.

 

EDIT: Correction- the VCS does have left/right mirroring capability built-in.

Edited by A.J. Franzman
Link to comment
Share on other sites

First of all, terminology: your first pair of images show the sprite "rotated" 90 degrees, the second and third pairs show it "flipped" (mirrored is not a noticeable change with this sprite since it's horizontally symmetrical!)

 

Flipping a sprite in software is easily doable, as is mirroring. Rotating 90 degrees is not too difficult but is easiest if it's square.

 

Even if it's 8 pixels wide and 8 pixels tall, the sprite will probably look stretched or squashed when the data is rotated 90 degrees, due to the aspect ratio of the pixels. But you'll need to define the rotated image in ROM anyway, so you could adjust the image a tad to keep it from looking too stretched or squashed.

 

The VCS has no provision to do any of these "automatically", nor can it display a single shape in multiple orientations by using the standard multiple-copies method.

 

You should have time to store the new image for the copy, as is done in the score technique.

 

So you'll need to define four versions of the cannon in ROM, one for each direction it can be pointed in-- so you'd need eight versions if it can be pointed in eight directions. And if you're going to display two or three copies of the cannon on a line, and you want to rotate them independently, you'll need to change the player data before the next copy is displayed. That usually means the copies need to be stationary as far as their horizontal positions are concerned, due to the precise timing required for changing the player data between the different copies.

 

Michael

Link to comment
Share on other sites

The third image is not supposed to be there. I tried to remove it but it wouldn't let me

 

And don't pay too much attention to the size of the cannon, that was only used as an example

 

If I did the real game it would be square so it wouldn't look weird flipped

 

The question was basically if you could do a copy like in Combat but rotate one of the copies.

 

I gather from the responses that the answer is 'no'

 

Imagine one cannon

 

X

 

And then a setup like this

 

XX - both shoot up

 

X> - X shoots up, > shoots right

 

<X - X shoots up, < shoots left

 

XX - first X shoots up and second X flipped shoots down

 

something like that

 

completely do-able right?

Link to comment
Share on other sites

The third image is not supposed to be there. I tried to remove it but it wouldn't let me

 

And don't pay too much attention to the size of the cannon, that was only used as an example

 

If I did the real game it would be square so it wouldn't look weird flipped

 

The question was basically if you could do a copy like in Combat but rotate one of the copies.

 

I gather from the responses that the answer is 'no'

 

If I understand your question, I think the answer is "yes"-- but you need to change the data from one copy to the next.

 

Imagine one cannon

 

X

 

And then a setup like this

 

XX - both shoot up

 

X> - X shoots up, > shoots right

 

<X - X shoots up, < shoots left

 

XX - first X shoots up and second X flipped shoots down

 

something like that

 

completely do-able right?

 

I would think so, if you define four versions of the cannon's shape and move the desired shape data into the player's graphics register between each copy.

 

Michael

Link to comment
Share on other sites

OK cool.

 

This is my 3rd game idea and I'm under the assumption that I won't even make ONE game so I'm not sweating it

 

That said, everything I've done so far sorta makes perfect sense so I'm not bailing just yet

 

For all you other newbies, don't test the waters with your big toe, it's really cold.

 

Just jump right in or you'll never complete a lap! :D

Link to comment
Share on other sites

The VCS has no provision to do any of these "automatically", nor can it display a single shape in multiple orientations by using the standard multiple-copies method.

 

The VCS does include hardware for left/right flipping. Top-down flipping can be done in software (Combat does that) but is usually best handled by having separate copies of the sprite for normal and flipped orientations; generally doing such flipping in software will require extra RAM (that's one of the reasons that Combat, despite its simplicity, actually uses most of the RAM on the 2600).

 

Note also that sometimes it's practical to assemble sprites out of multiple pieces; Toyshop Trouble, for example, has separate graphics data for heads and bodies. Oftentimes, though, it's more practical to have separate copies of the 'assembled' shapes in ROM. For example, E.T. has different copies of the main character's shape for all the different head positions, even though the neck extension is pretty simple transformation.

Link to comment
Share on other sites

As I understood the question, defining multiple versions of the shape in ROM for the different orientations is what godzillajoe explicitly did not want to do.

I did get the impression that he was asking if it could be done "automatically" with some kind of command or "flip switch" (i.e., setting some control bit), like the "reflect player" option. But it can't, so I figured he would want to know what he'd need to do to make it happen "non-automatically." :)

 

By the way, I tinkered with the Space Invaders cannon sprite to try to get a reasonably decent rotated version. This assumes that the 2600's pixels have an aspect ratio of 5x3:

 

; pointed vertically
  BYTE %00010000
  BYTE %00111000
  BYTE %00111000
  BYTE %01111100
  BYTE %01111100
  BYTE %00111000
  BYTE %00111000
  BYTE %11111110
  BYTE %11111110
  BYTE %00111000
  BYTE %11111110
  BYTE %11111110

; pointed horizontally
  BYTE %10100000
  BYTE %10100000
  BYTE %11101000
  BYTE %11101000
  BYTE %11111100
  BYTE %11111110
  BYTE %11111110
  BYTE %11111100
  BYTE %11101000
  BYTE %11101000
  BYTE %10100000
  BYTE %10100000

 

post-7456-1175137953_thumb.jpg

 

Yes, it's far from perfect. :) It's tough to make the rotated shape keep the same dimensions and overall appearance, due to the pixel aspect ratio.

 

Michael

Link to comment
Share on other sites

The VCS has no provision to do any of these "automatically", nor can it display a single shape in multiple orientations by using the standard multiple-copies method.

 

The VCS does include hardware for left/right flipping. Top-down flipping can be done in software (Combat does that) but is usually best handled by having separate copies of the sprite for normal and flipped orientations; generally doing such flipping in software will require extra RAM (that's one of the reasons that Combat, despite its simplicity, actually uses most of the RAM on the 2600).

 

Note also that sometimes it's practical to assemble sprites out of multiple pieces; Toyshop Trouble, for example, has separate graphics data for heads and bodies. Oftentimes, though, it's more practical to have separate copies of the 'assembled' shapes in ROM. For example, E.T. has different copies of the main character's shape for all the different head positions, even though the neck extension is pretty simple transformation.

 

The odd thing about Combat is that it does not (as I recall) use the left/right mirroring feature. If it did, it probably could have freed up some ROM.

Link to comment
Share on other sites

Thanks for all the responses guys, I'm sure once I get to the stage where I understand sprites better, I'll have more questions or maybe some code samples for you all to take a peek at.

 

This has actually been quite fun so far. Loading up some nonsense through a SuperCharger and having it display on my real 2600 is quite a rush.

 

I've been wanting to do this since I was 12.

 

Now 25 years later, I'm finally getting there!

Edited by godzillajoe
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...