src/Rope.hh
author ekku
Sat, 06 Dec 2008 21:02:35 +0000
changeset 228 dbc1bb7a98b5
parent 225 22ecb9cb9245
child 231 5085764e1dbb
permissions -rw-r--r--
Rope has forces
#ifndef ROPE_HH
#define ROPE_HH

// Pre-declarations since rope wants to know the Player
// and the Player wants to know the rope.
class Rope;

#include "Player.hh"
#include "PhysicsObject.hh"

enum RopeState { FOLDED, FLYING, FIXED };

class Rope : public PhysicsObject {
private:
    Player &pl;
    // How long is the rope in its static state
    float length;
    virtual void onCollision (void);
    RopeState rs;
    
protected:
    virtual float getPivotForce (PhysicsObject *bob);

public:
    Rope(Player &climber);

    void shoot (void);
    void release (void);
    RopeState getState (void);
    virtual void draw(CL_GraphicContext *gc) const;
};

#endif