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
#include "anya.h" | |
#define ANYA_EPSILON 0.0f //0.0001f | |
#define ANYA_EPSILON_COMPARE 0.0001f | |
#define CORNER_NW 0b0001 | |
#define CORNER_NE 0b0010 | |
#define CORNER_SW 0b0100 | |
#define CORNER_SE 0b1000 |
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
# Copyright 2022 Ben Groves & Dan Bechard @ Avvir.io | |
# MIT License | |
import os | |
import time | |
import random | |
from copy import deepcopy | |
def create_board(size): | |
board = [[0] * size for i in range(size)] |
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
enum CompType { | |
COMP_NAME, | |
COMP_POSITION, | |
COMP_LIFE, | |
COMP_COUNT | |
}; | |
struct Comp_Name { | |
static const CompType type = COMP_NAME; | |
std::string name {}; |
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
Moved to: https://blog.theprogrammingjunkie.com/post/sdl2-cheatsheet/ |
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
Shortened script for this video: https://www.youtube.com/watch?v=of7hJJ1Z7Ho | |
Create a new project | |
Empty project | |
Project name: Square | |
I like to put all of my source code in a "Development" folder | |
Leave Solution name blank | |
Ensure the "Place solution and project in the same directory" box is checked | |
I usually just delete the default filters. They cause confusion because they're not one-to-one with the actual files on disk. |
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
static void collision_broadphase(ta_rigid_body_pair **pairs, ta_rigid_body *rigid_bodies, double dt) | |
{ | |
// Box2D supports 16 collision categories. For each fixture you can_body | |
// specify which category it belongs to. You also specify what other | |
// categories this fixture can_body collide with. | |
// | |
// if ((categoryA & maskB) != 0 && (categoryB & maskA) != 0) | |
// | |
// Collision groups let you specify an integral group index. You can_body | |
// have all fixtures with the same group index always collide |
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
#ifndef DLB_RAND_H | |
#define DLB_RAND_H | |
//------------------------------------------------------------------------------ | |
// Copyright 2021 Dan Bechard | |
// | |
// Contains 3rd party code, see additional copyright notices below. | |
//------------------------------------------------------------------------------ | |
//-- header -------------------------------------------------------------------- |
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
// -- windows.h flags -- | |
#define VC_EXTRALEAN | |
#define WIN32_LEAN_AND_MEAN | |
#define NOGDICAPMASKS | |
#define NOVIRTUALKEYCODES | |
#define NOWINMESSAGES | |
#define OWINSTYLES | |
#define NOSYSMETRICS | |
#define NOMENUS | |
#define NOICONS |
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
# OS generated files | |
.DS_Store* | |
ehthumbs.db | |
Icon? | |
Thumbs.db | |
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs) | |
#/[Bb]in | |
/[Oo]bj |
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 _CRT_SECURE_NO_WARNINGS | |
#include <cassert> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <vector> | |
struct buffer { | |
char *data; | |
int length; |
NewerOlder