This file contains 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 MarianGame : public Game | |
{ | |
public: | |
MarianGame(); | |
void Update(); | |
private: | |
Continuity continuity; | |
Values values; | |
Moods moods; |
This file contains 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
; waits for 45 seconds (Sleep uses milliseconds) | |
; starts Winnitron launcher | |
Sleep 45000 | |
Run c:\winnitron\winnitron.exe |
This file contains 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
struct Node | |
{ | |
Node* child[2] | |
Rectangle rc | |
int imageID | |
} | |
Node* Node::Insert(const Image& img) | |
if we're not a leaf then |
This file contains 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
/*Maximum spriteSheet width -> FIXED*/ | |
var maxWidth = 256; | |
var filename = activeDocument.name.replace(".psd",""); | |
var file = new File(activeDocument.fullName.path+"/"+filename+".xml"); | |
var AD = activeDocument; | |
var output = new File(activeDocument.fullName.path+"/"+filename+".png"); | |
var pngOptions = new PNGSaveOptions(); |
This file contains 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
<TextureAtlas image="graphics/monocleman.png" width="512" height="512"> | |
<TextureAtlasEntry name="torso" coords="262 2 90 118"/> | |
<TextureAtlasEntry name="tortilla" coords="2 2 258 183"/> | |
<TextureAtlasEntry name="mustache" coords="262 122 109 43"/> | |
<TextureAtlasEntry name="nose" coords="354 2 40 81"/> | |
<TextureAtlasEntry name="hat" coords="396 2 86 69"/> | |
<TextureAtlasEntry name="eye-left" coords="62 249 12 15"/> | |
<TextureAtlasEntry name="eye-right" coords="76 249 12 14"/> | |
<TextureAtlasEntry name="eyeunderline-left" coords="396 73 28 10"/> | |
<TextureAtlasEntry name="eyebrow" coords="46 281 42 16"/> |
This file contains 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
int y = 0; | |
int max = 16; | |
for (y = 0; y < max; y++) | |
{ | |
CollisionData collisionData; | |
if (!Collide("Obstruction", &collisionData)) | |
{ | |
break; | |
} | |
printf("normal %f, %f\n", collisionData.normal.x, collisionData.normal.y); |
This file contains 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
void Player::Update() | |
{ | |
Entity::Update(); | |
Vector2 lastPosition = position; | |
const float walkSpeed = 150; | |
const float runSpeed = 220; | |
const float maxFallSpeed = 50.0f; | |
const float gravity = 980.0f; |
This file contains 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
// fall, cap at maxFallSpeed | |
velocity.y += MIN(gravity * Monocle::deltaTime, maxFallSpeed); | |
position += velocity * Monocle::deltaTime; | |
float useSpeed = isWalking?walkSpeed:runSpeed; | |
const float turnThresh = 0.25f; | |
if (moveDir.x > turnThresh) | |
scale.x = 1; |