Jump to content

- - - - -

JavaScript Raycaster



4: Adsense



A silly project from over the weekend: JavaScript raycaster.

I couldn't work out how to handle keypresses in Firefox, and Firefox is too slow and flickery to make it worthwhile. IE runs it fine but at less than 1FPS, meaning that more often than not you end up walking through the walls. Opera is about the only browser it works happily in (~12FPS). Ah well.

May 30 2006 02:39 AM
Mozilla has one and I'm sure The5K had a few.

Edit Mozilla's uses the nonstandard <canvas> tag.
May 30 2006 12:17 PM
Well it looks awesome, but I really don't feel like installing Opera. FireFox I got 10FPS but couldn't move and IE I got 1FPS.
May 30 2006 02:12 PM
I'm getting an average of 4 FPS in Safari (and the keys work) - but it freezes Camino.
May 31 2006 12:06 AM
Yay! 3fps (FX) and 12 fps (Opera) here. I'm wondering how fast this might run with the canvas tag. I might do some experiments later, but not until at least the weekend (exams and so forth). [grin]

Edit: I get about 8 fps in SeaMonkey... Maybe it's just Firefox that sucks? ;) Perhaps it's my extensions.
May 31 2006 05:20 AM
The Mozilla Raycaster uses

onkeydown="press(event);" onkeyup="release(event);"

I see yours take no parameters.
/ Anonymous Poster
Jun 01 2006 04:06 AM
Quick Firefox fix:

FIND:
onkeydown="KeyDown();" onkeyup="KeyUp();"
REPLACE WITH:
onkeydown="KeyDown(event);" onkeyup="KeyUp(event);"
FIND:
return window.event.keyCode;
REPLACE WITH:
return (window.event) ? window.event.keyCode : evt.keyCode;

It's almost unusably slow, though.
Jun 26 2016 08:14 PM

I was wondering, how did you implemented the door opening mech?

Note: GameDev.net moderates comments.