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.

DarkBASIC Professional Discussion / Anyone know a better method for some of this code?

Author
Message
HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 18th Feb 2012 14:49 Edited at: 18th Feb 2012 14:54
So I'm making a personal map editor, Just completed a small portion of the grid snapping (In between the comments 'FROM HERE' to 'TO HERE'). I find my method for the grid snapping to be very sloppy, Was wondering if anyone knew a better method for a relevant grid snap? Also, I'm very sure there's better methods for almost everything in the code, if you see where then please feel free to point it out



Look around with the mouse, move around with W/A/S/D & select the block with the left mouse click (same to drop it)

Thanks for any help! ^^
Brendy boy
20
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 18th Feb 2012 16:45
here:


HellsDevilDog
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location: Ohio
Posted: 18th Feb 2012 17:06
Oh, wow... That's pretty damn simple... Looks like I over thought it by alot

Many thanks
Sixty Squares
20
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 19th Feb 2012 03:33 Edited at: 19th Feb 2012 03:35
You could also try something like this (It's untested psuedocode but it should make sense, unless I've made a logical mistake [quite possible] lol)




Guns, cinematics, stealth, items and more!

Login to post a reply

Server time is: 2026-07-10 05:01:41
Your offset time is: 2026-07-10 05:01:41