This file contains hidden or 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 <iostream> | |
#include <random> | |
#include <vector> | |
#include <math.h> | |
#include <sstream> | |
struct Vector { | |
int x; | |
int y; |
This file contains hidden or 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 <stdlib.h> | |
#define GLEW_STATIC | |
#include <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <iostream> | |
//macro to write shader programs inline | |
#ifndef GLSL | |
#define GLSL(version,A) "#version " #version "\n" #A | |
#endif |
This file contains hidden or 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
extends Node2D | |
signal swipe(direction) | |
var swipe_start = null | |
var minimum_drag = 100 | |
func _unhandled_input(event): | |
if event.is_action_pressed("ui_click"): | |
swipe_start = get_global_mouse_position() |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"regexp" | |
) | |
const emailRegex = `^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$` | |
func printResult(result bool, err error) { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type ( | |
Observable interface { | |
Add(observer Observer) |
This file contains hidden or 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Player : MonoBehaviour | |
{ | |
public Rigidbody2D rb; | |
public float rotateSpeed = 300f; | |
public float angularSpeed = 10f; | |
private float yAxis; |
This file contains hidden or 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
using UnityEngine; | |
using UnityEngine.Events; | |
public class CharacterController2D : MonoBehaviour | |
{ | |
[SerializeField] private float m_JumpForce = 400f; // Amount of force added when the player jumps. | |
[Range(0, 1)] [SerializeField] private float m_CrouchSpeed = .36f; // Amount of maxSpeed applied to crouching movement. 1 = 100% | |
[Range(0, .3f)] [SerializeField] private float m_MovementSmoothing = .05f; // How much to smooth out the movement | |
[SerializeField] private bool m_AirControl = false; // Whether or not a player can steer while jumping; | |
[SerializeField] private LayerMask m_WhatIsGround; // A mask determining what is ground to the character |
This file contains hidden or 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Bomb : MonoBehaviour | |
{ | |
// Use this for initialization | |
void Start() | |
{ | |
int seconds = 3; |
This file contains hidden or 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
using UnityEngine; | |
public class ExplosionCenter : MonoBehaviour | |
{ | |
// Use this for initialization | |
void Start() | |
{ | |
Destroy(gameObject, this.GetComponent<Animator>().GetCurrentAnimatorStateInfo(0).length); | |
} |
This file contains hidden or 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 OnCollisionEnter2D(Collision2D col) | |
{ | |
if (col.gameObject.tag.Equals("Wall")) | |
{ | |
Vector3 hit = col.contacts[0].normal; | |
Debug.Log(hit); | |
float angle = Vector3.Angle(hit, Vector3.up); | |
if (Mathf.Approximately(angle, 0)) | |
{ |