Archive for the ‘Classes’ Category

21
May 10

FlxBitmapFont – A Bitmap Font class for Flixel 2 released

Today I released my FlxBitmapFont package to Google Code. This allows you to use bitmap fonts directly in your Flixel 2 games:

The bitmap fonts are just an extension of a Flixel Sprite, meaning you can throw them around, collide with them, scale them, rotate them and generally cause havoc. Or of course they could just be UI elements, proving a score/lives count. But at least the choice is yours :)

11 fonts are included, 2 sample programs and comprehensive documentation in the form of a PDF file. I’ve also published that here on my blog: http://www.photonstorm.com/flxbitmapfont and I will update both my blog and the Google Code archive as needed.

Anyway I hope you have fonty fun with this! Look out for a number of new Flixel classes from me in the coming months, or catch me on the flixel forums where I help moderate the place.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

16
Jan 09

PixelBlitz – First 2009 Update, lots of new toys and shmup test 1

PixelBlitz Engine Update This evening I managed to find time to push a lot of updates through for PixelBlitz. This fixes some serious bugs that I introduced last year when trying to optimise the speed of the renderer. It also brings in new methods in the BlitzMath class (my favourite being the excellent wrapValue() function!), the new Box2D Physics classes (lots more on this to come) and the starting classes for BlitzGrid, BlitzDraw and BlitzWorld.

More importantly I’ve started putting the examples source code into Google Code, which I’ve tested and it all compiles against this latest build. So far all of my demos from last year are converted and working, including this new little Shoot-em-up Test. Use the cursor keys to move and control to fire. Firing doesn’t actually do anything, you can’t die, the aliens can’t die either, but I think it shows the potential speed a PixelBlitz game can have, and I’m not even starting to push it yet.

Get the latest release from Google Code including the rough and ready source for the demo game above, you’ll see the start of the new Collision Group system in there, which I’ll be evolving this year.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

10
Oct 08

2.5 New Games and off to another convention!

Things have been a little quiet on the PixelBlitz front these past few weeks. I have been working on some new classes but am not ready to release them to svn yet, however I have got a nearly complete Vector2D and Vector3D set ready, which will form the basis for a lot of things to come.

The reason for the slow-down is that I’m nearing completion on two brand new games, and resurrecting and finally finishing a third. The old game I’m finishing off is Five Dice Frenzy, a Yahtzee inspired dice game. I’ve beefed-up the visuals, added a worldwide ranking / highscore system and a comprehensive playing guide. There are a few tweaks left but then I will happily release it. It’s up on FGL at the moment but I’ll finish it properly next week.

My two new games are Tractor Beams and Fruiti Blox:

Tractor Beams In-game

Tractor Beams In-game

Tractor Beams is a new game for the Shaun the Sheep web site. Next week, around the 15th it will be released and feature exclusively on there for a month before we seed it further. It’s a strategy game very similar to Five Dice Frenzy, but totally Shaunified! We did the visuals in-house, again the excellent pixel work of Gav / Jam Factory (check out his awesome new blog design!).

The game features a really cool effect I created (almost by accident) on the title page, where the logo literally beams down from space into view. The effect could easily be re-used for a “spooky / ghostly” appearance, so I’m going to package it up and release it next week, so you can use it in any Hallooween inspired games you may be working on :)

We Tractor Beams will go down well on the Shaun site. It takes a while to get used to it and understand how to play, but once it’s clicked the highscore attack becomes really addictive!

My next game is Fruiti Blox:

Fruiti Blox In-game

Fruiti Blox In-game

Fruiti Blox is my brand new game, with graphics by Peter Jovanovic. It’s an against-the-clock puzzle game, which is very nearly finished – but I’m still toying with the idea of expanding the core game out further and including several “mini games” to enhance it. I’ll decide next week once Tractor Beams is released :)

Despite what the screen shot above may look like this is NOT a “Match-3″ game at all!

PixelBlitz

So what’s next? I actually think it’s time to cease game making for a moment and spend some quality time on PixelBlitz, finishing off all the odds-and-sods I left hanging around, and integrating some core new classes into the fold. By the end of the year I fully expect to have the world manager done, and hopefully the tile map class as well (but no promises on that one!).

I’ve been using PixelBlitz (at least core parts of it) in all my games recently, and it definitely speeds things up. But the more I use it for real games, the more I realise we need to add!

Right now though I’m off to pack for The Game Creators Convention 2008. I attended last year and it was great fun, so I’m expecting nothing less this year :) Most people will be there already, but I need to travel up in the morning instead. It means getting up at 4.30am, but it’s worth it!

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

19
Sep 08

PixelBlitz – Optimised RenderLayer part 1

Tonight I updated the PixelBlitz Engine with a small but significant feature. I attacked the issue of redundant redrawing of elements, and updated both the PixelSprite and RenderLayer classes so they no longer refresh all of their content if nothing has actually changed since the last render call.

Sounds simple and it is, but it makes a world of difference to the speed of things.

I’ve been researching how beneficial adding a dirty rect system in the engine would be. The problem I have is that it’s all dependant on the type of game. For example a vertical shooter, with a scrolling background and bullets flying everywhere, would have no benefit at all – if anything the extra calculations may even slow it down. But in a sedate game, especially one with large (overlapping) objects, it could be a dream.

So, still in two minds really – perhaps it’s something we allow the user to disable at will.

For now I’m going to optimise the 2DRenderer further by making it only copyPixels() from the area of the RenderLayer that has changed. At the moment it grabs a full sized layer even if the layer only contains say a 64×64 sprite somewhere.

Anyway until then the new code is available in svn.

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

15
Sep 08

BlitzMouse Released + Demo

After working my butt-off on my latest game I decided it was time to redirect some love and attention to PixelBlitz. So this weekend I finished off a new class I had planned out a while ago. Introducing… BlitzMouse! This pairs up with BlitzKeyboard to complete the input set, and is a feature rich (and very fast) mouse handling system.

Here’s a very simple demo of it in action:

Press the cursor keys to limit custom mouse pointer movement.

So what can this bad boy do? The aim (as with all things PixelBlitz) is to make working with the mouse in your games easier. Here’s a quick overview of the core features:

Accurate mouse tracking

Keep an eye on that rodent! Easily check if it has left the stage, or re-entered again. Doesn’t use any CPU time processing events that require the mouse if it’s not over the stage!

Button / Click handling

Detect when the mouse button is down, or up.. or being held down. Find out how long it took the user to make that last mouse click (the speed from down to up again). Find out how many clicks the user has made since you last checked. Writing those god-awful “Ninja Finger” style games has never been so simple ;)

Mouse stats

Want to know if the mouse is moving up? Just check isMovingUp! You can poll all 4 directions easily and quickly. Want to know how far in pixels the mouse has travelled on the X axis? Call distanceX() – want to know how fast it moved? Call speedX!

Rotation

To know which angle the mouse is at call angle(), and you can have the result back in degrees or radians. Use the optional “lowerAccuracy” parameter and it uses a much faster calculation, but sacrifice a little accuracy in the process (great for a quick arcade game, not-so for a physics simulation).

You can set the point of the angle calculation (it defaults to the centre of your stage), which allows you to track the angle from anywhere to the mouse. You can even get the angle from any display object to the mouse using angleToObject() (with all the same parameters that angle() supports). This means if you want 3 things all pointing right at the mouse then it’s no problem! (see the demo above) Want to know the distance from any display object to the mouse? Call distanceToObject() and it’ll tell you.

Custom Mouse Pointers

Use changePointer() and you can set the mouse pointer to any display object – with custom X/Y offset support incase the pointer needs aligning differently to the standard top left. As the mouse moves, the display object is updated. If the mouse leaves the stage the display object is made invisible, so you don’t get that “cursor stuck on the edge” problem :)

Movement Limits

Want to limit the movement of the custom pointer? No problem! You can limit it in all four directions (up/down/left/right) with optional snapBack support on both axis. For example if you were making a Pong game (please… don’t) by just calling limitMovement(true, true, false, false) you will lock the bat into only moving up and down with left/right movements ignored.

Want to limit the mouse to a specific area of the stage? Call limit(new Rectangle(x,y,w,h)) – if the mouse goes outside of this zone it will be hidden from view. You can see this in the example above as it hides when it leaves the light grey box. This limit also effects custom pointers. Of course when the mouse leaves the stage there is nothing you can do about that – but we have to work within the limits of Flash here :)

So there we have it – BlitzMouse! Hopefully more useful than you thought when you first read the title, aye? :) I plan to add more features, such as custom events/function calls on mouse actions, the ability to attach as many display objects as you like to it (so they all update at once) and custom zones, so you can have as many “mouse zones” as you want. The code is uploaded to Google, so enjoy :)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon

12
Apr 08

Enhanced KeyPoll Class Released

I’ve been using the excellent KeyPoll class by Richard Lord / Big Room Ventures. It’s an extremely fast and efficient class for detecting keyboard presses for your games. But I needed the class to do more, so I’ve extended it, added in some new functionality and released it. My new version can detect multiple key presses at once, has the full scancode const list built-in and adds a new function to return the last pressed scancode. Plus it’s still just as fast and flexible as the original.

Grab the download and examples after the jump.
(more…)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Ping.fm Post to Reddit Post to StumbleUpon