Skip to content

Commit

Permalink
consolidated app
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Paik authored and Joshua Paik committed Jun 26, 2018
1 parent a85aa0d commit cb0efa1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
5 changes: 1 addition & 4 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,8 @@
overflow: hidden;
}
canvas {
margin:100;
margin:200;
padding:100;
}

p {
margin-left: 400px;
}
</style>
25 changes: 15 additions & 10 deletions sketch.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
var margin = 50;
var blockDelta = 50;
var margin = 80;
var blockDelta = 80;
let player;

var score = 0;
let path = "";

moveHistory = [[margin,margin]]
let moveHistory = [[margin,margin]];

var instructions = "Instructions: Use arrow keys to move dot. Press c to clear.";

function setup() {

Expand All @@ -15,22 +17,25 @@ function setup() {
scoreElem.style('color', 'black');

pathElem = createDiv();
pathElem.position(margin, 15);
pathElem.position(margin, 22);
pathElem.style('color', 'black');

lengthOfPath = createDiv();
lengthOfPath.position(margin, 28);
lengthOfPath.position(margin, 42);
lengthOfPath.style('color', 'black');

createCanvas(300, 300);
createCanvas(6*margin, 6*margin);
player = new gamePiece();
}

function draw() {
background("white");
// line(x1, y1, x2, y2)
makeGrid();

fill(0,0,0)
ellipse(width-margin, height-margin, 10, 10);
text('End', width-margin+5, height-margin);
text(instructions, margin, 65)
player.show();
//Make edges
makeEdges()
Expand All @@ -44,16 +49,16 @@ function makeGrid() {
for (var x=margin; x<= width - margin; x += blockDelta) {
stroke("black");
strokeWeight(1);
line(50,x,250,x)
line(x,50, x,250);
line(margin,x,width-margin,x);
line(x,margin, x,width-margin);
}
}

class gamePiece{
constructor() {
this.x = margin,
this.y = margin,
this.radius = 25,
this.radius = 17,
this.r = 255
}
dir(sigma1,sigma2) {
Expand Down

0 comments on commit cb0efa1

Please sign in to comment.