Archive for September, 2010

R-Zone 2.0

Thursday, September 9th, 2010

Well I rewrote the core of the scroller part, so that now instead of resetting the state it’s all contained in one state. There are two tilemaps that I swap out every other level, so that it appears seamless. Basically it means loading up one map when it gets to the edge of the camera, and then when the old map is off camera removing the map (nullifying it), then it can be used for the next time. Nullification and creation are based on the level number, whether it’s even or odd, if it’s odd then it’s tilemap 1, and if even it’s tilemap 2. Works pretty dang well if I do say so myself. So now I’ve got most of the major areas blocked in, there’s nothing there yet though. Also levels 1-2 have only 1 path about a screen’s high worth, levels 3-4 have 2, and levels 5-6 have 3. Should make for some interesting replay. I just got to be able to make sure the user can somehow visibly see the paths he can take, probably by crafting the openings in such a way as it isn’t hard to choose. Anyways next up is actually adding ceiling and floors to varying degrees (up or down)… then I can start on the actual game (enemies as weapons).

If i get any response to this, and you want it, I will post the code later.
Here’s the swf — RZone20_01

R-zone Next

Monday, 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 —

R-Zone 4 – the refactor

Thursday, 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.

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 —