Last active
November 8, 2015 23:21
-
-
Save jonleung/11ecd13a9d957003416b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<link rel="stylesheet" href="style.css"> | |
</head> | |
<body> | |
<p>Try to move your mouse through the maze without touching the walls.</p> | |
<p>Refresh the page to try again.</p> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.12/p5.js"></script> | |
<script src="https://rawgit.com/jonleung/79234327a76b2eb4953e/raw/62bbd37c23950be576afac9d8f78112ec46445a2/p5.play.js"></script> | |
<script src="main.js"></script> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maze; | |
var mazeImg; | |
function setup() { | |
createCanvas(200,200); | |
maze = createSprite(100, 100); | |
mazeImg = loadImage("http://i.filmot.org/7xDfW51.png"); | |
maze.addImage(mazeImg); | |
} | |
function draw() { | |
background(255, 255, 255); | |
drawSprites(); | |
if(maze.overlapPixel(mouseX, mouseY)){ | |
maze.remove(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
text-align: center; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment