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.

Newcomers DBPro Corner / Weird Dungeon Map Problem

Author
Message
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 3rd Jul 2009 07:46
Hello all. I'm a very new user of DBPro, but a long time coder. I've been modifying the Huge Dungeon tutorial, hoping to end up with something along the lines of Dungeon Hack.

I'm testing with a small map of 20 x 20 squares, moving one square forward with each up arrow keypress. I'm not doing any collision detection, instead I'm checking the map array to see if the destination square is open before I move the camera. I'm not hiding or moving the cubes after I make them.

Here's the problem... Moving on the Z axis works fine, the walls stop my movement. On the X axis though, the cubes along the outside edge are shifted over by three squares. The cubes forming a room in the center of the dungeon are correct, and my diagnostics pick up the location and type of each cube. It's just the left and right hand edges of the map that are giving me fits.

here's the code...



You should be able to see what I mean. Try moving to the west or east edges of the map.

It's probably something really obvious, but I'm just not seeing the problem.

Thanks in advance for any help.

Richard
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 4th Jul 2009 00:54
I finally figured it out. I think I did anyway. Something to do with how I was picturing (in my head) the relationship between x+, x-, z+, z- and north, south, east, and west. It's all working fine now, I'll post in the WIP when I have a little more to show.

Rich

Login to post a reply

Server time is: 2024-09-28 08:31:33
Your offset time is: 2024-09-28 08:31:33