<html><head>
<title>Tilerender</title>
<meta charset="utf8">
-</head><body onload="script()" style="width: 100%; max-height: 600px; overflow: hidden; padding: 0 auto;" >
- <canvas id="view" width="1280" height="600" style="padding: 0 auto; max-height: 600px;">
+</head><body onload="script()" style="width: 100%; height: 100vh; overflow: hidden; padding: 0; margin: 0;" >
+ <canvas id="view" width="1920" height="800" style="padding: 0;">
Canvas not supported<br/>
<img id="maptiles" src="tileset.png" width="64" style="overflow: hidden;" />
<tiles>
- <tile position="0" name="air" fluid="1"></tile>
- <tile position="1" name="cursor" animated=".125"></tile>
- <tile position="2" name="grass" animated=".0625"></tile>
- <tile position="3" name="parquet" elevation=".125"></tile>
- <tile position="4" name="sand"></tile>
- <tile position="5" name="dirt" blocking="1"></tile>
- <tile position="6" name="brick" blocking="1"></tile>
- <tile position="7" name="water" animated="1" fluid=".5"></tile>
+ <tile position="9" elevation="1"></tile>
+ <tile position="10" elevation="1"></tile>
+ <tile position="11" elevation="1"></tile>
+ <tile position="12" elevation="1"></tile>
+ <tile position="13" elevation="1"></tile>
+ <tile position="14" elevation="1"></tile>
+ <tile position="15" elevation="1"></tile>
+ <tile position="16" elevation="1"></tile>
+
+ <tile position="19" elevation=".5"></tile>
+ <tile position="21" elevation=".5"></tile>
+ <tile position="22" elevation=".5"></tile>
+ <tile position="28" elevation=".125"></tile>
+
+ <tile position="41" animated=".125" fluid=".5"></tile>
+ <tile position="49" animated=".125"></tile>
</tiles>
- <img id="character" src="character.png" speed="1.4"/>
+ <img id="character" src="character.png" speed="1"/>
<div id="map" columns="32" rows="32">
- 6, 6, 6, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 5, 5, 5, 4, 4, 4, 5, 5,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19,19,19,19,19,19,19,11,11,11,11,11,11,11,19,19,19,
+11,11,11,11,11,11,11,11,11,11,11,11,11,19,19,14,19,19,19,19,19,11,11,11,11,11,11,11,19,19,19,19,
+11,11,11,11,11,11,11,11,11,11,11,11,11,11,19,19,19,19,19,19,19,11,11,11,11,11,11,11,11,19,19,19,
+11,11,11,11,11,11,11,11,11,11,11,11,11,19,19,14,19,19,19,19,11,11,11,11,11,11,11,11,19,19,19,19,
+11,11,11,11,11,11,11,11,11,11,11,11,11,14,19,19,19,19,19,19,11,11,11,11,11,11,11,11,19,19,19,19,
+11,11,11,11,11,13,19,19,11,11,11,11,14,19,19,19,19,19,19,11,11,11,11,11,11,11,11,11,19,19,19,19,
+11,11,11,11,11,13,19,19,11,11,11,11,19,19,19,19,16,19,19,11,11,11,11,11,11,11,11,11,19,19,19,19,
+11,11,11,11,13,19,19,19,19,11,11,19,19,14,19,16,16,19,14,11,11,11,11,11,11,11,19,19,19,19,19,19,
+11,11,11,11,13,19,19,19,19,19,19,19,13,19,19,16,13,16,14,11,11,11,11,11,11,11,19,19,19,19,19,19,
+11,11,11,13,19,19,19,13,19,19,19,19,19,19,19,16,16,19,11,11,11,11,11,11,11,19,19,19,19,19,19,19,
+11,11,11,13,19,19,19,19,19,19,19,19,19,19,19,19,16,19,19,11,11,11,11,11,11,11,19,19,19,19,19,19,
+11,11,13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,11,11,19,19,19,19,19,19,
+11,11,13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,11,19,19,19,19,19,19,
+11,13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,13,19,19,19,19,19,19,
+11,13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,11,13,13,19,19,19,19,19,
+13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,11,13,13,13,19,19,19,19,19,
+13,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,11,13,13,13,13,19,19,19,19,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,11,13,13,13,21,13,19,19,19,19,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11,19,13,13,21,21,13,19,19,19,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,15,19,19,19,19,19,19,19,19,19,13,21,21,21,13,19,19,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,13,21,21,21,13,19,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,13,21,21,13,13,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,15,19,19,19,19,19,13,21,13,13,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,13,13,13,16,16,16,
+19,19,19,19,19,19,19,15,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,13,13,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,13,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,16,16,
+19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,16,16,16,16,16,16,16,
+
+11,11,11,11,11,11,11,11,11,11,11,11,11,11,41,41,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,
+11,11,11,11,11,11,11,11,11,11,11,11,11,41,41,14,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,
+11,11,11,11,11,11,11,11,11,11,11,11,11,11,41,41,41,41,41,41,41,12,12,12,12,12,12,12,12,41,41,41,
+11,11,11,11,11,11,11,11,11,11,11,11,11,41,41,14,41,41,41,41,12,12,12,12,12,12,12,12,41,41,41,41,
+11,11,11,11,11,11,11,11,11,11,11,11,11,14,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,41,
+11,11,11,11,11,13,41,41,11,11,11,11,14,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,41,41,
+11,11,11,11,11,13,41,41,41,11,11,11,41,41,41,41,41,41,41,12,12,12,12,12,12,12,12,41,41,41,41,41,
+11,11,11,11,13,41,41,41,41,41,41,41,41,14,41,41,41,41,14,12,12,12,12,12,12,12,41,41,41,41,41,41,
+11,11,11,11,13,41,41,41,41,41,41,41,41,41,41,41,41,41,14,12,12,12,12,12,12,12,41,41,41,41,41,41,
+11,11,11,13,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,41,41,41,
+11,11,11,13,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,41,41,
+11,11,13,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,12,12,12,41,41,41,41,41,41,
+11,11,13,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,12,12,41,41,41,41,41,41,
+11,13,41,41,14,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,12,13,41,41,41,41,41,41,
+11,13,41,41,14,22,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,12,13,13,41,41,41,41,41,
+13,41,41,14,22,22,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,12,13,21,13,41,41,41,41,41,
+13,41,41,14,22,22,22,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,12,13,21,0,13,41,41,41,41,
+41,41,14,22,22,22,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,12,13,21,0,0,13,41,41,41,41,
+41,41,41,22,22,22,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,0,0,0,13,41,41,41,
+41,41,14,22,22,14,41,41,41,41,41,41,41,41,15,41,41,41,41,41,41,41,41,41,13,0,0,0,13,41,41,16,
+41,41,14,22,22,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,0,0,0,13,41,16,
+41,41,22,14,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,0,0,0,13,16,16,
+41,41,14,14,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,0,0,21,13,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,0,21,13,16,16,
+41,41,41,41,41,41,41,15,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,21,13,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,13,16,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,13,16,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,16,16,16,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,16,16,16,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,16,16,16,16,16,16,
+41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,41,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+
</div>
</canvas>
</body><script>
draw: function(){ // map.draw
var py = player.n / this.cols % this.rows |0;
var px = player.n % this.cols;
- var x, y, z, n, tile, props;
+ var pz = player.z |0;
+ var x, y, z, n, tile, props, dx, dy;
+ canvas.clearRect(0, 0, canvas.canvas.width, canvas.canvas.height);
for (y = 0; y < this.rows; ++y) {
- for (z = 0; z < this.data.length / (this.rows * this.cols); ++z)
- for (x = 0; x < this.cols; ++x) {
- n = x + y * map.cols + z * map.rows * map.cols;
- tile = ( n == ptr ) ? 1 : this.data[n];
- props = this.tileprops[tile] || this.default_props;
-
- canvas.globalAlpha = ( y > py &&
- (z > player.z + 1 || z == (player.z |0) && props.blocking) &&
- y < py + 6 &&
- x > px - 2 &&
- x < px + 2 &&
- !props.fluid
- ) ? .25 : 1;
-
- canvas.drawImage( this.tiles,
- this.tw * tile, 2 * this.th * ((props.animated * frame |0) % 8),
- this.tw, 2 * this.th,
- x * this.tw + y % 2 * this.sw - this.sw - this.offset_x,
- y * this.sh - z * this.th - 3 * this.sh - this.offset_y,
- this.tw, 2 * this.th
- );
+ for (z = 0; z < this.data.length / (this.rows * this.cols); ++z){
+ for (x = 0; x < this.cols; ++x) {
+ n = x + y * map.cols + z * map.rows * map.cols;
+ tile = ( n == ptr ) ? 1 : this.data[n];
+ props = this.tileprops[tile] || this.default_props;
+ dx = x * this.tw + y % 2 * this.sw - this.sw - this.offset_x;
+ dy = y * this.sh - z * this.th - 3 * this.sh - this.offset_y;
+
+ if ( dx + this.tw > 0 && dy + this.th * 2 > 0 && dx < canvas.canvas.width && dy < canvas.canvas.height)
+ canvas.drawImage( this.tiles,
+ ((tile - 1) % 8 |0 + ((props.animated * frame |0) % 8)) * this.tw,
+ ((tile - 1) / 8 |0) * this.th * 2, //* ((props.animated * frame |0) % 8),
+ this.tw, 2 * this.th,
+ dx, dy, this.tw, 2 * this.th
+ );
+ }
+ if (py == y && pz == z) player.draw();
}
- if (py == y) player.draw();
}
+ canvas.globalAlpha = .25; player.draw();
+ canvas.globalAlpha = 1;
+
} // end map.draw
} // end map
player = {
- frame: 0, d: 's',
- x: 40, y: 40, z: 1,
+ frame: 0, d: 0,
+ x: 40, y: 80, z: 4,
sprite: document.getElementById("character"),
anim: "stand",
anims: {
var dx = 0, dy = 0;
switch(this.d){
- case 'n': dy = -this.speed; break;
- case 's': dy = this.speed; break;
- case 'w': dx = -this.speed; break;
- case 'e': dx = this.speed; break;
- case 'nw': dy = -.45 * this.speed; dx = -.9 * this.speed; break;
- case 'ne': dy = -.45 * this.speed; dx = .9 * this.speed; break;
- case 'sw': dy = .45 * this.speed; dx = -.9 * this.speed; break;
- case 'se': dy = .45 * this.speed; dx = .9 * this.speed; break;
+ case 0: dy = .7; break;
+ case 1: dy = .45; dx = - .9; break;
+ case 2: dx = - 1.4; break;
+ case 3: dy = - .45; dx = - .9; break;
+ case 4: dy = - .7; break;
+ case 5: dy = - .45; dx = .9; break;
+ case 6: dx = 1.4; break;
+ case 7: dy = .45; dx = .9; break;
}
+ dy *= this.speed; dx *= this.speed;
+
+ var p = map.tile_at(this.x, this.y, this.z);
var n = map.tile_at(this.x + dx, this.y + dy, this.z);
- var prop = map.props_of(n), head = map.props_of(n + map.rows * map.cols);
+ var ppos = map.props_of(p),
+ prop = map.props_of(n),
+ head = map.props_of(n + map.rows * map.cols),
+ ovhead = map.props_of(n + map.rows * map.cols * 2);
if (prop.fluid) { dx *= prop.fluid; dy *= prop.fluid; }
else if (head.fluid) { dx *= head.fluid; dy *= head.fluid; }
- if (!prop.blocking && head.fluid) {
+ if (prop.elevation <= .5 && head.fluid) {
this.x += dx; this.y += dy; this.n = n;
+ } else if ( prop.elevation > .5 && head.fluid && ovhead.fluid && ppos.elevation >= .5 ) {
+ this.x += dx; this.y += dy; this.n = n + map.rows * map.cols;
}
this.frame++; this.frame %= 255;
if (this.z > zbase) {
// speed up when in air
this.speed = this.ospeed * 2;
- } else if (props.fluid && !bottom.blocking) {
+ } else if (props.fluid && bottom.elevation < 1) {
this.n -= map.rows * map.cols;
} else {
this.speed = this.ospeed;
}, // end player.fall
-
draw: function(){ // player.draw
- var face = 0, state = 0, anim = this.anims[this.anim];
-
- switch (this.d){
- case 's': face = 0; break;
- case 'sw': face = 1; break;
- case 'w': face = 2; break;
- case 'nw': face = 3; break;
- case 'n': face = 4; break;
- case 'ne': face = 5; break;
- case 'e': face = 6; break;
- case 'se': face = 7; break;
- }
+ var face = this.d, state = 0, anim = this.anims[this.anim];
state = anim.start + this.frame / anim.speed % anim.length | 0;
if ( keys[65] || keys[37] ) d += 'w';
if ( keys[68] || keys[39] ) d += 'e';
+ switch (d){
+ case 's': player.d = 0; break;
+ case 'sw': player.d = 1; break;
+ case 'w': player.d = 2; break;
+ case 'nw': player.d = 3; break;
+ case 'n': player.d = 4; break;
+ case 'ne': player.d = 5; break;
+ case 'e': player.d = 6; break;
+ case 'se': player.d = 7; break;
+ }
+
if ( d == '' ) player.anim = "stand"
else {
if ( player.anim == "stand" ) player.frame = 0;
- player.d = d;
player.anim = "walk";
player.move();
}
// jump
- if (keys[32] && player.zspeed == 0) {player.zspeed += .75; player.z +=.0001;}
+ if (keys[32] && player.zspeed == 0) {player.zspeed += .75; }
}
+t = 0;
function script(){
map.init();
player.init();
get_input();
player.fall();
map.draw();
- frame++; frame %= 255;
+ frame++; frame %= 256;
+ if (frame == 0){
+ console.log( 1000 / ( Date.now() - t ) * 256);
+ t = Date.now();
+ }
}, 1000 / fps);
window.addEventListener('keydown', function(x){ keys[x.keyCode] = true; }, false );