Sprite flipping

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
Post Reply
User avatar
DaveyPocket
Posts: 378
Joined: Sun Sep 14, 2008 8:33 pm
Contact:

Sprite flipping

Post by DaveyPocket »

The game I'm working on requires the screen to be rotated, that now means that the "x" axis is now the "y" axis so sprites can be flipped vertically. Is there a way that is not too costly in terms of cycles being lost that I can flip sprites on the horizontally oriented "y" axis so they appear to be flipped on the vertically oriented "x" axis?
User avatar
uze6666
Site Admin
Posts: 4823
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Sprite flipping

Post by uze6666 »

So you really need Y flipping. Currently, there's no easy way to do that except implement it in assembler. I'll check how hard that would be to implement.
User avatar
uze6666
Site Admin
Posts: 4823
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Sprite flipping

Post by uze6666 »

Done deal! It was much easier than I thought, and it's in assembler so there's almost no performance loss. Check out: http://uzebox.org/forums/viewtopic.php?p=10001#p10001. Let me know if you find any issue with it.
User avatar
martinsustek
Posts: 117
Joined: Sat Apr 30, 2011 11:34 am
Location: Ostrava, Czech Republic

Re: Sprite flipping

Post by martinsustek »

So, next step is rotating sprite by 90, 180 and 270 degrees? :-) It can be useful for some top-viewed games to save flash by reusing same sprites in four directions, but drawing routine will probably be more complex than flipping.
Post Reply