forked from nicupavel/openpanzer
-
Notifications
You must be signed in to change notification settings - Fork 0
HTML5 Panzer General 2
phpfreak/openpanzer
Β
Β
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Β | Β | |||
Repository files navigation
Open Panzer - HTML5 Panzer General 2 http://openpanzer.net http://www.linuxconsulting.ro/openpanzer/ Copyright(c) 2012-2014 Nicu Pavel <npavel@linuxconsulting.ro> The code of Open Panzer is issued under the GNU General Public License (GPL), version 2 or later. By contributing code or content to the project, you agree for it to be distributed under GPL or whatever other open-source license the project maintainers choose in the future. http://www.gnu.org/licenses/old-licenses/gpl-2.0.html Supported browsers: OpenPanzer respects latest W3.org HTML5, CSS3 specs and browser specific specs are kept to a minimum -> null. Base supported javascript engine is V8 open source engine. Code should be kept to basic features of ECMAScript 5. OpenPanzer works in recent Google Chrome, Mozilla Firefox, Safari and Opera. OpenPanzer works on Android (tested on 2.2, 2.3, 4.x) and iOS devices (5.0+). Internet Explorer will probably work with version 11 but extensive code changes for IE aren't a priority. Source code structure description: . βββ css - style sheets used for ui elements βΒ Β βββ fonts.css - fonts used in game βΒ Β βββ ui-combat-info.css - animations used during combat βΒ Β βββ ui-equipment.css - equipment window style and positioning βΒ Β βββ ui-message.css - message windows style and positioning βΒ Β βββ ui-startmenu.css - main menu shown when game starts βΒ Β βββ ui-unit-info.css - unit information dialog βΒ Β βββ ui.css - main window, main menu, generic dom elements βββ js βΒ Β βββ ai.js - AI engine βΒ Β βββ animation.js - draws a series of sprites in a time interval βΒ Β βββ dom.js - generic function that deal with DOM βΒ Β βββ eventhandler.js - event driven function (unused atm) βΒ Β βββ game.js - game manager βΒ Β βββ gamerules.js - attack, move, resupply, reinforce, distance rules βΒ Β βββ gamestate.js - save/load game state to HTML5 local storage βΒ Β βββ map.js - hex, map and player objects βΒ Β βββ maploader.js - loads scenarios and maps from a xml file βΒ Β βββ prototypes.js - generic definitions βΒ Β βββ render.js - canvas rendering functions βΒ Β βββ sound.js - generic unit sounds functions βΒ Β βββ style.js - canvas style for render.js βΒ Β βββ unit.js - unit and transport objects βΒ Β βββ ui.js - handle mouse, builds/updates UI windows βββ resources βΒ Β βββ animations - images with 1 row of sprites for animations βΒ Β βββ campaigns - campaigns and campaignlist.js index converted with tools/campaign/campaign-convert.py βΒ Β βββ equipment - contains units equipment/properties βΒ Β βββ fonts - fonts used in OpenPanzer βΒ Β βββ maps - big images for the map background βΒ Β βββ scenarios - scenarios and scenariolist.js index converted with tools/map/mapconvert.py βΒ Β βββ sounds - sounds used for units βΒ Β βββ ui βΒ Β βΒ Β βββ buttons - generic buttons (ok/close) βΒ Β βΒ Β βββ cursors - mouse cursors used in game βΒ Β βΒ Β βββ dialogs βΒ Β βΒ Β βΒ Β βββ equipment - images for equipment buttons/dialog βΒ Β βΒ Β βΒ Β βββ startmenu - images for start menu dialog βΒ Β βΒ Β βΒ Β βββ ui-message - images for message dialog βΒ Β βΒ Β βΒ Β βββ unit-context - images for buttons that pop up on unit selections βΒ Β βΒ Β βΒ Β βββ unit-info - images for unit info stats βΒ Β βΒ Β βββ flags - small (for cities) and big (for unit info) flags βΒ Β βΒ Β βββ indicators - small indicators that are drawn on the map (unit has fired) βΒ Β βΒ Β βββ menu - images used on main window text bar or main menu βΒ Β βΒ Β βββ splash - splash images used as loading screen on android/ios βΒ Β βΒ Β βββ page - images used outside main window βΒ Β βββ units - 1x9 sprites with unit orientations for each unit βββ tools β βββ campaign - converts campaigns from PG2 .cam format β βββ equipment - converts PG2Suite exported equipment to js equipment β βββ icons - converts SHPTool exported bmp to transparent png β βββ map - converts SCN,MAP,TXT files to OpenPanzer XML β βββ index.html - html file with basic DOM structure for openpanzer Development notes: OpenPanzer doesn't use any extra javascript libraries (like jquery, node etc) and should be kept like this. Styling DOM elements should be done in their CSS files. Adding style for static elements in the code shouldn't exist. All positioning of DOM elements should be done in CSS files. Bottom line: if something can be done in a css file do not do it in the javascript code. Code additions should follow the coding style used so far (for object creation etc). Main testing is done on Google Chrome and Firefox under Linux. Running the code locally in Google Chrome requires --allow-file-access-from-files option when starting Google Chrome. Graphical assets and other resources: Unit images are taken from OpenGeneral Icons project: http://opengeneral.sourceforge.net/db/icons/ This game has been built around the specification of the original game compiled by Luis Guzman: http://luis-guzman.com/links/PG2_FilesSpec.html Unit equipment is exported from PG2Suite: http://luis-guzman.com/PG2_Suite.html before being converted into a json format.
About
HTML5 Panzer General 2
Resources
Stars
Watchers
Forks
Packages 0
No packages published
Languages
- JavaScript 87.9%
- CSS 9.3%
- HTML 2.8%