Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicolai B. Andersen niiicolai

View GitHub Profile
View audio_phase_shift.py
def get_shifted_data_array(self):
"""Returns the audio audio shifted either left or right
using zeros matching the phase shift in a given direction"""
# Calculate number of shifts
shifts = np.zeros(int(self.__sample_rate * abs(self.__phase_shift)))
# self.__sample_rate => 44100
# abs(self.__phase_shift) => et tal mellem 0 og 1.6
# lad os sige at det i dette eksempel er 0.5
# self.__sample_rate * abs(self.__phase_shift) = 44100 * 0.5 = 22050 antal nuller
View Portal.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Portal : MonoBehaviour
{
[SerializeField]
private string playerTag;
[SerializeField]
View BowAndArrow.cs
/* Arrow.cs */
using UnityEngine;
public class Arrow : MonoBehaviour
{
[SerializeField]
private float damage;
[SerializeField]
View Movement(With jump feature).cs
using UnityEngine;
public class Movement : MonoBehaviour
{
[SerializeField]
private float movementSpeed;
[SerializeField]
private float jumpPower;
View SimpleParticleShooting.cs
/* Weapon.cs */
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Weapon : MonoBehaviour
{
[SerializeField]
private new ParticleSystem particleSystem;
View CoinsController.cs
/* CoinsController.cs */
using System.Collections.Generic;
using UnityEngine;
public class CoinsController : MonoBehaviour
{
[SerializeField]
private int numberOfCoins;
[SerializeField]
View SimpleHealthController.cs
/* HealthController.cs */
using System.Collections;
using UnityEngine;
using UnityEngine.UI;
public class HealthController : MonoBehaviour
{
[SerializeField]
private GameObject healthPanel;
View GunShooting.cs
/* WeaponController.cs */
using UnityEngine;
public class WeaponController : MonoBehaviour
{
[SerializeField]
private Weapon weapon;
[SerializeField]
private string enemyTag;
View Movement.cs
using UnityEngine;
using UnityEngine.AI;
public class Movement : MonoBehaviour
{
[SerializeField]
private Camera camera;
private string groundTag = "Ground";
View Movement.cs
using UnityEngine;
public class Movement : MonoBehaviour
{
private Rigidbody rigidbody;
[SerializeField]
private float speed;
[SerializeField]