Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* New format for GG2 leveldata.
- * This JSON document fully describes a GG2 level.
- * It can be embedded into a PNG with GG2DLL,
- * packed up in a zip along with any BG/WM images,
- * sent over the network, etc.
- *
- * Also this should be ready for future improvements and changes, unlike the terrible older format.
- */
- {
- format: 1, /* a format number?
- * GG2 can reject maps with newer format numbers than it supports,
- * and can provide legacy loading code for older format numbers
- */
- mapInfo: {
- name: 'TwoDeeFort-Redux',
- gameMode: 'CTF', /* support multiple gamemodes in a single map?
- * cspotcode says 'no' because it would be too complicated,
- * require extra GUI in GG2 for server host to choose game mode,
- * and provide only minimal benefit
- */
- description: 'Anything the author wants. Could have contact info. Could be displayed in a possible GG2 levelpicker GUI'
- /* other stuff? setup time, respawn wave duration, other timers? */
- }
- collisionMasks: [ /* list of collision images.
- * These are all black/white like a walkmask but can theoretically be used for anything.
- * They will be turned into collision sprites by GG2 and can be referenced by entities below.
- */
- {
- name: 'walkmask',
- size: {width: 700, height: 300},
- data: 'TODO WHAT FORMAT SHOULD THIS DATA BE IN? MAYBE A BASE64 ENCODED STREAM OF BITS?'
- },
- {
- name: 'funkyShape', /* could be some strange, non-rectangular shape for a fragbox that the level designer wanted to paste all over the map */
- size: {width: 10, height: 20},
- data: 'AIENCMNUE'
- }
- ],
- entities: [ /* all entities on the map */
- {
- type: 'redspawn', /* boring old entity */
- position: {x: 156, y:34}
- },
- {
- type: 'fragBox',
- position: {x:500, y:435},
- size: {width: 200, height: 20} /* a resizable entity! */
- },
- {
- type: 'controlPoint',
- position: {x: 20, y: 20},
- pointNumber: 2 /* an entity parameter! */
- },
- {
- type: 'wall',
- position: {x: 0, y: 0},
- collisionMask: 'walkmask' /* refers to the collisionMasks array above */
- }
- {
- type: 'wall',
- position: {x: 200, y: 250},
- size: {width: 10, height: 10} /* same entity type as above, but this time we specify the collision mask as a solid rectangle.
- * No collisionMasks reference needed */
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement