Well today me and Firebird were helping out n00bs in the Novice Q & A when we cam across a topic called "Gravity Towards an Object".
So the author wanted help with his code which was:direction = Point_Direction(x,y,object1.x,object1.y)
Quote: Firebird
gravity_direction = point_direction(x,y,x2,y2);
Quote: JesterDaze
the original code looked better than this. what do you mean?
Quote: Firebird quoting from the first post in the topic
Quote:
Gravity Towards An Object
Quote:
I have an object that should be attracted to another, so…
Quote: -0NL1N3-
For x2 and y2 you should specify the object that you want to be attracted to's x and y so use:
So change objecttobeattractedto to the name of the object that you want to be attracted to.Thanks,-0NL1N3-
gravity_direction = point_direction(x,y,objecttobeattractedto.x,objecttobeatrractedto.y);
Quote: JesterDaze
you are of no help whatsoever if you go on like that.
Quote: Firebird pwning JesterDaxe
I really thought you would understand what I was telling him.Oh well. Not everyone has brains.
Quote: JesterDaze
Hey, come on. What you said what not code that would work1. You changed his object1.x, object1.y to x2, y22. he calculated direction, youi changed it to gravity direction (which, depending on what exactly he was doing MAy or may NOT make better sense).3. you changed to lower case, which I think helped, but without commenting it, or explaining that it was needed.4. You repeated his original text, which I certainly had read and understood.5. You implicitly accuse me of having no brains (which I am prtetty sure is an inaccurate statement, and also rude)I just tried to make you explain your quite cryptic explanation. I know perfectly well how you create gravity in any direction you like, based on one or more objects. But your text did not make sense.Sorry for that. I just think the original poster deserved a decent answer
Quote: Firebird pwning again
1. x2 and y2 represent the x and y values to point the directional 'line' to. Read the manual.2. Read the manual about gravity_direction.3. It is simple code that he could understand, via common sense. Not many people seem to have that, either.4. Good. Something got through.5. Too bad.
Quote: -0NL1N3-
He wanted GRAVITY to go in a certain DIRECTION but there is a function for that called GRAVITY_DIRECTION and that's what Firebird pointed out. God….some people definitely don't have brains.Thanks,-0NL1N3-
Quote: JesterDaze
gravity_direction is not a function, it is a variable. Maybe you should clean in front of your own front door before yelling at others?Secondly, there are many, many ways to achieve a gravity effect towards an object. Many of which need not bother the least about GML:s built in gravity_direction and direction. There is no way you can know from one line of code what the surrounding code looks like. He may well have decided to manually move all his objects, rather than having speed and direction, for example.Now, given his question, and assumed level och GML knowledge, Firebirds assumption that he IS indeed using the wrong variable is reasonable. Then my simple view is that you should tell him so, and tell him what you think is wrong, instead of sending him another line of code, which won't work, because you changed not only that, but also other things. Sure it is from the manual , but there was nothing wrong with his original parameters to the function, while in the context of his code, there was definitely something wronmg with doing copy and paste from the manual.Firebird provided another line of code to him, without saying how it was supposed to be interpreted, or which changes compared to his line were to be applied and not to be applied, and maybe more importantly, with no explanation whatsoever why. And it could not be used as is.It is possible that he figured out anyway. Which is not thanks to Firebirds brains, but to Kaos's
Quote: Firebird
jesterdaze, he mentioned gravity, not 'moving objects manually'.You are meant to use the gravity_direction var when working with gravity. direction moves it, as in speed. direction does not change the gravity direction. As far as I know, correct me if I'm wrong.It also worked so, yes, let the topic die.
Thanks for sharing!
As I said before - Some people definitely don't have brains. [:P]
Haha
Niiiice Firebird!!!!!!!JOO PWNED HIM!
I saw that topic, it was hilarious.
JesterDaze is right!!! Nah, just kidding. That's hilarious.
That's funny. XD
<a href="http://64digits.com/users/index.php?userid=%20JesterDazes%20brain">click me</a>
Har har har!
Some people don't have common sense, judging on his newest post.