Skip to content

Instantly share code, notes, and snippets.

View ajweeks's full-sized avatar

AJ Weeks ajweeks

View GitHub Profile
@ajweeks
ajweeks / InputManager.cpp
Last active February 4, 2019 22:02
Input Action Abstraction - GetActionDown, GetActionPressed, GetActionReleased, GetActionAxisValue
// Returns the number of frames an action has been active for
i32 InputManager::GetActionDown(Action action) const
{
i32 gamepadIndex = 0;
const InputBinding& binding = m_InputBindings[(i32)action];
if (binding.keyCode != KeyCode::_NONE)
{
i32 down = GetKeyDown(binding.keyCode);
if (down > 0)
// Bloom pixel shader snippets (remainder of shaders omitted)
// AJ Weeks 2017
// High pass filter pixel shader
float4 PS(PS_INPUT input) : SV_Target
{
float3 finalColor = gTexture.Sample(SamPoint, input.TexCoord).rgb;
float brightness = dot(finalColor, float3(0.2126f, 0.7152f, 0.0722f));
// Grayscale post-processing effect
// AJ Weeks 2017
Texture2D gTexture;
float gIntensity;
SamplerState samPoint
{
Filter = MIN_MAG_MIP_POINT;
#include <string>
#include <iostream>
#include <vector>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <iterator>
#include <mysql_connection.h>
#pragma once
#include "GameScene.h"
class MeshObject;
class CubePosColorNorm;
class TriggersAssignmentScene : public GameScene
{
public:
TriggersAssignmentScene();
#include "stdafx.h"
#include "TriggersAssignmentScene.h"
#include "CubePosColorNorm.h"
#include "MeshObject.h"
#include "Debug.h"
#include "ContentManager.h"
#include "MeshObject.h"
#include "FreeCamera.h"
#include "PxShape.h"
#include "PxScene.h"
@ajweeks
ajweeks / IsoScene.cpp
Created March 16, 2016 23:11
2D Matrix Magic
//-----------------------------------------------------------------
// Base code by Thomas Kole
// http://www.thomaskole.com
//-----------------------------------------------------------------
#include "IsoScene.h"
#define GAME_ENGINE (GameEngine::GetSingleton())
@ajweeks
ajweeks / dvmbr_2015.md
Last active January 31, 2016 16:01
All Devember 2015 Posts
@ajweeks
ajweeks / dvmbr_28.md
Last active January 31, 2016 16:03
Devember Twenty-Eigth

Devember Day 28

Fourth days left of Devember! I'm kind of glad, since I do feel a little burnt out of game development at the moment. I will likely take a break from TM495, and programming entirely, for at least a few days in January. Although, it will be tempting to google all of the things which I've wondered about.

I didn't get a ton done in the past hour, but a few little things. First I made sure both trees and entities dropped by them are not generated outside the level bounds. I also made it possible for the player to always be able to walk between the edge of the level and every tree.

Then I added a bit more functionality for axes, giving them their own class. So far, each axe knows what type it is, how much damage it deals to trees (maybe I should call that sharpness instead of damage...), and how long it takes to recover from a swing. I thought about adding a durability to each axe also, but I don't think I will. I'm thinking that the game will be less of a survival/gathering game and so durabili

@ajweeks
ajweeks / dvmbr_31.md
Last active January 31, 2016 15:55
Final Day of Devember

Devember Day 31

The last day of Devember is upon us! Somewhat bittersweet, but mostly sweet for me since I really need a break from all the programming I've been doing recently, especially with all of the school work I have to finish off very soon.

With that said, I'm really glad I took part in Devember this year, and I certainly put a lot more time into programming than I would've otherwise. I also think that my devlog writing skills have improved along with a myriad of other small things. I will create one more gist that has all of the links to the other days, and I might even go through each entry and put a 'next' and 'previous' entry link. Although that will take a while, so it probably won't happen until after my exams, sometime arond the end of January.

As for programming today, well... I didn't have a lot of time to spare, but I got some things done.

I added some new animations! I was tired of seeing the player walk up and down the level sideways. They're very very basic at the moment, but at lea