torpor
hack hack hack, the little machines fight back
SVG.. Okay, here's how it works:
1. You use an editor to design your graphics. Inkscape, for example, is an excellent editor for the job. (http://inkscape.org/)
2. This produces a text file which is a description of the graphics .. not bitmaps, but rather an organized 'language' for how to construct the image.
3. Objects in this file are described, you can give them names, and you can arrange the internal structure hierarchically however you like. Your engine has a 'dictionary' of objects it looks for, such as "player", "enemy", "success", "failure", etc. These words map directly to the ID's in your SVG file of the objects that are supposed to be displayed when the specific state you're animating is active. The engine itself is a state machine .. "player moving" -> 'find object "player", move it', "player dead" -> 'find object "playerdead", display it", etc.
4. Your game engine reads this SVG file, parsing it (libsvg/libsvg-cairo/libcairo) and produces a CAIRO (http://cairographics.org) render-list. This render-list is a faster, vector-based (2d graphics) instruction set for how to construct the graphics described through your SVG. This is done on start-up of your game engine.
5. Your engine state machine runs, sequencing through the states in the machine, based on input, enemy animation, etc.
The reason I'm interjecting this idea into this thread, is because you said you wanted to learn something. I am actively watching your progress on this with interest, and I'm not trying to hijack your progress, but give you an alternative way to look at the problem. I also have an interest in the idea of creating a "Game And Watch" engine, for which games can *easily* be created using just the Inkscape editor and a standardized dictionary of objects which the G&W engine itself can understand .. I think this would be a good project. Please do not take my advice as an attempt to be critical of your efforts; certainly, what you are learning is of interest to me in the context of designing a general-purpose engine which could accomplish the same goal ..
In the end, I'd like to see a G&W engine that can have new games added to it simply by putting .SVG files in a common directory .. get where I'm coming from?
If you make your bitmap of the game-screen available somewhere (paste it in this thread even), I will convert it to SVG and make a very simple example of what I'm talking about for you to see why I think this is worth the discussion ..
1. You use an editor to design your graphics. Inkscape, for example, is an excellent editor for the job. (http://inkscape.org/)
2. This produces a text file which is a description of the graphics .. not bitmaps, but rather an organized 'language' for how to construct the image.
3. Objects in this file are described, you can give them names, and you can arrange the internal structure hierarchically however you like. Your engine has a 'dictionary' of objects it looks for, such as "player", "enemy", "success", "failure", etc. These words map directly to the ID's in your SVG file of the objects that are supposed to be displayed when the specific state you're animating is active. The engine itself is a state machine .. "player moving" -> 'find object "player", move it', "player dead" -> 'find object "playerdead", display it", etc.
4. Your game engine reads this SVG file, parsing it (libsvg/libsvg-cairo/libcairo) and produces a CAIRO (http://cairographics.org) render-list. This render-list is a faster, vector-based (2d graphics) instruction set for how to construct the graphics described through your SVG. This is done on start-up of your game engine.
5. Your engine state machine runs, sequencing through the states in the machine, based on input, enemy animation, etc.
The reason I'm interjecting this idea into this thread, is because you said you wanted to learn something. I am actively watching your progress on this with interest, and I'm not trying to hijack your progress, but give you an alternative way to look at the problem. I also have an interest in the idea of creating a "Game And Watch" engine, for which games can *easily* be created using just the Inkscape editor and a standardized dictionary of objects which the G&W engine itself can understand .. I think this would be a good project. Please do not take my advice as an attempt to be critical of your efforts; certainly, what you are learning is of interest to me in the context of designing a general-purpose engine which could accomplish the same goal ..
In the end, I'd like to see a G&W engine that can have new games added to it simply by putting .SVG files in a common directory .. get where I'm coming from?
If you make your bitmap of the game-screen available somewhere (paste it in this thread even), I will convert it to SVG and make a very simple example of what I'm talking about for you to see why I think this is worth the discussion ..