R-Zone 4 – the refactor

I did movement a little bit differently, as someone helped me figure out. Instead of setting the scroll factor to 0, I added the velocity of my camera object to the velocity of my player, since effectively when you want control within the screen you do because it means your ship is faster when your moving it than the camera, and you just keep it in the screen.

Unfortunately this also adds some shuddering. Which is mainly due to the fact the camera “follow” moves, and then the actual object you’re following moves… so it means it’s sort of out of sync with each other. I’m hoping though at least this allows us to use flixel’s collision functions.

Here’s the current version, ignore the small grid of tiles at the beginning.
RZoneFlixel_03

—————————————————————————————————-
Update: Apparently modifying the values to make it smoother stops the collision from working properly, so this below is sort of moot. Just concern yourself with the first version above.
—————————————————————————————————-
Here’s a version with the x velocity value rounded before adding it to the position —
RZoneFlixel_03alt

Leave a Reply

 


%d bloggers like this: