]> Dogcows Code - chaz/yoink/blobdiff - src/Character.cc
miscellaneous cleanup
[chaz/yoink] / src / Character.cc
index 97a10b2553d27532cd2631f2a5447ae85ec7f1ca..c7de260d6cb61190e5ceaf60b2be6701b455f309 100644 (file)
 
 *******************************************************************************/
 
+#include <iostream>
+
 #include "Character.hh"
+#include "Log.hh"
 
-#include <iostream>
        
 Character::Character(const std::string& name) :
        tilemap_(name),
@@ -37,8 +39,10 @@ Character::Character(const std::string& name) :
        current.mass = 1.0;
        current.inverseMass = 1.0 / current.mass;
 
+       // gravity
        current.force = Mf::Vector2(0.0, -120.0);
 
+       // starting position
        current.position = Mf::Vector2(64.0, 64.0);
        current.momentum = Mf::Vector2(0.0, 0.0);
        current.recalculate();
@@ -48,12 +52,6 @@ Character::Character(const std::string& name) :
        updateContainers();
 }
 
-Character::~Character()
-{
-       //delete texture;
-       //delete anim;
-}
-
 
 void Character::update(Mf::Scalar t, Mf::Scalar dt)
 {
@@ -125,7 +123,8 @@ void Character::handleEvent(const Mf::Event& event)
                        break;
        }
 
-       std::cout << "current force: " << current.force << std::endl;
+       //Mf::logInfo("current force [%f %f]", current.force[0], current.force[1]);
+       //std::cerr << "current force: " << current.force << std::endl;
 }
 
 
@@ -143,7 +142,7 @@ void Character::draw(Mf::Scalar alpha) const
 
        Mf::Scalar s = 16.0;
 
-       glBegin(GL_QUADS);
+       glBegin(GL_TRIANGLE_FAN);
                glTexCoord2f(coords[0], coords[1]);
                glVertex3(state.position[0]-s, state.position[1]-s, z);
                glTexCoord2f(coords[2], coords[3]);
This page took 0.022267 seconds and 4 git commands to generate.