1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

(Question) How to apply force.

Discussion in 'Modding Help' started by jwoo2023, Nov 29, 2013.

  1. jwoo2023

    jwoo2023 Shopkeep Stealer

    Messages:
    48
    I am working on my Items+ mod, and I am making a propeller (Suggested by Inferdy), and I want the character to fly upwards when they click, and it overheats also.

    And how would you make the sprite only stay up? So you can't turn it, when you move your cursor.

    And finally, how do you make the sprite frames switch with each other, like the drill only when you click?
     
  2. nkChehov

    nkChehov Ballista Bolt Thrower
    1. PumpkinStars - [Pk#] - Inactive

    Messages:
    172
    CBlob@ :: AddForce( Vec2f )

    check X:\Kag Beta\Manual\interface\objects

    P.S. ill be pleasure to make such thing (quite interesting) - need only texture. PM if have some problems.
     
    Asu likes this.
  3. jwoo2023

    jwoo2023 Shopkeep Stealer

    Messages:
    48
    I have tried that, but what would I put in the brackets?
    --- Double Post Merged, Nov 29, 2013, Original Post Date: Nov 29, 2013 ---
    So what is Vec2f, is it a variable type?
     
  4. A Vec2f is a 2 float vector that holds an x and a y value. With AddForce, you're applying a force in the x and y direction so you can go anywhere on a 2d plane. So if you wanted to make something go up you would AddForce(new Vec2f(0, -10.0f)); Since the top left corner is (0,0) and the bottom right is (width, height), down is positive in the y direction and up is negative. We use 0 since we don't want any horizontal movement. Right is positive in the x direction. Correct me if I'm wrong people that know what they're doing.
     
    Froghead48 likes this.