I moved to a new URL! Check it out!

posts tagged with: flashpunk

Dev Log: Some Bitmap Text

I guess I'll start calling these posts Dev Logs now? Yeah, that sounds good.

Image

The latest thing I've been chipping away at is handling bitmap text in my Flashpunk extended framework thing. There have been a couple of people that have posted Bitmap Font classes but they didn't do what I wanted, and I'm way better at coding my own thing from scratch vs. trying to modify someone else's code to do what I want.

Right now my bitmap text secret technology can do some cool stuff, like three different align modes (left, center, and right) which sounds pretty simple but it actually took me awhile to think of the proper solution for lining up text in a certain way. I also have some colored text as you can see in that awesome screenshot, and the way I do that is pretty cool (I think.) My code for coloring text ends up looking something like this:

//make da bitmap text
var bmpText:BitmapText = new BitmapText("This text will be #1GREEN!!#0 Yeah.", Global.bitmapFont);
//define the color "1" as green
bmpText.defineColor("1", 0x00FF00);

You can see a little bit how it works. I can define colors, which are assigned to certain characters (any Ascii character can be used) and then I can mark colors with a special character like '#'. Text after that character will then be drawn with a tint of that color. It's super easy to do colored words with this system, but it makes some other stuff pretty difficult.

One thing I still haven't figured out is how to escape the special character. Like if I wanted to actually display a '#' in my string, I don't have a way of doing that right now. I wanted to have '##' just escape out to a '#', and I was trying some fancy stuff with regular expressions for awhile but... yeah, things have not worked out yet. This is something I can probably just tackle later though.

Bitmap text comes in handy for a few reasons, and I think I'll make a more detailed blog post about that at some point down the road!

GGJ Game: Screenshot Saturday

GGJ Game: Screenshot Saturday
Still poking away at this Global Game Jam game I started last weekend. If you missed the timelapse, just scroll down a little bit and you'll find it, or just click here. Here's what it's looking like at the moment:

Image

I'm super excited about that minimap in the upper left hand corner. You have no idea how excited I am. I've been wanting to have a real time minimap in a game for so long but I've always been limited by my programming knowledge or the software that I was using to develop the games, but now I'm finally at the point where putting together that minimap on the HUD only took a few hours of work!

Another thing going on is the crazy blue splashes on the screen, which is actually just me testing my particle system. I don't seem to do particles like most people, and I prefer all my particles to be individual instances or objects in the engine... but this does mean some performance issues unless I have some sort of pooling system set up for at least the bitmapdata being used for each particle. I recently added a new parameter to my particles which is delay, so I can specify how long a particle should wait before it starts doing its thing.

I'm pretty happy with how particle and effects creation works in my latest iteration of my framework that sits on top of Flashpunk. Right now the code for creating those blue particles looks like this:

 //make dem blue rings
KParticle.spawn(level.mouseX, level.mouseY, C.EFFECT_RING, {
frames: [0, 1, 2, 3, 4],
lifeSpan: [20, 40],
delay: [30, 120],
center: true,
color: C.COLOR_BLUE,
scale: [0.5, 1],
layer: -5
});

Just to clarify a few things, the C.EFFECT_RING is just a reference to a string that I've used to pool the particles ahead of time, so the function here ends up looking for the next particle in the C.EFFECT_RING pool. "C" is just my big static class for all sorts of constants that I want to be able to easily remember.

As far as the yellow and red pixels in the middle of the screen -- those are some helpful markers to show me how my camera system is working. I just got some neat camera blocking stuff working (similar to Jottobots) but it's been so long since I've coded any sort of "advanced" camera stuff that I'm feeling totally rusty and it took me probably two days of thinking to get it working the way I want. I still have some other problems to solve with that, like how to get the camera to properly block around corners, but I'll get to that soon enough. A lot of the inspiration for this comes from games like Super Metroid where the game will hide areas from the player until the player crosses into them, and then the camera will adjust to reveal the new area.

That's it for now! Trying to just post more to my blogosphere in general, so I'm going to just try and post as much as possible for the next few weeks and see how it turns out.

Metroidvania Map Rendering

For the past couple days I've been tinkering around with some stuff in my Global Game Jam game from last weekend. One of the things I'm most stupidly excited about is rendering my game map automagically in code (instead of drawing it by hand.)

Image

I've added on a bunch of features since the original game jam version of the map rendering system. Right now the coolest stuff is the ability for each room to render its exits, and the potential for rooms that aren't square shaped (some rooms can be L shaped, or whatever)

I think I'm going to try and finish this game before GDC and not get too attached to it. I'm curious to see what kind of systems I can build for a future Metroidvania-esque project... so I have to be careful not to start caring too much about this game, otherwise it will take me way too long to finish. I think it's doable, especially if I aim for just maybe a 2 hour total game play experience! (And I can always add to it later.)

Offspring Fling Mothers Day Update on STEAM!

Offspring Fling Mothers Day Update on STEAM!


Hey everyone! Offspring Fling version 1.1 is finally here, a.k.a. the Mothers Day Update! What better way to celebrate mothers day weekend with a game all about throwing children around?

As I type this I've been awake for 30+ hours now, going crazy with stress from the Steam release, so I think I'll save a more formal post for later. For now. go tell all your friends to get Offspring Fling on Steam!