Version 0.4

Added loader which loads external files, not working properly so may
remove. Added main menu, multiplayer just goes to singleplayer for now.
Moved levels into separate .js file for easy editing and changed
structure for procedural level generation. Other minor changes.
This commit is contained in:
Markus Scully 2013-07-31 17:53:02 +01:00
parent 1154147739
commit 20bd7ea249
5 changed files with 384 additions and 99 deletions

165
level.js Normal file
View file

@ -0,0 +1,165 @@
function defineLevels(){
levels = [
[
'################################################'
,'################################################'
,'##..............................................'
,'##..............................................'
,'##.............................##########.....##'
,'##.............................##########.....##'
,'##...................####.....................##'
,'##...................####.....................##'
,'##...........................####.............##'
,'##...........................####.............##'
,'##............................................##'
,'##..###..##........####..............###########'
,'###########........#############################'
,'################################################'
,'################################################'
,'################################################'
,'################################################'
,'################################################'
,'################################################'
,'################################################'
],
[
'#################################################'
,'#################################################'
,'#..............................................##'
,'#..............................................##'
,'##################.............................##'
,'##################....#######..................##'
,'#.....................#######..................##'
,'#................................#####.........##'
,'#................................#####.........##'
,'#.....................########.................##'
,'#.....................########.................##'
,'#............######............................##'
,'#............######............................##'
,'#......###.....................................##'
,'#.....####.....................................##'
,'#....#####.....................................##'
,'#...######xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx##'
,'#..#######xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx##'
,'#################################################'
,'#################################################'
],
[
'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'..................................................................................................................'
,'........####......................................................................................................'
,'........####......................................................................................................'
,'........####......................................................................................................'
,'##..............................................................................................................##'
,'##...............###.............................................................###............................##'
,'##...............###............................................................................................##'
,'##...............#######........................................................................................##'
,'##################################################.....###########################################################'
,'##################################################################################################################'
,'##################################################################################################################'
,'##################################################################################################################'
,'##################################################################################################################'
]
];
levelparts = [
[
'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'###################'
,'###################'
,'###################'
,'###################'
,'###################'
,'5n', '5n', 1, 50, 2 // What type of connection it has left, right, the minimum level it appears, the maximum, and the rarity
],
[
'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'................###'
,'................###'
,'.....########...###'
,'.....########...###'
,'.....###........###'
,'########...########'
,'########...########'
,'###################'
,'###################'
,'###################'
,'5n', '10n', 2, 10, 10
],
[
'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'######.............'
,'######.............'
,'######....###......'
,'##........###......'
,'##.E......###......'
,'###################'
,'###################'
,'###################'
,'###################'
,'###################'
,'10n', '5n', 2, 15, 7
],
[
'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'...................'
,'....................'
,'.........E.........'
,'......#######......'
,'......#######......'
,'......#######......'
,'###################'
,'###################'
,'###################'
,'###################'
,'###################'
,'5n', '5n', 2, 15, 4
]
];
}