Skip to content

Instantly share code, notes, and snippets.

View hovatterz's full-sized avatar

Zack Hovatter hovatterz

View GitHub Profile
// Move a rotated sprite forward/backward
double radians = (M_PI / 180) * _player.getRotation();
float dx = std::cos(radians) * _player.getSpeed() * deltaTime;
float dy = std::sin(radians) * _player.getSpeed() * deltaTime;
Vector2f position = _player.getPosition();
if (direction == DIRECTION_FORWARD) {
position.x += dx;
position.y += dy;
} else if (direction == DIRECTION_BACKWARD) {
@hovatterz
hovatterz / tweets.rb
Created July 17, 2012 00:27
Excluding tweets!
def get_recent_tweets(username, number_of_tweets)
Twitter.user_timeline(username).keep_if {|tweet|
tweet.in_reply_to_user_id == nil
}.slice(0, number_of_tweets)
end
class SomeInterface {
public:
virtual ~SomeInterface() {}
virtual void implement_me() = 0;
};
class SomeImpl : public SomeInterface {
public:
void implement_me() { printf("yay"); }
};
cmake_minimum_required( VERSION 2.8 )
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE )
endif()
project( SFGUI )
### USER INPUT ###
cmake_minimum_required( VERSION 2.8 )
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE )
endif()
project( SFGUI )
### USER INPUT ###
@hovatterz
hovatterz / import-vs-extend.css
Created May 3, 2012 20:52
Testing LESS stuff
/* Import */
body {
background: #000;
color: #fff;
font: 100% Helvetica, Arial, sans-serif;
}
.container {
width: 940px;
}
.first,