Jump to content



0

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


10 replies to this topic

#1 godzillajoe OFFLINE  

godzillajoe

    Stargunner

  • 1,971 posts
  • Location:watch city, ma

Posted Wed Mar 28, 2007 5:49 PM

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

sp3.gif

or

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

Attached Images

  • sp2.jpg


#2 A.J. Franzman OFFLINE  

A.J. Franzman

    River Patroller

  • 4,326 posts
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Wed Mar 28, 2007 6:40 PM

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, Wed Mar 28, 2007 10:06 PM.


#3 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Wed Mar 28, 2007 7:51 PM

View PostA.J. Franzman, on Wed Mar 28, 2007 8:40 PM, said:

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.

View PostA.J. Franzman, on Wed Mar 28, 2007 8:40 PM, said:

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

#4 godzillajoe OFFLINE  

godzillajoe

    Stargunner

  • 1,971 posts
  • Location:watch city, ma

Posted Wed Mar 28, 2007 8:06 PM

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?

#5 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Wed Mar 28, 2007 8:28 PM

View Postgodzillajoe, on Wed Mar 28, 2007 10:06 PM, said:

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.

View Postgodzillajoe, on Wed Mar 28, 2007 10:06 PM, said:

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

#6 A.J. Franzman OFFLINE  

A.J. Franzman

    River Patroller

  • 4,326 posts
  • Syzygyst
  • Location:U.S.A. - See 'Map' link above

Posted Wed Mar 28, 2007 8:47 PM

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.

#7 godzillajoe OFFLINE  

godzillajoe

    Stargunner

  • 1,971 posts
  • Location:watch city, ma

Posted Wed Mar 28, 2007 8:50 PM

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

#8 supercat OFFLINE  

supercat

    Quadrunner

  • 6,367 posts

Posted Wed Mar 28, 2007 8:50 PM

View PostA.J. Franzman, on Wed Mar 28, 2007 7:40 PM, said:

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.

#9 SeaGtGruff OFFLINE  

SeaGtGruff

    River Patroller

  • 4,543 posts
  • Location:Georgia, USA

Posted Wed Mar 28, 2007 9:13 PM

View PostA.J. Franzman, on Wed Mar 28, 2007 10:47 PM, said:

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

cannons.gif

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

#10 mos6507 OFFLINE  

mos6507

    River Patroller

  • 4,728 posts

Posted Thu Mar 29, 2007 7:20 PM

View Postsupercat, on Wed Mar 28, 2007 7:50 PM, said:

View PostA.J. Franzman, on Wed Mar 28, 2007 7:40 PM, said:

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.

#11 godzillajoe OFFLINE  

godzillajoe

    Stargunner

  • 1,971 posts
  • Location:watch city, ma

Posted Fri Mar 30, 2007 1:05 PM

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, Fri Mar 30, 2007 1:06 PM.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users