This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # If we need to rotate our player (character is a ball, etc...) | |
| if (self.rotate == True and moveX != 0): | |
| if (moveX < 0): self.image = pygame.transform.rotate(self.image, -90) | |
| else: self.image = pygame.transform.rotate(self.image, 90) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Zach J. Elko | |
| // 2010 | |
| // skater.cpp | |
| // | |
| // I've wanted to make one of these for a while now. I got bored and | |
| // whipped this up in about 3 hours. There are a lot of improvements | |
| // that can/should be made, but it's not bad for the short amount of | |
| // time put into it. | |
| // | |
| // Basic C/C++ code obfuscator. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // resource.h | |
| // | |
| #ifndef _RESOURCE_H | |
| #define _RESOURCE_H | |
| template <typename T> | |
| class Resource | |
| { | |
| protected: | |
| T* data; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Vector2d.hpp | |
| // | |
| // Zach Elko | |
| // 2010 | |
| // | |
| // General-purpose 2d vector class | |
| // | |
| #ifndef VECTOR2D_H | |
| #define VECTOR2D_H |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SoundManager.cpp | |
| // | |
| // Zach Elko | |
| // 2010 | |
| // | |
| // A simple sound manager for SDL. | |
| // | |
| #include "SoundManager.h" | |
| #include "SDL/SDL_mixer.h" | |
| #include "../ResourceManager.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::vector<int> foo; | |
| // Set the iterator once we've created the container | |
| std::vector<int>::iterator iter = foo.begin(); | |
| // Add some stuff to it | |
| foo.push_back(2); | |
| foo.push_back(3); | |
| // Use the iterator... oops! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| std::vector<int> foo; | |
| // Add an item before setting the iterator... | |
| // Should work, right? | |
| foo.push_back(2); | |
| std::vector<int>::iterator iter = foo.begin(); | |
| // Add another item | |
| foo.push_back(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| std::vector<int> foo; | |
| // Add an item and then obtain an iterator to it | |
| foo.push_back(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| int main() { | |
| std::vector<int> foo; | |
| // Add an item and then obtain an iterator to it | |
| foo.push_back(3); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ResourceManager.cpp | |
| // | |
| // Zach Elko | |
| // 2010 | |
| // | |
| // Functions as a garbage collector for allocating and releasing SDL resources. | |
| // | |
| // Supports: SDL_Surface, Mix_Music, and Mix_Chunk. | |
| // | |
| // It improves program efficiency by only allocating one copy for each |