]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
Player Sprite
authordrumsetmonkey <abelleisle@roadrunner.com>
Thu, 21 Jan 2016 13:17:19 +0000 (08:17 -0500)
committerdrumsetmonkey <abelleisle@roadrunner.com>
Thu, 21 Jan 2016 13:17:19 +0000 (08:17 -0500)
assets/playerk.png
config/settings.xml
include/common.h
include/entities.h
main.cpp
src/entities.cpp
xcf/player.xcf
xcf/playerJ.xcf [new file with mode: 0644]

index be98f97491f96a2a5d47e1923623394589918101..3dfb4ddf012a0d6d824d79af4e6250d9ab0e9ace 100644 (file)
Binary files a/assets/playerk.png and b/assets/playerk.png differ
index c06089b42fee1d226ec884834b592688ef0ed021..d981664ee2126556767026155095ff117b3b7726 100644 (file)
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
 
 <screen width="1280" height="720" />
-<hline value="3" />
+<hline value="3" />
\ No newline at end of file
index f5952ebfdb318b983a026a7ca85d7aa37a55fd84..763ecc6a8daf764a09f890b6afa1b3dc3a65e8b1 100644 (file)
@@ -110,7 +110,7 @@ extern unsigned int SCREEN_HEIGHT;
  * 
  */
 
-#define HLINE 3
+#define HLINE 4
 
 /**
  * A 'wrapper' for libc's srand(), as we hope to eventually have our own random number
index edf7022227d7339dc0de3444d8fad2437ce223ed..7925bb90eb344cfd08838d42679eb7053d2f109c 100644 (file)
@@ -93,9 +93,9 @@ public:
                glEnable(GL_TEXTURE_2D);
                glColor3ub(255,255,255);
                glBegin(GL_QUADS);
-                       glTexCoord2f(.25*index.x, .126*index.y);        glVertex2i(loc.x, loc.y);
-                       glTexCoord2f(.26*index.x, .126*index.y);        glVertex2i(loc.x + width, loc.y);
-                       glTexCoord2f(.26*index.x, .125*index.y);        glVertex2i(loc.x + width, loc.y + height);
+                       glTexCoord2f(.25*index.x, .125*index.y);        glVertex2i(loc.x, loc.y);
+                       glTexCoord2f(.25*index.x, .125*index.y);        glVertex2i(loc.x + width, loc.y);
+                       glTexCoord2f(.25*index.x, .125*index.y);        glVertex2i(loc.x + width, loc.y + height);
                        glTexCoord2f(.25*index.x, .125*index.y);        glVertex2i(loc.x, loc.y + width);
                glEnd();
                glDisable(GL_TEXTURE_2D);
index fb13b5a6cc121326a4798efc580f9dbde0317bbd..717fc1e5bb73ee41a8c7867107fe2666805a1dae 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -173,7 +173,7 @@ std::string readFile(const char *filePath) {
 
     if(!fileStream.is_open()) {
         std::cerr << "Could not read file " << filePath << ". File does not exist." << std::endl;
-        return "";
+        return "cancer";
     }
 
     std::string line = "";
@@ -965,7 +965,7 @@ void logic(){
                                                                                                HLINE*1.25, 
                                                                                                rand()%2 == 0?-(rand()%7)*.01:(rand()%7)*.01,
                                                                                                ((4+rand()%6)*.05), 
-                                                                                               {0.0f,0.0f,255.0f}, 
+                                                                                               {0,0,255}, 
                                                                                                2500);
 
                                        currentWorld->particles.back()->fountain = true;
index 76b9aa4284af92a7c61635fddbfc8c083d5d8800..781789177f7528037cb71cf42aca29cf12180935 100644 (file)
@@ -92,7 +92,7 @@ Player::Player(){ //sets all of the player specific traits on object creation
        subtype = 0;    
        health = maxHealth = 100;
        speed = 1;
-       tex = new Texturec(3, "assets/player1.png", "assets/player.png", "assets/player2.png");
+       tex = new Texturec(3, "assets/player1.png", "assets/playerk.png", "assets/player2.png");
        //tex = new Texturec(3, "assets/maybeplayer.png", "assets/maybeplayer.png", "assets/maybeplayer.png");
        inv = new Inventory(PLAYER_INV_SIZE);
 }
index c99fb42ef3c804f91e7bc05c8d68a0504fbced2c..d8991a5982963c74de82ebe81c06e3756900e0d3 100644 (file)
Binary files a/xcf/player.xcf and b/xcf/player.xcf differ
diff --git a/xcf/playerJ.xcf b/xcf/playerJ.xcf
new file mode 100644 (file)
index 0000000..7f0cc59
Binary files /dev/null and b/xcf/playerJ.xcf differ