PDA

View Full Version : How to change center point of a movie clip



cdub1980
May 21st, 2007, 12:07 PM
Ok, I'm just getting into some game development. What I'm trying to figure out right now is how to move the rotation point of a movie clip.

The idea behind this is that I'm making an overhead view game. My main character will stay fixed near the bottom of the screen and only face up. the Left and Right keys will be used to rotate his direction - but in reality the ground is what is rotating, since the main character never actually changes positions.

The problem is that when i get away from the center of the ground movie clip, it's more like I'm swinging around the image, because it's rotating the ground movie from the center of the movie clip, rather than my hero's center position. How can i get the rotational point of the ground to always be at the center of my hero character?

cdub1980
May 21st, 2007, 06:05 PM
Well, i don't just want to ask questions - i want to contribute, so here's what i ended up doing:



I took the image that i wanted as the "floor" of my game I'm working on and made it a movie clip. I called it "grid". Next, I made a container clip called "gridcontainer" and put a mask layer over the "grid" mc instance. The goal was to leave my character still, but scroll the ground. So I basically just manipulated the floor from there. If i needed to scroll (ie. move forward or backward or sideways), I moved the _y and/or _x positions of gridcontainer.grid, then if i needed to rotate, I rotated the gridcontainer mc. This way, my registration point was always the center of the gridcontainer, and I was just scrolling the gridcontainer.grid image.



Pretty cool i think. Anyway, hope this helps in case anyone else needs the same info. I'd be happy to share my AS if you ever need it.