R-zone Next

September 6th, 2010

Okay okay, so I finally solved my problem. Firstly though I didn’t really solve my problem, I made a hack that made it work. It was very simple. I created a new sprite without scroll factor set, so flixel’s camera could ignore the display ship. I made the ship display in screen coordinates mapped from world coordinates. What it amounts to is that the displayed ship isn’t moving in world space, the actual ship sprite is, so if I turn on the visibility of the player sprite, the little box moves back and forth, but when it’s shut off, you don’t know the difference.

I’ll outline this on the flixel forums code-wise later.

Here is the new and improved Rzone —
RZoneFlixel_04

R-Zone 4 – the refactor

September 2nd, 2010

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

R-zone 3

September 1st, 2010

Well I wasn’t going to upload this until I got the rest of the maps “carved out” but I am trying to figure something out. If you notice it doesn’t seem like you can move in the y direction at all, however you are moving, just on the map, and because there’s no frame of reference it doesn’t look right. It’s unlikely that I will have a completely blank screen in the finished game, but I’d like to add the functionality to be able to move vertically without moving the camera up or down until you hit the window edges. Also The player position remains and doesn’t reset in this version… Several changes were made “under the hood” so-to-speak.

Update #1: fixed the vertical movement problem but now have a camera/camera object problem. It loads all levels correctly, but the camera doesn’t seem to appear at the beginning of the new level.

Update #2: Solution was to make sure and reset the camera’s x position to the beginning of the level and make sure it loads when it gets to the end really. I needed to keep the camera persistent for the y position though so you wouldn’t be reset back to the middle of the map. Please keep in mind that the clear tiles are wider (if you move up to the top or down to the bottom you’ll notice some tiles after about 3 screens) — this means that it takes longer to actually see level tiles — this is just basic blocking, and no backdrop yet, when i get there you’ll get some sense of movement.

Here it is–
RZoneFlixel_02