diff --git a/Platform/Apple/virtual/src/raycast/javascript/intcast.js b/Platform/Apple/virtual/src/raycast/javascript/intcast.js index 0a678ad7..a40a6615 100644 --- a/Platform/Apple/virtual/src/raycast/javascript/intcast.js +++ b/Platform/Apple/virtual/src/raycast/javascript/intcast.js @@ -30,20 +30,20 @@ var itemTypes = [ var mapItems = [ // lamps in center area - {type:3, x:9, y:7}, - {type:3, x:15, y:7}, + {type:3, x:9.5, y:7.5}, + {type:3, x:15.5, y:7.5}, // lamps in bottom corridor - {type:3, x:5, y:12}, - {type:3, x:11, y:12}, - {type:3, x:11, y:12}, + {type:3, x:5.5, y:12.5}, + {type:3, x:11.5, y:12.5}, + {type:3, x:11.5, y:12.5}, // tables in long bottom room - {type:0, x:10, y:10}, - {type:0, x:11, y:10}, + {type:0, x:10.5, y:10.5}, + {type:0, x:11.5, y:10.5}, // lamps in long bottom room - {type:3, x:8, y:10}, - {type:3, x:11, y:10} + {type:3, x:8.5, y:10.5}, + {type:3, x:11.5, y:10.5} ]; // Player attributes [ref BigBlue2_10] @@ -152,7 +152,7 @@ function initSprites() { sprite.img = img; sprite.index = i; - spriteMap[sprite.y][sprite.x] = sprite; + spriteMap[parseInt(sprite.y)][parseInt(sprite.x)] = sprite; screen.appendChild(img); } @@ -364,67 +364,40 @@ function clearSprites() { function renderSprites() { + var sinT = Math.sin(-playerAngle()); + var cosT = Math.cos(-playerAngle()); + for (var i=0;i