game:
timeDilation : 1.0
- # zoom : 1.0
gameoverDelay : 1000
debug:
showFpsGraph : false
- enableGameLogging : false
- # createGridTable : false
- # showGridCoords : false
+ # enableGameLogging : false
+ # createGridCanvas : false
+ createGridTable : false
+ showGridCoords : false
map:
refSize : &ref_size 50
rockSizeMin : 12.5
overlayPathmap : false
traceTrajectories : false
ui:
- createGridCanvas : true
overlayOnPause : true
showAttackCooldown : false
showCountdown : true
test:
name: Da Test
desc: A test level.
- levelSize: 2000 500
+ levelSize: 1000 500
bounds:
- - [-50,-50, 2100,50]
+ - [-50,-50, 1100,50]
- [-50,0, 50,500]
- - [2001,0, 50,500]
- - [-50,501, 2100,50]
+ - [1001,0, 50,500]
+ - [-50,501, 1100,50]
walls:
- type: wall
args: [300,50, 50,200] # [x,y, w,h]
- type: wall
args: [450,300, 50,200]
- - type: fence
+ - type: pit
args: [360,210, 30,30]
- type: rock
args: [400,200, 25,25]
- type: rock
args: [425,225, 25,25]
- - type: fence
+ - type: pit
args: [460,210, 30,30]
- - type: fence
+ - type: pit
args: [10,210, 30,30]
- - type: fence
+ - type: pit
args: [110,210, 30,30]
- - type: fence
+ - type: pit
args: [210,210, 30,30]
- type: rock
args: [100,400, 50,50]
- type: rock
args: [150,300, 50,50]
+
+ - type: rock
+ args: [560,100, 30,30]
+ - type: rock
+ args: [575,130, 20,20]
+ - type: rock
+ args: [550,150, 40,40]
+ - type: rock
+ args: [560,190, 10,10]
+ - type: pit
+ args: [560,210, 30,30]
+ - type: rock
+ args: [550,250, 25,25]
+ - type: rock
+ args: [550,275, 25,25]
+ - type: rock
+ args: [575,290, 10,10]
+ - type: rock
+ args: [560,300, 30,30]
+ - type: rock
+ args: [575,330, 20,20]
+
+ - type: wall
+ args: [650,250, 50,50]
+ - type: pit
+ args: [500,400, 150,100]
+
+ # moat
+ - type: pit
+ args: [725,50, 10,10]
+ - type: pit
+ args: [725,60, 25,280]
+
+ # rock hallway
+ # - type: wall
+ # args: [750,0, 25,50]
+ # - type: wall
+ # args: [875,0, 25,50]
+ - type: rock
+ args: [725,0, 50,50]
+ - type: rock
+ args: [735,50, 10,10]
+ - type: rock
+ args: [745,50, 10,10]
+ - type: rock
+ args: [755,50, 10,10]
+ - type: rock
+ args: [765,50, 10,10]
+ - type: rock
+ args: [750,60, 10,10]
+ - type: rock
+ args: [760,60, 30,30]
+ - type: rock
+ args: [860,60, 30,30]
+ - type: rock
+ args: [760,160, 30,30]
+ - type: rock
+ args: [860,160, 30,30]
+ - type: rock
+ args: [760,260, 30,30]
+ - type: rock
+ args: [860,260, 30,30]
units:
- type: player
- type: green
align: 2
loc: [175,25]
- # - type: green
- # align: 2
- # loc: [425,125]
+ - type: green
+ align: 2
+ loc: [525,25]
+ - type: green
+ align: 2
+ loc: [675,425]
+ - type: orange
+ align: 2
+ loc: [775,125]
+ - type: orange
+ align: 2
+ loc: [775,325]
items:
- # - type: rockets
- # loc: [325,275]
+ - type: rockets
+ loc: [75,275]
- type: nitro
loc: [325,25]
- type: wall
args: [100,100, 50,50]
- - type: fence
+ - type: pit
args: [360,210, 30,30]
- type: rock
args: [400,200, 25,25]
- type: rock
args: [425,225, 25,25]
- - type: fence
+ - type: pit
args: [460,210, 30,30]
- - type: fence
+ - type: pit
args: [10,210, 30,30]
- - type: fence
+ - type: pit
args: [110,210, 30,30]
- - type: fence
+ - type: pit
args: [210,210, 30,30]
- type: rock
- type: wall
args: [100,100, 50,50]
- - type: fence
+ - type: pit
args: [360,210, 30,30]
- type: rock
args: [400,200, 25,25]
- type: rock
args: [425,225, 25,25]
- - type: fence
+ - type: pit
args: [460,210, 30,30]
- - type: fence
+ - type: pit
args: [10,210, 30,30]
- - type: fence
+ - type: pit
args: [110,210, 30,30]
- - type: fence
+ - type: pit
args: [210,210, 30,30]
- type: rock
- type: wall
args: [100,100, 50,50]
- - type: fence
+ - type: pit
args: [360,210, 30,30]
# - type: rock
# args: [400,200, 25,25]
# - type: rock
# args: [425,225, 25,25]
- - type: fence
+ - type: pit
args: [460,210, 30,30]
- - type: fence
+ - type: pit
args: [10,210, 30,30]
- - type: fence
+ - type: pit
args: [110,210, 30,30]
- - type: fence
+ - type: pit
args: [210,210, 30,30]
- type: rock
body : '#E73075'
turret : '#A72F5B'
barrel : '#2E62C9'
+
blue:
name: Blue Tank
desc: A friendly blue tank.
body : '#4596FF'
turret : '#182B53'
barrel : '#F25522'
+
green:
name: Green Tank
desc: A very green tank.
move : 0.75
power : 1
speed : 0.5
- shots : 3
+ shots : 5
ai:
path : 1.0
dodge : 1.0
body : '#83BB32'
turret : '#1C625B'
barrel : '#D43B24'
-
+
+ orange:
+ name: Orange Tank
+ desc: A very orange tank.
+ tags: [ 'tank' ]
+ symbol: tanks/thing/tank.Tank
+ lootTable : rich
+ stats:
+ hp : 1
+ move : 0.45
+ power : 1
+ speed : 0.35
+ shots : 3
+ ai:
+ path : 1.0
+ dodge : 1.0
+ shootIncoming : 0.10
+ shootEnemy : 0.35
+ colors:
+ body : '#EE8057'
+ turret : '#C13B00'
+ barrel : '#244792'
+
'Level' : require('tanks/map/level').Level,
'Wall' : require('tanks/map/wall').Wall,
'Rock' : require('tanks/map/rock').Rock,
- 'Fence' : require('tanks/map/fence').Fence
+ 'Pit' : require('tanks/map/pit').Pit
});
allWalls : null, // All walls in this map
innerWalls : null, // Non-boundary walls
- denseWalls : null, // Non-boundary non-Fences
+ denseWalls : null, // Non-boundary non-Pits
,
-Fence =
-exports['Fence'] =
-Wall.subclass('Fence', {
+Pit =
+exports['Pit'] =
+Wall.subclass('Pit', {
isReflective : false,
- init : function initFence(x,y, w,h){
+ init : function initPit(x,y, w,h){
Wall.init.call(this, x,y, w,h, this.isBoundary);
},
, h = this.canvasHeight
;
- // if ( this.createGridTable ) {
- // var tbody = $('<tbody/>');
- // Y(0, rows).forEach(function(y){
- // var row = $('<tr class="row row'+y+'" />').appendTo(tbody);
- // Y(0, cols).forEach(function(x){
- // $('<td class="cell cell'+x+'_'+y+' col'+x+'">'+x+','+y+'</td>')
- // .width(side).height(side)
- // .appendTo(row);
- // }, this);
- // }, this);
- //
- // this.table =
- // $('<table class="grid" cellspacing="0" cellpadding="0" />')
- // .width(this.layerWidth)
- // .height(this.layerHeight)
- // .append(tbody)
- // .prependTo( this.layer );
- //
- // } else
- // this.table = null;
+ if ( this.createGridTable ) {
+ var tbody = $('<tbody/>');
+ Y(0, rows).forEach(function(y){
+ var row = $('<tr class="row row'+y+'" />').appendTo(tbody);
+ Y(0, cols).forEach(function(x){
+ $('<td class="cell cell'+x+'_'+y+' col'+x+'">'+(x*side)+','+(y*side)+'</td>')
+ .width(side).height(side)
+ .appendTo(row);
+ }, this);
+ }, this);
+
+ this.table =
+ $('<table class="grid" cellspacing="0" cellpadding="0" />')
+ .width(this.layerWidth)
+ .height(this.layerHeight)
+ .append(tbody)
+ .prependTo( this.layer );
+
+ } else
+ this.table = null;
if ( this.createGridCanvas ) {
ctx.lineWidth = this.lineWidth;
});
-config.updateOnChange(['ui.createGridTable', 'ui.createGridCanvas'], Grid.fn);
+config.updateOnChange(['debug.createGridTable', 'debug.createGridCanvas'], Grid.fn);
overlay = $('#overlay');
updateOverlay( config.get('ui.overlayOnPause') );
- config.on('set:ui.overlayOnPause', function(evt){ updateOverlay(evt.newval); });
- config.on('set:ui.debug.showFpsGraph', function(evt){ updateUI('#info', evt.newval); });
+ config.on('set:ui.overlayOnPause', function(evt){ updateOverlay(evt.newval); });
+ config.on('set:debug.showFpsGraph', function(evt){ updateUI('#info', evt.newval); });
+ config.on('set:debug.showGridCoords', function(evt){ $('body')[(evt.newval ? 'add' : 'remove' )+'Class']('showGridCoords'); });
- // Player.on('create', function(evt){ P = evt.data.instance; });
+ config.set('debug.showGridCoords', config.get('debug.showGridCoords'));
/// Debug ///
if (qkv.debug || config.get('debug.showFpsGraph'))
updateUI('#info', SHOW);
+
// Show debug menus
$(document).bind('keydown', 'ctrl+d', function(evt){ updateUI('.debug', TOGGLE); });
$(document).bind('keydown', 'ctrl+i', function(evt){ updateUI('#info', TOGGLE); });
, min = Y(Math.min).limit(2)
, max = Y(Math.max).limit(2)
-, PAD_X = 1024, PAD_Y = 690
+, PAD_X = 1024, PAD_Y = 690 // viewport padding is max iPad resolution (heh)
,
Viewport =
_layerId : 'viewport',
spacer : null, // inner layer to induce scrolling so we can arbitrarily center the elements
- maxBleedX : 10, // Maximum amount of empty space to show to the left/right of content. (Tip: set to Infinity to disable)
- maxBleedY : 10, // Maximum amount of empty space to show to the top/bottom of content. (Tip: set to Infinity to disable)
+ maxViewWidth : 600, // Max portal sizes
+ maxViewHeight : 520,
+ maxBleedX : 10, // Maximum amount of empty space to show (Tip: set to Infinity to disable)
+ maxBleedY : 10,
init : function initViewport(props, attrs, html){
HtmlLayer.init.call(this, props, attrs, html);
+ this.css({ 'max-width':this.maxViewWidth, 'max-height':this.maxViewHeight });
this.spacer = $('<div class="spacer ezl layer" />').appendTo(this.layer);
},
.bigblue { position:fixed; width:100%; top:50%; margin-top:-200px; z-index:1001; }
.bigblue .box { width:400px; margin:0 auto; padding:1em; color:#000; background-color:#2992C5;
- box-shadow:7.5px 7.5px 15px #000; -moz-box-shadow:7.5px 7.5px 15px #000; -webkit-box-shadow:7.5px 7.5px 15px #000; }
+ box-shadow:5px 5px 6px 2px rgba(0,0,0,0.4); -moz-box-shadow:5px 5px 6px 2px rgba(0,0,0,0.4); -webkit-box-shadow:5px 5px 6px 2px rgba(0,0,0,0.4); }
.bigblue h1 { text-align:center; font-size:2em; letter-spacing:2px; }
.bigblue h2 { font-size:1.1em; letter-spacing:2px; }
.bigblue .start { margin:1.5em 0 0.5em; text-align:center; border:0; }
/*** Game and Viewport ***/
#game { position:relative; width:100%; height:100%; margin:0; padding:0; }
-#viewport { position:relative; width:100%; height:100%; max-width:1024px; max-height:690px;
- overflow:hidden; cursor:crosshair; margin:0 auto; background-color:#3F3F3F; }
+#viewport { width:100%; height:100%; /* max-width:1024px; max-height:690px; */ /* <- Set by Viewport class */
+ position:relative; margin:10px auto; overflow:hidden; cursor:crosshair;
+ background-color:#3F3F3F; border:15px solid #222;
+ box-shadow:inset 0 0 5px 1px rgba(0,0,0,0.4); -moz-box-shadow:inset 0 0 5px 1px rgba(0,0,0,0.4); -webkit-box-shadow:inset 0 0 5px 1px rgba(0,0,0,0.4); }
#viewport > .layer { margin:690px 1024px; }
#viewport > .spacer { position:absolute; z-index:-1; width:1024px; height:690px; /* width:100%; height:100%; */ }
#viewport .layer.grid { outline:1px solid rgba(255,255,255, 0.1); }
#config input[type=checkbox] { top:0.33em; }
-table.grid { position:absolute; top:0; left:0; z-index:10; }
+#viewport .layer.grid { z-index:1000; }
+table.grid { position:absolute; top:0; left:0; }
table.grid,
-table.grid td { /* outline:1px solid rgba(255,255,255,0.1); */
- color:transparent; font: 18pt monospace;
+table.grid td { outline:1px solid rgba(255,255,255,0.05);
+ color:transparent; font: 10px/50px Menlo, monospace; text-align:center;
margin:0; padding:0; white-space:nowrap; overflow:hidden; }
-.showGridCoords table.grid td:hover { color:rgba(255,255,255,0.1); }
+.showGridCoords table.grid td:hover { color:rgba(255,255,255,0.5); }
/*
#debug { position:relative; top:1em; right:1em; z-index:5000; }