Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Lengthdir  (Read 4210 times)

0 Members and 1 Guest are viewing this topic.

Dark Blade

    Topic Starter
  • Forum Gaming Master


  • Adviser

    Thanked: 24
    • Yes
  • Experience: Experienced
  • OS: Windows XP
Lengthdir
« on: July 17, 2007, 11:47:23 PM »
OK, I'm using a langauge that most of you won't know (GML - Game Maker Language), and two of the commands are lengthdir_x(length,direction) and lengthdir_y(length,direction). For _x, it gives the following definition:
Returns the horizontal x-component of the vector determined by the indicated length and direction.

Um.. so can anyone translate that so I could understand?

Dusty



    Egghead

  • I could if she would, but she won't so I don't.
  • Thanked: 75
  • Experience: Beginner
  • OS: Windows XP
Re: Lengthdir
« Reply #1 on: July 18, 2007, 01:48:39 AM »
Try this..

Lots more info on the Weird & Wonderful Web (aka WWW)

Good luck
One good deed is worth more than a year of good intentions.

Dark Blade

    Topic Starter
  • Forum Gaming Master


  • Adviser

    Thanked: 24
    • Yes
  • Experience: Experienced
  • OS: Windows XP
Re: Lengthdir
« Reply #2 on: July 18, 2007, 05:27:24 PM »
Thanks, Dusty. I'll look into that, and (hopefully) I should be using lengthdir in no time.

Neil



    Expert
  • Fear me Track. Noone can escape my wrath.
  • Thanked: 3
    Re: Lengthdir
    « Reply #3 on: August 02, 2007, 02:57:00 PM »
    Gaming Master Apprentice

    Oxymoron  8)

    Dark Blade

      Topic Starter
    • Forum Gaming Master


    • Adviser

      Thanked: 24
      • Yes
    • Experience: Experienced
    • OS: Windows XP
    Re: Lengthdir
    « Reply #4 on: August 03, 2007, 01:11:42 AM »
    Eh.....?

    Well, I've learnt how to use lengthdir now, just from one look at the diagram (I didn't read through the whole thing), so my game making skills have progressed.

    Now, I can do code such as:
    instance_create(x+lengthdir_x(20,image_angle),y+lengthdir_y(9,image_angle),shot), where the shot will always be create from exactly where your gun is, no matter which way you face.

    So yeh.

    Dusty



      Egghead

    • I could if she would, but she won't so I don't.
    • Thanked: 75
    • Experience: Beginner
    • OS: Windows XP
    Re: Lengthdir
    « Reply #5 on: August 03, 2007, 04:01:43 AM »
    Good to hear of your progress, look forward to you posting your completed game and letting us know where to have a go.

    Cheers.

    One good deed is worth more than a year of good intentions.