Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:Kajakklubben/PressAndMove

  • Loading branch information...
commit 2b36b32578c7bbac8d39249b27aa72ce1c363b4a 2 parents 92a09c3 + 32d75e9
@HalfdanJ HalfdanJ authored
View
18 1110.js
@@ -9,6 +9,16 @@ function eventPos(e) {
}
var Map=function($container){
+ var blackImg = $(new Image());
+
+ blackImg.load(function() {
+ var context = document.getElementById('canvas').getContext('2d');
+ context.drawImage(this, 0, 0);
+ collisionMap['black'] = context.getImageData(0, 0, 1024, 1024).data;
+ });
+ blackImg.attr('src', '/collision/1n4eC.png')
+
+
$container.css({
'z-index': 1,
overflow: 'hidden',
@@ -118,9 +128,13 @@ var Map=function($container){
var context = document.getElementById('canvas').getContext('2d');
context.drawImage(this, 0, 0);
collisionMap[nm] = context.getImageData(0, 0, 1024, 1024).data;
- })
+ }).error(function () {
+ if(nm.indexOf('s') != -1) {
+ collisionMap[nm] = collisionMap['black'];
+ }
+ });
colImg.attr('src', '/collision/'+nm+'C.png')
- }}(name), (++colissionDelayTimer)*100);
+ }}(name), (++colissionDelayTimer)*50);
}
View
BIN  collision/1n13wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1n16eC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1n22wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1n8wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1n9wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1s6wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/1s9wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/2n22wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  collision/2s9wC.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 game.js
@@ -657,7 +657,6 @@ var col_ground = 3;
function materialAtPixel(x, y) {
var img = getImageForPixel(x, y);
-
if(img != undefined) {
var localX = x - img.left;
@@ -665,6 +664,8 @@ function materialAtPixel(x, y) {
return materialAtImagePixel(img.id, localX, localY);
}
+
+
return col_air;
}
@@ -723,4 +724,4 @@ $(function() {
$("#canvascontainer").hide();
-});l
+});
View
BIN  imgs/1s9w.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
4 index.html
@@ -99,8 +99,8 @@
<img src="http://imgs.xkcd.com/comics/click_and_drag.png" title="Arrow keys to move and space to fly." alt="Click and Drag" />
<div class="map"><div class="ground"></div></div>
<script type="text/javascript" src="http://imgs.xkcd.com/static/jquery-1.8.1.min.js"></script>
-<script type="text/javascript" src="1110.js"></script>
-<script type="text/javascript" src="game.js"></script>
+<script type="text/javascript" src="1110.js?2"></script>
+<script type="text/javascript" src="game.js?2"></script>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.