Skip to content

Instantly share code, notes, and snippets.

View David-Mimnagh's full-sized avatar

David Mimnagh David-Mimnagh

View GitHub Profile
void GameState::inrange_lights()
{
//do comparison code in here
/*
if the player is within the light
then take that lights x and y pos & compare that wil all other lights returning distance_between
if the distance_between is < 300
draw a shadow within that light
else
move on to the next light
@David-Mimnagh
David-Mimnagh / Player follow camera
Created December 11, 2014 20:03
amount of code needed for the camera
sf::RenderWindow& window = state_manager_.get_render_window();
sf::View view_main;
view_main.setCenter(sf::Vector2f(player_.Shape().getOrigin().x, player_.Shape().getOrigin().y));
view_main.setSize(sf::Vector2f(600, 400));
view_main.move(player_.Shape().getPosition().x, player_.Shape().getPosition().y);
if (view_main.getCenter().x + (view_main.getSize().x / 2) >= LEVEL_WIDTH)
view_main.setCenter(LEVEL_WIDTH - (view_main.getSize().x / 2), view_main.getCenter().y);
@David-Mimnagh
David-Mimnagh / Guard_Logic
Created December 16, 2014 19:51
guard logic
void Guard::player_search(Player player)
{
if (player.Shape().getPosition().x - Shape().getPosition().x <= hunting_distance_)
gotoXpos = player.Shape().getPosition().x;
movement_distance_ = gotoXpos - Shape().getPosition().x;
if (Shape().getPosition().x < gotoXpos)
movement_speed_ *= 1.f;
if (treeData == null) {
var treeData = Ext.Ajax.request({
method: 'GET',
url: '/Dashboard/GetNavigationData',
success: function (response) {
treeData = Ext.util.JSON.decode(response.responseText).results;
var newChild = {};
var list = [];
var treeNode = newTree.getRootNode();
if (treeData == null) {
var treeData = Ext.Ajax.request({
method: 'GET',
url: '/Dashboard/GetNavigationData',
success: function (response) {
treeData = Ext.util.JSON.decode(response.responseText).results;
var list = [];
var treeNode = newTree.getRootNode();
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
namespace AdventOfCode_Day5
{
class Program
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
namespace AdventOfCode_Day5
{
class Program
{
do
{
inputCopy = input;
inputCopy += index.ToString();
data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(inputCopy));
if(data[0] == 0)
{
if (data[1] == 0)
{
if (data[2] == 0)
byte[] data = null;
List<byte[]> dataList = new List<byte[]>();
string inputCopy = input;
// Convert the input string to a byte array and compute the hash.
do
{
Console.WriteLine("The index " + index+ ".");
inputCopy = input;
inputCopy += index.ToString();
do
{
Console.WriteLine("The index " + index + ".");
inputCopy = input;
inputCopy += index.ToString();
data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(inputCopy));
System.Text.StringBuilder sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));