Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / "Doors" in a 'dungeon' game

Author
Message
SunDawg
19
Years of Service
User Offline
Joined: 21st Dec 2004
Location: Massachusetts
Posted: 13th Jun 2008 00:47 Edited at: 13th Jun 2008 01:11
I've been chopping away at an FPS that works a bit like Wolfenstein: 3D. The idea is that the level is represented by numerical values in an array. (You can see some images in game and of the editor on my website, link in signature)

I've come to a bit of a road block. Set up now is a routine for determining what position on the array the camera is by rounding the camera's actual value divided by 40, the unit size of each square on the grid. Doors are represented on the map as a 2, walls are 1s, and open space is a zero, or any other value not explicitly defined. To open the door, you would logically have to be within one array unit and facing toward the door. How could I check if the player is facing the door? Full source is available on request, I don't know what kind of snippet would help.

EDIT: I had an idea for a system based on checking whether the camera's object is colliding with the door's object, but with my function for drawing the level, the number of the door object is unknown.

EDIT: A code snippet that shows how a door is removed. With this code all doors around the player, within one block, are removed. Ideally, I'd like to remove the one the player is looking the most toward.




My site, for various stuff that I make.

Login to post a reply

Server time is: 2024-09-29 23:29:09
Your offset time is: 2024-09-29 23:29:09