echo $opt | egrep -xq -e '--?h(e(lp?)?)?' && { halp; exit 0; }
done
+for md in doc/*.md; do
+ markdown $md -f $md.html
+done
+
EXCLUDE="--exclude=$(join ' --exclude=' 'tmp' $*)"
echo "rsync -Cavz --delete $EXCLUDE ./* less.ly:lessly/hacking/tanks/"
rsync -Cavz --delete $EXCLUDE ./* less.ly:lessly/hacking/tanks/
.countdown { position:fixed; overflow:hidden; z-index:1000; text-align:center; border:10px solid #fff; color:#fff; }
+#ai { position:absolute; z-index:1002; width:80%; left:10%; }
+ #ai h2 { font-size:1.3em; }
+ #ai .box { width:100%; }
+ #ai .ready { width:5%; float:left; margin-right:1em; }
+ #ai textarea { width:90%; height:100px; }
+
#viewport { position:relative; width:500px; height:500px; margin:1em auto; cursor:crosshair; }
#overlay { position:fixed; top:0; left:0; width:100%; height:100%; background-color:#000; opacity:0.5; z-index:100; }
-#welcome { cursor:pointer; }
+#welcome .box { cursor:pointer; }
#notes { /* position:fixed; top:4em; right:1em; color:#BFBFBF;*/ }
#notes ul, #notes ol, #notes li { list-style:circle ! important; }
#notes li { margin-left:1em; }
- `shoot(x,y)`: Fires a shot at (x,y) if possible.
- `move(x,y)`: Moves directly toward (x,y) if possible.
- `ableToShoot()` -> `Boolean`: Whether your tank is able to fire at the moment.
-- `find(x1,y1,x2,y2)` -> `Agent[]`
+- `find(x1,y1,x2,y2)` -> `Agent[]`: Returns a list of all agents within the map bounds specified.
- `findNearLike(ticks, filter)` -> `Agent[]`: Returns a list of agents within `ticks` movement distance away that match the filter.
- `findClosest(agents)` -> `Agent`: Returns the closest agent to this tank in the supplied list, or null if none are supplied.
+- `willCollide(agents, wiggle)` -> `Agent[]`: Returns the list of agents which will collide with this agent (within `wiggle` width/height pixels).
- `calculatePath(point)`
- `calculatePath(x,y)`: Calculates a path from your current location to (x,y), taking into account walls, and then queues it for future moves.
--- /dev/null
+# The Littlest Battletank
+
+Inspired by Tanks minigame off Wii Play.
+
+## The Basics
+- Your tank has 1hp.
+- Your basic cannon shoots bullets. A bullet lives for one bounce or until it kills something. You can have up to 5 bullets at a time in the air.
+- When you die, you respawn after a few seconds. (In single player, it restarts the level.)
+
+## Controls
+- wasd, arrows: move your tank.
+- mouse: aim your reticule.
+- click, space, enter: fire a shot.
+- 0-9: use items.
+- All controls can be configured.
+
+## Ideas
+- Simplicity is king.
+- Only bosses have more than 1hp
+- Always on one screen
+- No stats: all items are qualitative
+- AI makes commentary on situations. "That was close. Sucker." "loool, you always die here."
+- Use TruRank-style player rating system, but the point of multiplayer will not be the ladder
+- Optional registration (Flash cookie every user)
+- Badges, awards, stats
+- Virtual currency from various in-game activities
+
+## Power-Ups
+- Missiles (fast, no bounce)
+- Refractor Rounds (slow, infi bounces)
+- Flamethrower (Cone AOE)
+- Shrapnel Rounds (splits once on impact)
+- Mortar Rounds (Projectile AOE)
+- Mines (Stationary Prox AOE)
+- Heatseekers (Projectile Prox)
+- Nukes (Absurd AOE which often kills you)
+- Portal Cannon (Exchanges your position with your cursor)
+- K-Boss Shield (Absorbs 1 damage)
+- Gin & Tonic / iPhone 3G / Hannah Montana Lamp (Extra Life)
+- Deuschund Trebuchet (Parabolic Arc lulz)
+- Light Cannon (Faster Move, -1 Shots in Air)
+- EMP Device (aka, the "Stunna") (Freezes everyone in place. Including you.)
+
+## Mechanics
+- AOE
+- Shot Travel Speed
+- Shot Bounces
+- Shot Cooldown
+- Shots in Air
+- Move Speed
+- HP (Bosses only)
+- Allies -- companion AI tanks which play for your side, but they can still damage you
+- Can use Items
+- AI type, quality
+- Mutable Environment?
+
+
+
+
+
+
+
+
</head>
<body class="lttl tanks">
+
<div id="overlay"></div>
+<div id="ai" style="display:none" class="bigblue">
+ <div class="box">
+ <h2>Add Tank AI</h2>
+ <textarea id="custom-tank"></textarea>
+ <div class="ready pinkbutton rounded">Ready</div>
+ </div>
+</div>
+
<div id="welcome" class="bigblue">
<div class="box">
<h1>The Littlest Battletank</h1>
</div>
</div>
-
<div id="viewport"></div>
<div id="debug" style="display:none"><div class="inner box">
qkv = Y(window.location.search.slice(1)).fromKV().end();
/// Debug ///
+ if (qkv.ai) {
+ $('#welcome').hide();
+ $('#ai').toggle();
+ $('#ai textarea')[0].focus();
+ }
if (qkv.debug) $('#debug').toggle();
+ $('#ai .ready').bind('click', function(evt){
+ try {
+ var script = $('#custom-tank').val();
+ Tank.prototype.act = eval('(function(){ with(this){'+script+'} })');
+ $('#ai').hide();
+ startGame();
+ } catch(e) {
+ alert('AI Error! '+e);
+ }
+ });
+
// Show debug
$(document).bind('keydown', 'ctrl+c', function(evt){ $('#debug').toggle(); });
function setupUI(){
if ( gameExists() ) teardownUI();
- $('#welcome').show();
+ if (!qkv.ai) $('#welcome').show();
LBT.loop.spark = new FpsSparkline(LBT.loop, '.fps-sparkline', 0,0);
initConfig();
LBT.root.draw();
// Start button (click or return key)
- $(document).bind('click', startGame);
+ if (!qkv.ai) $(document).bind('click', startGame);
$(document).bind('keydown', 'return', startGame);
--- /dev/null
+CustomTank = Tank.subclass('CustomTank', {
+
+ init : function initCustomTank(align, script){
+ Tank.init.call(this, align);
+ this.act = eval('(function(){ with(this){'+script+'} })');
+ }
+
+});
\ No newline at end of file
this.activeKeys = new Y.YArray();
this.queue = [];
- // tank.act = this.act; // Override tank actions with player control
- // tank.move = this.move;
-
- $(window)
- .bind('keydown', this.keydown.bind(this))
- .bind('keyup', this.keyup.bind(this))
- .bind('mousedown', this.mousedown.bind(this))
- .bind('mouseup', this.mouseup.bind(this))
- .bind('mousemove', this.mousemove.bind(this))
+ this.keydown = this.keydown.bind(this);
+ this.keyup = this.keyup.bind(this);
+ this.mousedown = this.mousedown.bind(this);
+ this.mouseup = this.mouseup.bind(this);
+ this.mousemove = this.mousemove.bind(this);
+
+ $(document)
+ .bind('keydown', this.keydown)
+ .bind('keyup', this.keyup)
+ .bind('mousedown', this.mousedown)
+ .bind('mouseup', this.mouseup)
+ .bind('mousemove', this.mousemove)
;
},
"src/tanks/thing/thing.js",
"src/tanks/thing/bullet.js",
"src/tanks/thing/tank.js",
+ "src/tanks/thing/custom-tank.js",
"src/tanks/thing/player.js",
"src/tanks/map/loc.js",