PDA

View Full Version : Flipping a grid of tiles & time rewinding

haralampi
02-14-2011, 12:21 PM
Hello Everyone,

My team and I are currently in the process of developing our first game (student project), we're making a 2D side-scroller and we kind of hit a pretty big brick wall - we're trying to find out: a math formula for flipping a grid of tiles coherently & if possible an algorithm for rewinding time...
The tile flipper is - because we'll be trying to "flip the gravity" - just flipping our character upside down and walking on the ceiling...
I apologize if there already is an answer to any of these, but i've looked arround and the only thing i could fins with search was how to flip an image.

carsten neumann
02-14-2011, 12:30 PM
Not sure if that does what you want, but how about: turn the camera upside down?

haralampi
02-14-2011, 01:36 PM
Well not in our case at least, because we'll have some pusles in place and in order to pass say from point A to point B you will have to walk on the ceiling - gravity switch...sort of like the game "Shift" (http://armorgames.com/play/751/shift)

carsten neumann
02-14-2011, 04:11 PM
Well not in our case at least, because we'll have some pusles in place and in order to pass say from point A to point B you will have to walk on the ceiling - gravity switch

gravity is something outside of OpenGL/graphics, you'll have to track its direction somewhere in your code.
So is the problem then that you only want to be some tiles upside down? You could invert the texture coordinates along one axis in the vertex shader to flip only certain tiles upside down or use a texture matrix if you need to use the fixed function pipeline. But that boils down to flipping an image which your original post says is not what you want...
Hmm, I'm afraid I don't really understand your question...