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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PlayerShoot : MonoBehaviour | |
{ | |
public List<WeaponObject> ListOfWeapons; | |
public AudioSource Audiosrc; | |
public AudioClip SwitchSound; |
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
import requests | |
import RPi.GPIO as GPIO | |
import json | |
import time | |
#Openweather idCodes less than 700 are all precipitation | |
def CheckRain(IdCode): | |
if IdCode < 700: | |
return True | |
else: | |
return False |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class PlayerMovement : MonoBehaviour | |
{ | |
public Rigidbody PlayerBody; | |
public float Speed; | |
public float FrictionalForce; | |
public Camera PlayerCam; |
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
//Arduino provides a set of prebuilt code to run servos. To bring it into our code, we use this command. | |
#include <Servo.h> | |
//A class is a collection of differnet data and functions you can use to make coding more conveinent. In this case, we | |
//make a class that holds every servo on our robot so we can easily control it | |
class ServoManager{ | |
public: | |
//Every servo on the robot is created in our class | |
Servo FrontRightThigh; | |
Servo FrontRightKnee; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
//Because UI is a seperate package from Unity as a whole, we have to import using the using command. | |
using UnityEngine.UI; | |
public class UIManager : MonoBehaviour { | |
//We create Text objects in our script. The text we created earlier will be dragged into this script through the editor. | |
public Text HealthText; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
[System.Serializable] | |
public class FoodScript : ClickableParent { | |
public AudioSource Source; | |
public AudioClip Clip; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class Enemy_Zombie : Entity_Parent { | |
//We create reference to the AudioSource that we can drag in because the zombies are a prefab | |
public AudioSource Source; | |
//This is the Audioclip of the zombie dying. Audio clips are made by downloading sounds from the internet and dragging them into the asset window | |
public AudioClip DieClip; |
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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class DayCountManager : MonoBehaviour | |
{ | |
//This is the current day. We set it at 1 at the start | |
[HideInInspector] | |
public int CurrentDay; | |
//We make a Populator_Manager reference so we can drag the Populator_Manager and use its difficulty function |