Though I'm usually reluctant to post anything that hasn't maintained some polish, per 23's request I'm going to post a screenshot of something I'm working on. Basically I'm finishing off the core baseline of my framework. I'm thinking about releasing a version so I can use it in SpeedHack without having to include it in the entry. What you see in the screenshots dosn't represent any capability of the framework itself, more of a test-use that came together quickly.
{"name":"604422","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/1\/310d4f147b68b1689bcd34d612e5c5c9.png","w":960,"h":720,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/3\/1\/310d4f147b68b1689bcd34d612e5c5c9"}
{"name":"604424","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/0\/20a7f813bfc061de5dec07afb6f9cd7a.png","w":968,"h":728,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/2\/0\/20a7f813bfc061de5dec07afb6f9cd7a"}
Obviously it some kind of platform game. I put together an absolute-basic tilemap because I hadn't yet done that in A5. Minus the framework, this working demo has come together in about 2 days. The tall rectangle in the middle is the player's bounding box, and the smaller rectangles are bats.
The second screenshot applies 3 filters: desaturate, a 1px blur, and a paper texture using multiply blending. This was more for fun than anything else. I think it looks awesome but I wouldn't want to use it in any full-length game.
The thing I'm most stoked about is that there are only 5 tiles in this example! TILE_NONE, TILE_GRASS, TILE_BLOCK, TILE_PILLAR, and TILE_DIRT. All of the borders, shading, and grass edging are calculated on render and drawn using the component graphics. Makes things a lot quicker when putting together a level. ("Mehuh
I was doing that back in 1992!
meauh!" yea shuddup!
)
The purpose is to have something that fully sets up Allegro 5 out of the box, and remains separated from the game you're working on. (I don't like forgetting to call al_init_font_addon(), chasing down the error, and the like.)
includes a font_bin, sample_bin, and image_bin for very fast error-proof loading/retrieval by filename.
useful functions and classes like tostring(), vec2d, animate(), profiling_timer, etc.
the Framework class has function pointers that you use to interface with your program. They're optional, and get called when their corresponding ALLEGRO_EVENTs are fired.
For the program in the screenshot, my main() looks like this:
int main(int argc, char *argv[]) { Framework *framework = new Framework(/* optional .cfg filename */); framework->timer_func = my_timer_func; framework->key_up_func = my_key_up_func; framework->key_down_func = my_key_down_func; framework->mouse_axes_func = my_mouse_axes_func; framework->run_loop(); return 0; }
a typical timer func looks like this:
void my_timer_func(Framework *f, ALLEGRO_TIMER_EVENT *ev) { al_clear_to_color(al_color_name("black")); update_animated(); /* update stuff here */ /* draw stuff here */ al_flip_display(); }
Here's what the framework looks like at the moment:
I'm not planning on including this in the release, but class UIFramework : public Framework does more stuff "in the background" and among other things includes a UI. For example, it wraps the user's custom timer_func() by:
clearing to a background_color and/or background_image
drawing the UI
updating animations
flipping the display.
and also wraps most of the input functions with UI stuff.
Using the UIFramework, I've put together a few programs where I haven't needed to use a custom timer_func() at all, because everything is object controlled.
Raise your right hand if you looked at the pictures but didn't read any of the text.
First I looked then I read. Looks good. Both the screenshots and the framework. Although I'm not sure I'd use it, because I get anal about controlling the timing.
The 'testing lines' in that paper filter make it look like an old film filter. Does the paper texture move with the level? That would be awesome.
Does the paper texture move with the level? That would be awesome.
Yea. It's a giant looping texture.
The 'testing lines' in that paper filter make it look like an old film filter. Does the paper texture move with the level? That would be awesome
I just assumed it was an old film filter, given the dust/grains and lines on the texture. Looked exactly like an old reel to reel film.
* raises right hand *
It looks cool.
Raise your right hand if you looked at the pictures but didn't read any of the text.
From now on when I make big blocks of text, I'm going to drop in "Matthew sucks" somewhere in the middle.
...
I encourage others to join me.
That looks amazing!
Is it possible to get filter effects like that using A4?
This looks great!
... and the text was interesting to read as well.
So, you going to release this thing so others can use it as well?
The old paper effect looks great.
Woo! I have a fetish for frameworks, drool!
So, you going to release this thing so others can use it as well?
Yep. Hopefully soon.
Raise your right hand if you looked at the pictures but didn't read any of the text.
Raise your left hand if you looked at the pictures but didn't read any of the text or anyone's replies.
However, I have a question, is it my eyes or your screenshot - it looks like the screen is tilted slightly on an angle. I'm curious cos a 2D pivoting platformer sounds quite interesting
Good pictures. Are you going to make a little game using your framework?, I'll play the game and skip the rest . I have the same question that Neil posted in his last post, the map it's a little bit rotated?.