Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Began seam tile creation

  • Loading branch information...
commit 06b901bb90b988d873f7136e3f463f3319d8dad0 1 parent 9953c31
@a727891 authored
View
56 Client/js/Renderer.js
@@ -9,13 +9,29 @@ define(['SimplexNoise', 'TileData'], function (Simplex, TileData) {
this.TileData = new TileData();
this.LoadCanvas('TestCanvas');
this.Simplex = new Simplex(this.Canvas, this.Context);
- this.Simplex.config.color = true;
- this.Simplex.config.colorlevels = this.TileData.WorldTiles;
- this.Simplex.GenImage(null);
+ this.Simplex.config.color = false;
+// this.Simplex.config.colorlevels = this.TileData.WorldTiles;
+// this.Simplex.GenImage(null);
// this.Simplex.InsertControls();
// var Tiles = this.Simplex.TilesData;
this.Simplex.config.color = true;
- this.GenTileMap();
+// this.GenTileMap();
+
+ this.Context.save();
+ this.Context.fillStyle = 'white';
+// this.Context.clearRect(0,0, this.Canvas.width,this.Canvas.height);
+ this.Context.arc(0, 0, this.Canvas.width / 2, 0, Math.PI, 0);
+ this.Context.fill();
+ this.Context.clear();
+ this.Context.arc(0, this.Canvas.height, this.Canvas.width / 2, 3 * Math.PI, .5 * Math.PI, 0);
+ this.Context.fill();
+ this.Context.clear();
+ this.Context.arc(this.Canvas.width, 0, this.Canvas.width / 2, 0, Math.PI, 1);
+ this.Context.fill();
+ this.Context.clear();
+ this.Context.arc(this.Canvas.width, this.Canvas.height, this.Canvas.width / 2, Math.PI, 2 * Math.PI, 1);
+ this.Context.fill();
+ this.Context.clear();
},
LoadCanvas:function (canvas) {
@@ -40,19 +56,25 @@ define(['SimplexNoise', 'TileData'], function (Simplex, TileData) {
tile_x,
tile_y;
- console.log("MaxX:" + max_x, "MaxY:" + max_y, 'tW:' + t_w, 'tH:' + t_h);
- for (var i = 0; i < this.TileData.Tiles.length; i++) {
- console.log("Generate tile called: " + this.TileData.Tiles[i].name);
- this.Simplex.config.colorlevels = this.TileData.Tiles[i].colors;
- this.Simplex.GenImage(this.TileData.Tiles[i].seed);
- tile_y = t_h * Math.floor(i / max_y);
- tile_x = t_w * (i % max_y);
- console.log(i, "X:", tile_x, "Y:", tile_y);
-// context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);
- this.TileMapContext.drawImage(this.Canvas
- , 0, 0, t_w, t_h,
- tile_x, tile_y, t_w, t_h);
- }
+// console.log("MaxX:" + max_x, "MaxY:" + max_y, 'tW:' + t_w, 'tH:' + t_h);
+// for (var i = 0; i < this.TileData.Tiles.length; i++) {
+// console.log("Generate tile called: " + this.TileData.Tiles[i].name);
+// this.Simplex.config.colorlevels = this.TileData.Tiles[i].colors;
+// this.Simplex.GenImage(this.TileData.Tiles[i].seed);
+// tile_y = t_h * Math.floor(i / max_y);
+// tile_x = t_w * (i % max_y);
+// console.log(i, "X:", tile_x, "Y:", tile_y);
+//// context.drawImage(img,sx,sy,swidth,sheight,x,y,width,height);
+// this.TileMapContext.drawImage(this.Canvas
+// , 0, 0, t_w, t_h,
+// tile_x, tile_y, t_w, t_h);
+// }
+
+ this.Context.save();
+ this.Context.clearRect(0, 0, this.Canvas.width, this.Canvas.height);
+ this.Context.arc(0, 0, t_h / 2, 0, Math.PI, 0);
+ this.Context.fill();
+
}
View
2  Client/js/TileData.js
@@ -99,7 +99,7 @@ define([], function () {
'name':'Snow',
'colors':[
{'v':32, 'r':200, 'g':200, 'b':200},
-// {'v':64, 'r':0, 'g':62, 'b':64},
+ {'v':255, 'r':255, 'g':255, 'b':255},
// {'v':96, 'r':96, 'g':0, 'b':96},
// {'v':128, 'r':0, 'g':0, 'b':128},
// {'v':160, 'r':0, 'g':160, 'b':160},
View
4 Client/testfile.html
@@ -3,9 +3,9 @@
<head>
<title></title>
</head>
-<body>
+<body style="background: #000000">
<canvas id="TestCanvas" width="320" height="320"></canvas>
-<canvas id="TileMap" width="160" height="160"></canvas>
+<canvas id="TileMap" width="320" height="320"></canvas>
<canvas id="Tile" width="32" height="32"></canvas>
<script data-main="js/mainTest" src="js/lib/require-jquery.js"></script>
</body>

0 comments on commit 06b901b

Please sign in to comment.
Something went wrong with that request. Please try again.