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
{ | |
// } // { | |
"git.enabled": false, | |
"telemetry.enableTelemetry": false, | |
"telemetry.enableCrashReporter": false, | |
"workbench.activityBar.visible": false, | |
"workbench.statusBar.visible": false, | |
"workbench.editor.enablePreview": false, | |
"workbench.editor.enablePreviewFromQuickOpen": false, | |
"workbench.editor.showIcons": false, |
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 Bullets::Update(Enemies* enemies) { | |
for (int i = 0; i < MAX_BULLETS; i++) { | |
Bullet* b = & bullets[i]; | |
if (b->unused) continue; | |
// Bullet will be deleted because it exits screen or collides. | |
// If we're out of bounds, fuck the death animation if there is one because | |
// nobody's going to see an off screen death animation. |
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
from memcache import Client | |
from time import time | |
n = 100000 | |
def benchtime(fn): | |
oldtime = time() | |
fn() | |
return time() - oldtime | |
mc = Client(['127.0.0.1:11211']) |
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
1. Download Compiler | |
2. Add Compiler to Path | |
3. Download SDL | |
4. Use SDL | |
$. Extras | |
1. Download compiler: |
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
// This example loads an image and a shader that are used to draw the image. | |
#include <math.h> | |
#include <GL/glew.h> | |
#include <SDL2/SDL.h> | |
#include <SDL2/SDL_image.h> | |
#include <SDL2/SDL_opengl.h> | |
#define print SDL_Log |
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
let polygon = [ | |
[200, 100], [400, 130], [350, 300], [250, 300] | |
]; | |
function setup() { | |
createCanvas(800, 800); | |
} | |
function draw() { | |
background(0); |
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
#define M_PI 3.1415926535897932384626433832795 | |
#define NUM_LIGHTS 32 | |
struct Light { | |
vec2 position; | |
// color of the light | |
vec3 diffuse; | |
// power of the light | |
float power; | |
}; |
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
def lerp(a, b, t) | |
return a + (b - a) * t | |
end |
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
crtShader = lg.newShader([[ | |
extern float elapsed; | |
extern float colorI; | |
vec2 radialDistortion(vec2 coord, float dist) { | |
vec2 cc = coord - 0.5; | |
dist = dot(cc, cc) * dist + cos(elapsed * .3) * .01; | |
return (coord + cc * (1.0 + dist) * dist); | |
} | |
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
function love.draw() | |
local canvas, x, y, width, height, rotation, scaleX, scaleY, offsetX, offsetY = Scene:getRender() | |
love.graphics.setShader(crtShader) | |
love.graphics.draw(canvas, x, y, width, height, rotation, scaleX, scaleY, offsetX, offsetY) | |
end | |
scene.getRender = function (self, drawArg) | |
love.graphics.setColor(1,1,1) | |
love.graphics.setCanvas({self.threeCanvas, depth=true}) | |
love.graphics.clear(0,0,0,0) |
NewerOlder