ID:168718
Sep 5 2005, 1:37 pm
|
|
i need a pice of code that moves the user from his current position to 5 spaces in his direction and if he bumps any thing it acitvates the attack verb then stops
|
In response to Rockinawsome
|
|
That would work but if the object you bumped is deleted then the player would continue to move in that direction.
/*B-O-F*/ This is untested,but I don't see anything critically wrong with it. |
In response to Itanium
|
|
Please get rid of the brackets ({}). All it does is make the code harder to read. DM doesn't require brackets like C and C++ do. And please use more than 1 space as a tab, as this will make the code also hard to read.
|
In response to Mega fart cannon
|
|
I would but then I wouldn't feel at ease programming.
(I will use double spaces though) |
In response to Itanium
|
|
He asked to move five spaces though, and if a mob was there, to attack it. But, your code is probably more what he's looking for (though he wont understand it). He's probably looking for an attack Final Fantasy style.
|
In response to Mega fart cannon
|
|
Mega fart cannon wrote:
Please get rid of the brackets ({}). All it does is make the code harder to read. Who cares? Its the programmers preference. |
In response to XzDoG
|
|
god help me these ppl are arguing on my post
|
In response to XzDoG
|
|
Yes, but when displaying code on the forums, you want it as legible as possible, and not chock full of usr abuse and stuff.
|
In response to Ol' Yeller
|
|
I never understood the bracket thing myself, so if I was a person that was recieving that code I wouldn't be at ease with it.
|
In response to Justin Knight
|
|
Sadly thats not my concern.
Using brackets is a prefrence,I dont do it because I code then go back and add them in; I do it because if I dont then its Hard for me to get a quick grasp of it. Itanium |
In response to Itanium
|
|
Using brackets is a prefrence,I dont do it because I code then go back and add them in; I do it because if I dont then its Hard for me to get a quick grasp of it. Yeah took me awhile to get used to not using them. Though it didn't help that initially the language did require them also :). Just got to remember that when I go and use other languages not to leave hanging ifs :P. |
In response to Theodis
|
|
BYOND with mandatory brackets ?
(heaven) Itanium |
In response to Itanium
|
|
Yeah DUNG version 2 was the first version that processed scope by indentation rather than braces. The source code to most my games were left with thousands of errors due to inconsistant indentation :P.
|
In response to Theodis
|
|
have mercy on my post
|
Anything more than that and I suggest you try learning how to code first. Check out Demos/Tutorials/etc.