FlashPunk 1.4 is now up for download! The biggest features of this update would be the addition of the
TiledImage and
TiledSpritemap classes, which allow you to fill and transform a rectangle area with an Image/Spritemap texture. This is useful for all kinds of stuff, such as flowing graphics (water, lava) for example.
Download FlashPunk 1.4
Added
- Added FP.stepTowards() to step an object towards a target point.
- Added blend, color, and alpha properties to Canvas (and subsequently Backdrop and Tilemap).
- Gave Grid usePositions property to use x/y positions instead of columns/rows.
- Gave Tilemap usePositions property to use x/y positions instead of columns/rows.
- Added centerOrigin() to center Image's origin and centerOO() to center its origin and offset.
- Added Input.clear() to clear all input states.
- Added TiledImage and TiledSpritemap for drawing Images or Spritemaps repeatedly as textures in a block.
- Added FP.getXML() for creating an XML object from a file.
- Changed Draw.circle() to Draw.circlePlus() and added a new Draw.circle() using a pixelated circle-drawing algorithm.
Fixed
- Moved Entity Graphic update() to World update to avoid version update problems and override issues.
- Renamed mouseAbsX/Y() to mouseScreenX/Y() because the prior name was stupid and confusing.
- Made it so Entities don't have to be active for their graphics to update().
- Fixed color issue with Canvas.rect().
- Fixed screen offset to adhere to current scale.
- Fixed various issues with null currentAnim's causing problems after callbacks, etc.
- Made some of Image's properties protected for use in extended graphic classes.
- Made FP.angleXY() use any x/y object, not just a Point.
- Fixed FP.choose() so it actually works when using Vectors.
- Changed some of Screen's functions from internal to public, so they can be used for certain special effects.
- Updated Entity's "into" functions to use Vectors as well as arrays.
In this impossibly charming game by
JR Hill, you have to match the cursor's color with the target's color. Points scale up as you go, if your points reach a million you win, if they reach zero you lose.
The game was created for the
A Game by its Cover competition over at
TIGSource, in which the contestants have to create a game based on a collection of original premade video game covers. JR Hill's game was based on
this cover. If you like the game, make sure to give him your vote when the competition reaches its deadline!
Play Now
Creator's Website
This game, by
Calvin French, is a simple storybook-style game recounting an alternate version of the story told in
1 Samuel 1 in the Bible. Depending on what choices you make you might experience a version of the story fairly close to the original account, or something very different.
Play Now
Creator's Website
FlashPunk 1.3 is now up for download! This version has some pretty hefty changes, but you should still be able to update from previous 1.x versions quite easily.
Download FlashPunk 1.3
Added
- Added debug package with Console class for real-time debugging and data logging.
- Added FP.console getter to get the Console object and timing vars for Console
purposes. Added log() and watch() to correspond with respective Console
functions.
- Added container Sprite for screen Bitmap buffers and smoothing property to
Screen.
- Added toString() to Entity for tracing/logging purposes.
- Added mouseFlashX() and mouseFlashY() to Input.
- Added paused property to Engine, used by Console to pause the game loop.
- Added FP.timeFlag() to set time flags, and also retrieve the time passed since
the last time flag was set. Useful for timing/testing purposes.
Removed
- Removed Tween updates in Tweener's update() function.
- FP.cleanup() and FP.removeNulls() removed.
Fixed
- Made updateTweens() public.
- Updated several Graphic classes to use update() for animations, and changed
Image's update() function to updateBuffer().
- Updated and re-organized Engine's game loop to work with the Console class.
- Updated Draw.line() to account for transparent bitmaps.
- Moved FP.screen.swap() to just before the render loop, so the buffer during
every update() is the last rendered buffer.
- Update to FP.choose() to account for Vectors.
- Updated World's "into" functions to account for Vectors as well as Arrays.
- Changed FP.engine to Engine type instead of Sprite.
- Fixed a bug preventing Entity's graphic property to be set to null.
- Updated sort() and shuffle() to operate on arrays with elements other than
Numbers, and updated shuffle() to account for Vectors as well.
Using the Console
FlashPunk has been updated with a debug console with some cool features that I want you folks to try out! The Console currently lets you:
- Pause/unpause the game.
- View Entity positions (green) and hitboxes (red).
- Select and move Entities around with the mouse.
- Log information and copy it.
- Watch user-specified properties of selected Entities.
- Pan the camera around.
- Keep track of FPS, frame timing, and Entity count.
It's still in beta, so let me know if any problems occur with it or if there's anything you'd like to see changed.
To use it,
enable it at the start of your game, probably in your Main class's constructor (after you call super()) or in its init() function, like so:
FP.console.enable()
Now try running your game! There should be FPS and Entity counters in the corners, and an Output panel at the bottom. If you press the
toggle key, you can pause/unpause the game to bring up the console window. The toggle key is tilde (~) by default, but you can change what key is used if you want like so:
FP.console.toggleKey = Key.ENTER;
The console looks like this when paused in Output mode:
To log information to the Output panel in the console, you can do this:
FP.log("Hello world!");
That will print the line to the panel. If you get more lines than fits, a scrollbar handle appears on the left side of the panel, which you can use to browse up and down the logged information. The text in the console can be selected and copy/pasted as well.
At the top there are 3 buttons. The middle button can be used to
play/pause the game while the Console is open. The button on the right can be used to
step the frame ahead. The first button will actually switch between Output and Debug mode. While in Debug mode, the console looks like this:
What you are seeing is the position (green) and hitbox (red) of all Entities currently on screen. You can even press the
play button to watch them move around. This is useful for watching the game making sure your collisions are functioning correctly.
While in Debug mode, you can
select Entities by either clicking on them or selecting them in a rectangle. If you have multiple Entities selected, the Debug panel at the bottom-left will tell you how many you have selected. If you have a single Entity selected, it will show specific information about that Entity:
Yours by default will only show their x/y position, but if you want to
watch more properties, you can tell the Console to watch them like so:
FP.watch("width", "height", "color");
This will work for any properties of your Entity extended classes, not just Entity's. If the selected Entity does not have a property listed, it will not display.
There are a few more features too:
- To pan the camera, hold SHIFT and click+drag the mouse (when no Entities selected).
- To move selected Entities, hold SHIFT and click+drag the mouse.
- You can also move the camera/Entities by holding SHIFT and pressing the ARROW keys.
- To select all visible Entities, press A.
Being able to pause the game, move Entities, around, and play it (or step the frame ahead) is really fun and useful, so enjoy and let me know what you think!
FlashPunk 1.2 is now up for download. Not as large as the last update, but sooner and with some pretty cool functions added.
Download FlashPunk 1.2
Added
- Added collideLine() function to World. This is a raycasting implementation. You can use it to check for the first Entity that collides with a line, and you can also feed a Point object into it to it which will be assigned the first collision position (useful for stuff like drawing lasers, etc.) NOTE: This is fairly quick for what it does, but be wary using it, as with lots of Entities to check, it can be slow. If you can, try using as high of a precision value as you can, so that every pixel on the line doesn't have to be checked.
- Tween's percent property is no longer read-only, you can assign it a value from 0 to 1.
- Added some array functions to FP: sort(), sortBy(), and shuffle(). The sort() function sorts the array by its elements, and the sortBy() actually allows you to provide the name of a property of the contained elements to sort them by (eg. "priority").
- Added relative property to Graphic objects to optionally draw graphics globally
instead of relative to their parent. Especially useful with Emitters.
- FP.frameRate is now equal to the running framerate. FP.assignedFrameRate added
to retrieve assigned frameRate value. Engine now updates FP.frameRate value. FP.assignedFrameRate property added for retrieving the target FPS.
Removed
- Entity's persist property removed.
- FP.cleanup() and FP.removeNulls() removed.
Fixed
- Updated World's layer rendering and Entity add/removal to no longer require removeNulls() and make it a bit better.
- Fixed Entity's collidePoint(), which was returning true for points 1 pixel beyond the hitbox from 2 sides.
- Made Tween's percent property no longer read-only, and can be assigned values from 0 to 1.