Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411768 Posts in 69685 Topics- by 58652 Members - Latest Member: theoutlier

December 09, 2024, 12:01:12 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityTownhallFlashPunk
Pages: [1] 2 3
Print
Author Topic: FlashPunk  (Read 34572 times)
ChevyRay
Guest
« on: January 08, 2010, 03:37:51 AM »



Hey my lovely TIGgers! Some of you have heard of my Flash game library, FlashPunk. Well, Version 0.85 is out now, and I've uploaded it to my site!

www.flashpunk.net

Pixel 25 Download the Library
Pixel 25 Online Documentation
Pixel 25 IRC Channel



What is this?

Quote
FlashPunk is a free ActionScript library designed for developing 2D Flash games. Its goal is to provide you with a fast, clean framework for prototyping and developing games; this means most of the dirty work -- reliable framerate, sprite rendering/animation, player input, and collision detection (to name a few) -- has been covered with a set of base classes and functions for your ease of use. This gives you more time and energy to concentrate on the design and testing of your game.

It's important to note that FlashPunk is targeted towards the development of games with 2D raster/bitmap graphics, as opposed to vector graphics. It can manage thousands of animated bitmap sprites on-screen at a time without slowing, a lot faster than Flash normally could, because it operates under the assumption that your game primarily uses bitmapped graphics.

Flixel?

Sound familiar? Many of you have heard of or use Adam Atomic's lovely Flixel library, which is designed to do the very same thing. FlashPunk was the result of my deciding to create my own library because I was not comfortable with the structure of Flixel and wanted things to work my own way. After doing tons of research, and a few months of coding, I finished it, and decided that I'd pass it around so that others could use it as well.

What's the difference?

Someone brought up FlashPunk on the Flixel forums awhile back, so I took the time to explain some of the key differences between the two libraries so if people are wondering which is "better", they can instead decide which to use according to the merits of each:

Quote
+ FlxSprite's physics use FlxG.elapsed to move the sprites every frame based on the time passed since the last. FlashPunk does not use this system (although you could implement it yourself if you wanted), instead it uses a fixed-framerate that you choose at the beginning of the game, and it calls extra updates to make up for lost frames, but reduces rendering to a minimum while doing so.
 
+ FlashPunk does not use layers like FlxLayer for depth-handling, instead, it actually has active z-sorting for all the objects. All Entities have a depth variable that you can set at any time, and they will be drawing in the order from lowest-depth -> highest-depth. This is made possible because FP actually manages its Entities using linked-lists instead of arrays, so objects can rapidly shift their position in the list because they only keep track of the entity before and after them. Also, because linked-lists loop marginally faster in AS3 than arrays/vectors, an increase is achieved in the update/rendering rate (but not by much, really).
 
+ FlashPunk currently supports rectangle or pixel-perfect (via a mask) collision detection, which is very-very fast. A bit of knowledge is required on knowing how to use FP's collision functions efficiently, though, whereas Flixel allows you to ovveride hitWall/etc. and specify actions upon collision. In FP, entities can check for intersection against a specific other entity, or they can do a batch-check against a collision type. Each entity can specify its own collision search type, and when you call the collide function, you can specify which search type to check intersections against, and the first intersecting entity of that type will be returned. Since you then have a reference to that entity, you can specify on-collision actions or functions for the calling or intersecting entity yourself.
 
+ FlxSprites, by default, have a single bitmap they are assigned with several images, and you can create animations using arrays to cycle through those images in a particular order. FlashPunk works significantly different in this department. Because of the nature of my programming, I am used to assigning sprites with origin-values, or "hotspots", this basically represents the (0, 0) origin of the sprite, so if a 16x16 sprite has an origin at 8x8, whatever position you place that sprite at, the 16x16 sprite will be centered on that position. Sprites are managed through a SpriteMap class, and each of your game Entities can have as many SpriteMaps as you want (each with their own origin, image-count, etc.). So each animation would be a separate SpriteMap, and a player might have a Jump, Walk, and Idle sprite that it can switch between. Because you can also set "origins" on these sprites, when you draw a sprite rotated, for example, you can specify whether you want to draw that sprite rotated around its center, or rotated around its origin. So basically you are able to natively set a "pivot" point from which you can rotate or scale the sprite.
 
+ FlashPunk does not have all the cool built-in physics stuff that FlxSprites have right now. Sad I plan on adding "modules" to the library, such as a Platformer module, or a Physics module, that will each have special helper classes for dealing with objects with specific needs/behaviour, but I plan on doing that after getting some feedback on the initial framework and making improvements first. But until I get these built, a good bit of the physics/movement work that FlxSprites in Flixel have already done for you will have to be coded yourself if you're using FlashPunk.

+ While FlashPunk has a simple beginner tutorial, which assumes as low as no previous AS3 experience, it does not have the huge community that Flixel has to offer currently, and may never have such. I have put an Online Documentation which shows all classes, properties, and functions with descriptions of each, and hope to build a helpful search/FAQ that can answer most basic questions regarding the library. But this is a hard thing, and for the first while people might be required to contact me directly or on the forums for help until a bit of a community builds and a few more talented developers show up.

Show me!

If you haven't heard of it, my current game project which is near completion, Fight! Mechanical Shooting Device, has been coded entirely using the FlashPunk library. Here is a

of the game in action, showing off high object count and smooth framerate:




Also, some of you know fellow TIG member and game dev Matt Thorson; Matt is actually developing the next game in his Jumper series using FlashPunk, and the project is coming along awesomely!

Keep in Mind:

FlashPunk was both an ambitious project for me, and a crazy learning experience. At the moment, there may be still several small bugs that have snuck past mine and the other tester's notice and will need to be fixed. Other than that, it was originally designed to be a private library for my use, but I'm releasing it publicly merely on demand from folks who want to play around with it. I've recieved good feedback on it so far, especially from coders like me who have their roots in tools like Game Maker, and would love to get as much feedback as possible either here or on the FlashPunk forums. Regardless, please go easy on me, I'm no pro coder. Smiley But I'll do my best to build this into a cool, useful tool if folks are into using it, and any help is totally appreciated.

No credit is required or any of that crap if you want to use FlashPunk. It's released under the MIT License, so you can distribute it all you want as long as the licence TXT and all the files are intact. There are no required splash screens or anything annoying.

Cheers!
« Last Edit: February 27, 2010, 04:19:50 PM by ChevyRay » Logged
JMickle
Level 10
*****



View Profile
« Reply #1 on: January 08, 2010, 03:51:11 AM »

I am very eager to check this out! It looks like this works more like Game Maker does than Flixel, which is good since I had trouble learning Flixel at first, because of how differently the two work.

I've wanted to learn more than GML before and this looks like a nother great oppurtunity Smiley with me luck
Logged

dbb
Level 4
****



View Profile WWW
« Reply #2 on: January 08, 2010, 03:59:49 AM »

Ooh, yeah, reading through the feature list and "what differentiates this from Flixel"-list, a lot of the concepts sound familiar to me from Game Maker. This is looking like a very attractive next step on from GML.
Logged

ChevyRay
Guest
« Reply #3 on: January 08, 2010, 04:15:01 AM »

Oh, I forgot to mention, Matt Thorson's Jumper 4 is also being developed in FlashPunk Smiley I added that to the post as well. A huge thanks goes out to Matt who has helped me test the crap out of FlashPunk, make a gazillion changes and improvements to it, and continues to do so while developing his game. Not to mention just being a great pal overall.
Logged
Tom Sennett
Level 3
***


Indie Game Legend


View Profile WWW
« Reply #4 on: January 08, 2010, 09:16:02 AM »

I've been working with FP for the past few days and it is totally sweet.

It's structured very similarly to Game Maker, which is great, because GM gets lots of things right conceptually.

TRY IT, MAN
Logged

JMickle
Level 10
*****



View Profile
« Reply #5 on: January 08, 2010, 10:06:47 AM »

I've been working with FP for the past few days and it is totally sweet.

It's structured very similarly to Game Maker, which is great, because GM gets lots of things right conceptually.

TRY IT, MAN

WHAT ARE YOU WAITING FOR?

i read your signature as part of your post and said amen

EDIT; Can you make the documentation downloadable? My main computer isn't my internet computer, so I can't read up on stuff on the internet while I'm working.
« Last Edit: January 08, 2010, 10:13:33 AM by JMickle » Logged

moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #6 on: January 08, 2010, 10:45:52 AM »

Okay, just found the documentation.
Everything looks prety robust. Beer!
Are there collisions between actors and tilemap?
Logged

subsystems   subsystems   subsystems
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #7 on: January 08, 2010, 10:48:02 AM »

Okay, just found the documentation.
Everything looks prety robust. Beer!
Are there collisions between actors and tilemap?

No, tilemaps don't collide.  You can use a Grid or just a bunch of block objects for that.

Really happy to see this finally gone public! You have an awesome engine on your hands here Chev.
Logged

ChevyRay
Guest
« Reply #8 on: January 08, 2010, 10:51:01 AM »

Right now, not directly. I wanted to add that in, but wasn't quite sure how I'd want to set it up. What there is though is an included Grid class in punk.core, which you can use to set up a collision grid and test Entity's collisions against it. So you can basically fill in the grid as you fill in the tilemap (it even has a loadFromString() function which works the same as the Tilemap's loadFromString() does).

What you could also do is just create invisible Entity objects overtop of the TileMap (which is a bit of a hack, but can work nicely if you have different types of surfaces/platforms that you want to behave differently in your game) and set their collision info using the Entity's setCollisionType() and setCollisionRect() functions.

EDIT: oh, Matt beat me to it. Cheesy

EDIT2: @moi so what did you mean "zoom on a sprite"? Do you mean actually "zoom the view" in on the sprite, or just upscale it? If you mean just scale the sprite up, what you can do is upgrade your Actor entities up to Acrobats, which will give them many more drawing properties, such as scaleX and scaleY factors, an alpha blending factor, and more.
Logged
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #9 on: January 08, 2010, 10:52:41 AM »

Yeah I understand, actually it might be better this way (to set up a grid alongside the tilemap).
From what I see, it might be possible to use any map tool (such as mappy) rather easily for creating tilemaps.
Logged

subsystems   subsystems   subsystems
ChevyRay
Guest
« Reply #10 on: January 08, 2010, 10:55:23 AM »

Yeah, if you get a tilemap tool that can output text files or strings, it should be quite easy. For F!MSD, I actually just used Pro Motion to build the tilesets, which could then export in its Simple Text format which I could then just embed, pass as a string, and then create a new TileMap from.

If you're more tech savvy like Matt, you can create your own TileMap editor that exports in a load-friendly manner for FlashPunk, and uses XML instead of strings, and then just write your own loading function for an extended TileMap Smiley

Quote
EDIT; Can you make the documentation downloadable? My main computer isn't my internet computer, so I can't read up on stuff on the internet while I'm working.

I will see to doing this. It's currently not because I had to learn PHP specifically to build the FlashPunk website Tongue I didn't know it beforehand, so some things are kinda hacked together quickly and need cleaned up. I'll see if I can generate a V0.73 downloadable doc for you guys to use, because it's much nicer to have one you can refer to on the go.
Logged
JMickle
Level 10
*****



View Profile
« Reply #11 on: January 08, 2010, 11:53:02 AM »

yay. i'll see what I can hack through with what i got so far first for the time being Smiley i'm really excited about this  Kiss
Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #12 on: January 08, 2010, 08:54:26 PM »

Awesome work Chevy!  Grin
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #13 on: January 08, 2010, 10:05:58 PM »

is there a requirement that the logo be shown in front of every game that uses it, the way flixel has? that's one thing that put me off about flixel, that every single game that uses it uses the flixel logo on startup
Logged

deathtotheweird
Guest
« Reply #14 on: January 08, 2010, 10:11:53 PM »

is there a requirement that the logo be shown in front of every game that uses it, the way flixel has? that's one thing that put me off about flixel, that every single game that uses it uses the flixel logo on startup

ive seen a lot of flixel games that dont have the logo. and all you have to do is comment out a line in FlxGame.as, I assume it's just as simple in Flashpunk
Logged
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #15 on: January 08, 2010, 10:13:36 PM »

Flixel actually supports not showing the logo, and you don't even have to "hack it out" by commenting anything.  In the constructor for your game you just pass it a false parameter instead of a true for a certain argument.

FlashPunk has the same feature.

So to answer Rinku's question: No, you don't need to show the logo, but you don't need to in Flixel either.
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #16 on: January 08, 2010, 10:39:14 PM »

thanks-thanks

the documentation for this at least looks easier to understand than flixel's -- although i'd still prefer if there were an option to display all the documentation on one page, for printing purposes. but it at least seems like it'd be easier to do this for this documentation than flixel's, because flixel's was separated into like 400 different pages, and this into only about 50 different pages. still, i wish it were all in one place.
Logged

Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #17 on: January 08, 2010, 10:50:29 PM »

Printing would be a bad idea, it's not even v1.00 yet so it's going to change (and probably even quite often after 1.00).

I feel like the docs are great for looking up specifics, but if you're a beginner you should be doing a tutorial first.
Logged

JaJitsu
Level 10
*****


View Profile WWW
« Reply #18 on: January 08, 2010, 11:53:23 PM »

downloaded! ill maybe try something tomorrow
Logged

ChevyRay
Guest
« Reply #19 on: January 08, 2010, 11:55:25 PM »

is there a requirement that the logo be shown in front of every game that uses it, the way flixel has? that's one thing that put me off about flixel, that every single game that uses it uses the flixel logo on startup

The last paragraph on my first post:

Quote
No credit is required or any of that crap if you want to use FlashPunk. It's released under the MIT License, so you can distribute it all you want as long as the licence TXT and all the files are intact. There are no required splash screens or anything annoying.

So no, no logo requirement at all Smiley

EDIT:

thanks-thanks

the documentation for this at least looks easier to understand than flixel's -- although i'd still prefer if there were an option to display all the documentation on one page, for printing purposes. but it at least seems like it'd be easier to do this for this documentation than flixel's, because flixel's was separated into like 400 different pages, and this into only about 50 different pages. still, i wish it were all in one place.

Also working on this, as it has been requested several times already. It just was a beefload of work to get that documentation finished up already; I'll get a nice downloadable version prepared that folks will be able to use as well, but hopefully the FAQ and examples/tutorials on the site will be visited most, because (like Matt said) those should prove to be a lot more engaging and useful.
« Last Edit: January 09, 2010, 12:21:12 AM by ChevyRay » Logged
Pages: [1] 2 3
Print
Jump to:  

Theme orange-lt created by panic