User Tag List

Results 1 to 5 of 5

Thread: Roatating object

  1. #1
    Clicker The Games Factory 2

    Join Date
    Jul 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Roatating object

    Im making a bullet hell shooter, and want to have a special type of bullet rotate around the player getting ever so slowly closer with each orbit. How can i do that?

  2. #2
    No Products Registered

    Join Date
    Aug 2010
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Roatating object

    Do you want it so that it gradually moves in on the player, or do you want it so that it specifically only moves in when it's completed an orbit?

  3. #3
    Clicker The Games Factory 2

    Join Date
    Jul 2010
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Roatating object

    I want it to gradually move in.

  4. #4
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Posts
    1,544
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Roatating object

    Trigonometry is the key word here. You want to position the object based on your players location so that its offset at polar coordinates, lowering the distances to make it get closer.

    Generally these are given by equations like:


    X Position of "Bullet" = X Position of "Player" + Cos(BulletAngle) * Distance
    Y Position of "Bullet" = Y Position of "Player" - Sin(BulletAngle) * Distance


    An easier way to do a similar effect if thats a bit much, would be a cheap workaround- give your bullet a "ball movement" and then set its directions like this:

    Always - Make Bullet look in direction of "Player"
    Always - Set Direction of Bullet to (Direction of Bullet + 7)

  5. #5
    No Products Registered

    Join Date
    Aug 2010
    Posts
    73
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Roatating object

    And then to make it move in closer, just keep decreasing "Distance" by whatever, and to control the speed at which it orbits the player, just keep adding some sort of "Speed" value to "BulletAngle"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •