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
// 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) { |
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
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 |
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
class SomeInterface { | |
public: | |
virtual ~SomeInterface() {} | |
virtual void implement_me() = 0; | |
}; | |
class SomeImpl : public SomeInterface { | |
public: | |
void implement_me() { printf("yay"); } | |
}; |
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
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 ### |
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
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 ### |
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
/* Import */ | |
body { | |
background: #000; | |
color: #fff; | |
font: 100% Helvetica, Arial, sans-serif; | |
} | |
.container { | |
width: 940px; | |
} | |
.first, |