Add CT3536 Games Programming

This commit is contained in:
2023-12-07 02:05:57 +00:00
parent eb94d02f16
commit 71e1a59261
14438 changed files with 919425 additions and 0 deletions

View File

@ -0,0 +1,432 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.0">
<asset>
<contributor>
<author></author>
<authoring_tool>FBX COLLADA exporter</authoring_tool>
<comments></comments>
</contributor>
<created>2011-03-29T18:23:31Z</created>
<modified>2011-03-29T18:23:31Z</modified>
<revision></revision>
<title></title>
<subject></subject>
<keywords></keywords>
<unit meter="1.000000"/>
<up_axis>Y_UP</up_axis>
</asset>
<library_images>
<image id="Map__2-image" name="Map__2">
<init_from>asteroid1.jpg</init_from>
</image>
</library_images>
<library_materials>
<material id="_02___Default" name="_02___Default">
<instance_effect url="#_02___Default-fx"/>
</material>
</library_materials>
<library_effects>
<effect id="_02___Default-fx" name="_02___Default">
<profile_COMMON>
<technique sid="standard">
<phong>
<emission>
<color sid="emission">0.000000 0.000000 0.000000 1.000000</color>
</emission>
<ambient>
<color sid="ambient">0.588235 0.588235 0.588235 1.000000</color>
</ambient>
<diffuse>
<texture texture="Map__2-image" texcoord="CHANNEL0">
<extra>
<technique profile="MAYA">
<wrapU sid="wrapU0">TRUE</wrapU>
<wrapV sid="wrapV0">TRUE</wrapV>
<blend_mode>ADD</blend_mode>
</technique>
</extra>
</texture>
</diffuse>
<specular>
<color sid="specular">0.000000 0.000000 0.000000 1.000000</color>
</specular>
<shininess>
<float sid="shininess">2.000000</float>
</shininess>
<reflective>
<color sid="reflective">0.000000 0.000000 0.000000 1.000000</color>
</reflective>
<reflectivity>
<float sid="reflectivity">1.000000</float>
</reflectivity>
<transparent>
<color sid="transparent">1.000000 1.000000 1.000000 1.000000</color>
</transparent>
<transparency>
<float sid="transparency">0.000000</float>
</transparency>
</phong>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_geometries>
<geometry id="Sphere01-lib" name="Sphere01Mesh">
<mesh>
<source id="Sphere01-lib-Position">
<float_array id="Sphere01-lib-Position-array" count="87">
0.000000 2.933583 28.060616
-0.000001 17.136948 20.423018
-5.802542 13.127665 15.231148
-11.663722 2.975798 15.231148
-9.628154 -8.568477 15.231148
-0.648304 -16.103464 15.231148
5.861180 -16.103464 20.423018
14.841030 -8.568477 20.423018
16.876600 2.975794 20.423018
11.015424 13.127658 20.423018
-0.000001 26.255325 4.629520
-11.663722 20.112747 -0.562349
-20.643574 7.484353 -5.707970
-18.212126 -13.127668 -0.562349
-3.766973 -24.671936 -0.562349
8.979849 -24.671936 4.629520
22.737778 -13.127667 4.629520
16.527693 4.559181 4.629520
16.876608 20.112740 4.629520
5.931790 23.088545 -13.330179
-1.475312 17.686852 -13.330179
-9.372061 4.009281 -13.330179
-6.629545 -11.544277 -13.330179
-1.964954 -21.696136 -13.330179
13.828537 -21.696136 -13.330179
19.995264 -11.544276 -13.330179
22.737780 4.009276 -13.330179
14.841040 17.686844 -13.330179
5.931791 -0.000000 -20.643642
</float_array>
<technique_common>
<accessor source="#Sphere01-lib-Position-array" count="29" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Sphere01-lib-Normal0">
<float_array id="Sphere01-lib-Normal0-array" count="486">
-0.228682 0.047693 0.972332
-0.248055 0.672597 0.697196
-0.748457 0.411777 0.519858
-0.228682 0.047693 0.972332
-0.748457 0.411777 0.519858
-0.818351 0.149015 0.555064
-0.228682 0.047693 0.972332
-0.818351 0.149015 0.555064
-0.667101 -0.407790 0.623445
-0.228682 0.047693 0.972332
-0.667101 -0.407790 0.623445
-0.448070 -0.690501 0.567840
-0.228682 0.047693 0.972332
-0.448070 -0.690501 0.567840
0.006824 -0.677541 0.735453
-0.228682 0.047693 0.972332
0.006824 -0.677541 0.735453
0.685263 -0.291309 0.667498
-0.228682 0.047693 0.972332
0.685263 -0.291309 0.667498
0.841524 0.048529 0.538035
-0.228682 0.047693 0.972332
0.841524 0.048529 0.538035
0.465185 0.548358 0.694915
-0.228682 0.047693 0.972332
0.465185 0.548358 0.694915
-0.248055 0.672597 0.697196
-0.248055 0.672597 0.697196
-0.133100 0.978085 0.160109
-0.698949 0.711487 -0.072511
-0.248055 0.672597 0.697196
-0.698949 0.711487 -0.072511
-0.748457 0.411777 0.519858
-0.748457 0.411777 0.519858
-0.698949 0.711487 -0.072511
-0.907422 0.283072 -0.310573
-0.748457 0.411777 0.519858
-0.907422 0.283072 -0.310573
-0.818351 0.149015 0.555064
-0.818351 0.149015 0.555064
-0.907422 0.283072 -0.310573
-0.888817 -0.457993 -0.015706
-0.818351 0.149015 0.555064
-0.888817 -0.457993 -0.015706
-0.667101 -0.407790 0.623445
-0.667101 -0.407790 0.623445
-0.888817 -0.457993 -0.015706
-0.359945 -0.928249 0.093772
-0.667101 -0.407790 0.623445
-0.359945 -0.928249 0.093772
-0.448070 -0.690501 0.567840
-0.448070 -0.690501 0.567840
-0.359945 -0.928249 0.093772
0.275270 -0.931218 0.238873
-0.448070 -0.690501 0.567840
0.275270 -0.931218 0.238873
0.006824 -0.677541 0.735453
0.006824 -0.677541 0.735453
0.275270 -0.931218 0.238873
0.916654 -0.338340 0.212771
0.006824 -0.677541 0.735453
0.916654 -0.338340 0.212771
0.685263 -0.291309 0.667498
0.685263 -0.291309 0.667498
0.916654 -0.338340 0.212771
0.978638 0.156745 0.133037
0.685263 -0.291309 0.667498
0.978638 0.156745 0.133037
0.841524 0.048529 0.538035
0.841524 0.048529 0.538035
0.978638 0.156745 0.133037
0.790952 0.597552 0.131631
0.841524 0.048529 0.538035
0.790952 0.597552 0.131631
0.465185 0.548358 0.694915
0.465185 0.548358 0.694915
0.790952 0.597552 0.131631
-0.133100 0.978085 0.160109
0.465185 0.548358 0.694915
-0.133100 0.978085 0.160109
-0.248055 0.672597 0.697196
-0.133100 0.978085 0.160109
0.006659 0.798535 -0.601912
-0.460625 0.514703 -0.723122
-0.133100 0.978085 0.160109
-0.460625 0.514703 -0.723122
-0.698949 0.711487 -0.072511
-0.698949 0.711487 -0.072511
-0.460625 0.514703 -0.723122
-0.513614 0.141412 -0.846288
-0.698949 0.711487 -0.072511
-0.513614 0.141412 -0.846288
-0.907422 0.283072 -0.310573
-0.907422 0.283072 -0.310573
-0.513614 0.141412 -0.846288
-0.556298 -0.207010 -0.804785
-0.907422 0.283072 -0.310573
-0.556298 -0.207010 -0.804785
-0.888817 -0.457993 -0.015706
-0.888817 -0.457993 -0.015706
-0.556298 -0.207010 -0.804785
-0.314074 -0.678511 -0.664064
-0.888817 -0.457993 -0.015706
-0.314074 -0.678511 -0.664064
-0.359945 -0.928249 0.093772
-0.359945 -0.928249 0.093772
-0.314074 -0.678511 -0.664064
0.481002 -0.712299 -0.511143
-0.359945 -0.928249 0.093772
0.481002 -0.712299 -0.511143
0.275270 -0.931218 0.238873
0.275270 -0.931218 0.238873
0.481002 -0.712299 -0.511143
0.750712 -0.341286 -0.565646
0.275270 -0.931218 0.238873
0.750712 -0.341286 -0.565646
0.916654 -0.338340 0.212771
0.916654 -0.338340 0.212771
0.750712 -0.341286 -0.565646
0.874809 0.231053 -0.425821
0.916654 -0.338340 0.212771
0.874809 0.231053 -0.425821
0.978638 0.156745 0.133037
0.978638 0.156745 0.133037
0.874809 0.231053 -0.425821
0.648495 0.530867 -0.545559
0.978638 0.156745 0.133037
0.648495 0.530867 -0.545559
0.790952 0.597552 0.131631
0.790952 0.597552 0.131631
0.648495 0.530867 -0.545559
0.006659 0.798535 -0.601912
0.790952 0.597552 0.131631
0.006659 0.798535 -0.601912
-0.133100 0.978085 0.160109
-0.018336 0.012233 -0.999757
-0.460625 0.514703 -0.723122
0.006659 0.798535 -0.601912
-0.018336 0.012233 -0.999757
-0.513614 0.141412 -0.846288
-0.460625 0.514703 -0.723122
-0.018336 0.012233 -0.999757
-0.556298 -0.207010 -0.804785
-0.513614 0.141412 -0.846288
-0.018336 0.012233 -0.999757
-0.314074 -0.678511 -0.664064
-0.556298 -0.207010 -0.804785
-0.018336 0.012233 -0.999757
0.481002 -0.712299 -0.511143
-0.314074 -0.678511 -0.664064
-0.018336 0.012233 -0.999757
0.750712 -0.341286 -0.565646
0.481002 -0.712299 -0.511143
-0.018336 0.012233 -0.999757
0.874809 0.231053 -0.425821
0.750712 -0.341286 -0.565646
-0.018336 0.012233 -0.999757
0.648495 0.530867 -0.545559
0.874809 0.231053 -0.425821
-0.018336 0.012233 -0.999757
0.006659 0.798535 -0.601912
0.648495 0.530867 -0.545559
</float_array>
<technique_common>
<accessor source="#Sphere01-lib-Normal0-array" count="162" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Sphere01-lib-UV0">
<float_array id="Sphere01-lib-UV0-array" count="100">
0.000000 1.000000
0.111111 1.000000
0.222222 1.000000
0.333333 1.000000
0.444444 1.000000
0.555556 1.000000
0.666667 1.000000
0.777778 1.000000
0.888889 1.000000
1.000000 1.000000
0.000000 0.777778
0.111111 0.777778
0.222222 0.777778
0.333333 0.777778
0.444444 0.777778
0.555556 0.777778
0.666667 0.777778
0.777778 0.777778
0.888889 0.777778
1.000000 0.777778
0.000000 0.555556
0.111111 0.555556
0.222222 0.555556
0.333333 0.555556
0.444444 0.555556
0.555556 0.555556
0.666667 0.555556
0.777778 0.555556
0.888889 0.555556
1.000000 0.555556
0.000000 0.333333
0.111111 0.333333
0.222222 0.333333
0.333333 0.333333
0.444444 0.333333
0.555556 0.333333
0.666667 0.333333
0.777778 0.333333
0.888889 0.333333
1.000000 0.333333
0.000000 0.111111
0.111111 0.111111
0.222222 0.111111
0.333333 0.111111
0.444444 0.111111
0.555556 0.111111
0.666667 0.111111
0.777778 0.111111
0.888889 0.111111
1.000000 0.111111
</float_array>
<technique_common>
<accessor source="#Sphere01-lib-UV0-array" count="50" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Sphere01-lib-Vertex">
<input semantic="POSITION" source="#Sphere01-lib-Position"/>
</vertices>
<polygons material="_02___Default" count="54">
<input semantic="VERTEX" offset="0" source="#Sphere01-lib-Vertex"/>
<input semantic="NORMAL" offset="1" source="#Sphere01-lib-Normal0"/>
<input semantic="TEXCOORD" offset="2" set="0" source="#Sphere01-lib-UV0"/>
<p>0 0 0 1 1 10 2 2 11</p>
<p>0 3 1 2 4 11 3 5 12</p>
<p>0 6 2 3 7 12 4 8 13</p>
<p>0 9 3 4 10 13 5 11 14</p>
<p>0 12 4 5 13 14 6 14 15</p>
<p>0 15 5 6 16 15 7 17 16</p>
<p>0 18 6 7 19 16 8 20 17</p>
<p>0 21 7 8 22 17 9 23 18</p>
<p>0 24 8 9 25 18 1 26 19</p>
<p>1 27 10 10 28 20 11 29 21</p>
<p>1 30 10 11 31 21 2 32 11</p>
<p>2 33 11 11 34 21 12 35 22</p>
<p>2 36 11 12 37 22 3 38 12</p>
<p>3 39 12 12 40 22 13 41 23</p>
<p>3 42 12 13 43 23 4 44 13</p>
<p>4 45 13 13 46 23 14 47 24</p>
<p>4 48 13 14 49 24 5 50 14</p>
<p>5 51 14 14 52 24 15 53 25</p>
<p>5 54 14 15 55 25 6 56 15</p>
<p>6 57 15 15 58 25 16 59 26</p>
<p>6 60 15 16 61 26 7 62 16</p>
<p>7 63 16 16 64 26 17 65 27</p>
<p>7 66 16 17 67 27 8 68 17</p>
<p>8 69 17 17 70 27 18 71 28</p>
<p>8 72 17 18 73 28 9 74 18</p>
<p>9 75 18 18 76 28 10 77 29</p>
<p>9 78 18 10 79 29 1 80 19</p>
<p>10 81 20 19 82 30 20 83 31</p>
<p>10 84 20 20 85 31 11 86 21</p>
<p>11 87 21 20 88 31 21 89 32</p>
<p>11 90 21 21 91 32 12 92 22</p>
<p>12 93 22 21 94 32 22 95 33</p>
<p>12 96 22 22 97 33 13 98 23</p>
<p>13 99 23 22 100 33 23 101 34</p>
<p>13 102 23 23 103 34 14 104 24</p>
<p>14 105 24 23 106 34 24 107 35</p>
<p>14 108 24 24 109 35 15 110 25</p>
<p>15 111 25 24 112 35 25 113 36</p>
<p>15 114 25 25 115 36 16 116 26</p>
<p>16 117 26 25 118 36 26 119 37</p>
<p>16 120 26 26 121 37 17 122 27</p>
<p>17 123 27 26 124 37 27 125 38</p>
<p>17 126 27 27 127 38 18 128 28</p>
<p>18 129 28 27 130 38 19 131 39</p>
<p>18 132 28 19 133 39 10 134 29</p>
<p>28 135 40 20 136 31 19 137 30</p>
<p>28 138 41 21 139 32 20 140 31</p>
<p>28 141 42 22 142 33 21 143 32</p>
<p>28 144 43 23 145 34 22 146 33</p>
<p>28 147 44 24 148 35 23 149 34</p>
<p>28 150 45 25 151 36 24 152 35</p>
<p>28 153 46 26 154 37 25 155 36</p>
<p>28 156 47 27 157 38 26 158 37</p>
<p>28 159 48 19 160 39 27 161 38</p>
</polygons>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="RootNode" name="RootNode">
<node id="Sphere01" name="Sphere01">
<matrix sid="matrix">1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 0.000000 0.000000 -1.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000</matrix>
<instance_geometry url="#Sphere01-lib">
<bind_material>
<technique_common>
<instance_material symbol="_02___Default" target="#_02___Default"/>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#RootNode"/>
</scene>
</COLLADA>

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AsteroidScript : MonoBehaviour
{
public GameObject asteroid;
// Start is called before the first frame update
void Start()
{
// set asteroid start position to a random plae to the left of mars
asteroid.transform.position = new Vector3(-500,Random.Range(-250, 250),Random.Range(-250,250));
// adding force to the asteroir
asteroid.GetComponent<Rigidbody>().AddForce(Vector3.right * 200000 * Time.deltaTime);
}
// Update is called once per frame
void Update()
{
// destroy object if it goes off the right edge of the screen
Vector3 position = Camera.main.WorldToScreenPoint(transform.position);
if (position.x > Screen.width) {
Destroy(asteroid);
}
}
// destroy asterod upon collisions
void OnCollisionEnter() {
Destroy(asteroid);
}
}

View File

@ -0,0 +1,55 @@
// Andrew Hayes, ID: 21321503
// some of the comments here are quite obvious, and are just here for my own learning purposes
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : MonoBehaviour {
// inspector settings
public GameObject mars;
public GameObject phobos;
public GameObject deimos;
public GameObject asteroid;
// speed that the camera moves around mars on arrow keypress
public float cameraSpeed = 500;
// Start is called before the first frame update
void Start() {
// set position of mars object and point camera at it
mars.transform.position = new Vector3(0,0,0);
mars.transform.rotation = Quaternion.Euler(new Vector3(270,0,0)); // make it so mars' north pole points up
Camera.main.transform.position = new Vector3(0,0,-100);
Camera.main.transform.LookAt(mars.transform);
// before this can run, you need to manually add a rigid body with 0 angular velocity and no gravity in the UI
// start mars rotating
mars.GetComponent<Rigidbody>().AddTorque(new Vector3(0,20,0));
}
void Update() {
// rotate phobos and deimos a little each frame
phobos.transform.RotateAround(mars.transform.position, Vector3.up, 32*Time.deltaTime);
deimos.transform.RotateAround(mars.transform.position, Vector3.up, 8*Time.deltaTime);
// control the camera's position using the arrow keys
if (Input.GetKey(KeyCode.LeftArrow)) {
Camera.main.transform.RotateAround(Vector3.zero, Vector3.up, cameraSpeed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.RightArrow)) {
Camera.main.transform.RotateAround(Vector3.zero, Vector3.up, -cameraSpeed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.UpArrow)) {
Camera.main.transform.RotateAround(Vector3.zero, Vector3.right, cameraSpeed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.DownArrow)) {
Camera.main.transform.RotateAround(Vector3.zero, Vector3.right, -cameraSpeed * Time.deltaTime);
}
// randomly spawn new asteroids
if (Random.Range(1,180) == 1) { // assuming Update() is called 60 times per second, want to spawn a new asteroid on average once every 3 seconds
Instantiate(asteroid); // instantiating asteroid prefab
}
}
}

View File

@ -0,0 +1,79 @@
%! TeX program = lualatex
\documentclass[a4paper, 11pt]{article}
% packages
\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[english]{babel} % Language hyphenation and typographical rules
\usepackage[final, colorlinks = false, urlcolor = cyan]{hyperref}
\usepackage{changepage} % adjust margins on the fly
\usepackage{fontspec}
\usepackage{minted}
\usepackage{xcolor}
\usepackage{pgfplots}
\pgfplotsset{width=\textwidth,compat=1.9}
\usepackage{caption}
\newenvironment{code}{\captionsetup{type=listing}}{}
\usepackage[yyyymmdd]{datetime}
\renewcommand{\dateseparator}{-}
\setmainfont{EB Garamond}
\setmonofont[Scale=MatchLowercase]{Deja Vu Sans Mono}
\usepackage{titlesec}
% \titleformat{\section}{\LARGE\bfseries}{}{}{}[\titlerule]
% \titleformat{\subsection}{\Large\bfseries}{}{0em}{}
% \titlespacing{\subsection}{0em}{-0.7em}{0em}
%
% \titleformat{\subsubsection}{\large\bfseries}{}{0em}{$\bullet$ }
% \titlespacing{\subsubsection}{1em}{-0.7em}{0em}
% margins
\addtolength{\hoffset}{-2.25cm}
\addtolength{\textwidth}{4.5cm}
\addtolength{\voffset}{-3.25cm}
\addtolength{\textheight}{5cm}
\setlength{\parskip}{0pt}
\setlength{\parindent}{0in}
% \setcounter{secnumdepth}{0}
\begin{document}
\hrule \medskip
\begin{minipage}{0.295\textwidth}
\raggedright
\footnotesize
\textbf{Name:} Andrew Hayes \\
\textbf{E-mail:} \href{mailto://a.hayes18@universityofgalway.ie}{a.hayes18@universityofgalway.ie} \hfill\\
\textbf{ID:} 21321503 \hfill
\end{minipage}
\begin{minipage}{0.4\textwidth}
\centering
\vspace{0.4em}
\Large
\textbf{CT3536} \\
\end{minipage}
\begin{minipage}{0.295\textwidth}
\raggedleft
\today
\end{minipage}
\medskip\hrule
\begin{center}
\normalsize
\textbf{Assignment 02}
\end{center}
\hrule
\begin{code}
\inputminted[texcl, mathescape, breaklines, frame=single]{csharp}{../code/GameManagerScript.cs}
\caption{\texttt{GameManagerScript.cs}}
\end{code}
\begin{code}
\inputminted[texcl, mathescape, breaklines, frame=single]{csharp}{../code/AsteroidScript.cs}
\caption{\texttt{AsteroidScript.cs}}
\end{code}
\end{document}

View File

@ -0,0 +1,57 @@
\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
\PYG{c+c1}{// Andrew Hayes, ID: 21321503}
\PYG{c+c1}{// some of the comments here are quite obvious, and are just here for my own learning purposes}
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections}\PYG{p}{;}
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections.Generic}\PYG{p}{;}
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{UnityEngine}\PYG{p}{;}
\PYG{k}{public}\PYG{+w}{ }\PYG{k}{class}\PYG{+w}{ }\PYG{n+nc}{GameManager}\PYG{+w}{ }\PYG{p}{:}\PYG{+w}{ }\PYG{n}{MonoBehaviour}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{c+c1}{// inspector settings}
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{mars}\PYG{p}{;}
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{phobos}\PYG{p}{;}\PYG{+w}{ }
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{deimos}\PYG{p}{;}
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{;}
\PYG{+w}{ }\PYG{c+c1}{// speed that the camera moves around mars on arrow keypress}
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{k+kt}{float}\PYG{+w}{ }\PYG{n}{cameraSpeed}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{l+m}{500}\PYG{p}{;}
\PYG{+w}{ }\PYG{c+c1}{// Start is called before the first frame update}
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Start}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{c+c1}{// set position of mars object and point camera at it}
\PYG{+w}{ }\PYG{n}{mars}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{);}
\PYG{+w}{ }\PYG{n}{mars}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{rotation}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Quaternion}\PYG{p}{.}\PYG{n}{Euler}\PYG{p}{(}\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{270}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{));}\PYG{+w}{ }\PYG{c+c1}{// make it so mars' north pole points up}
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{,}\PYG{o}{\PYGZhy{}}\PYG{l+m}{100}\PYG{p}{);}
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{LookAt}\PYG{p}{(}\PYG{n}{mars}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{);}
\PYG{+w}{ }\PYG{c+c1}{// before this can run, you need to manually add a rigid body with 0 angular velocity and no gravity in the UI}
\PYG{+w}{ }\PYG{c+c1}{// start mars rotating }
\PYG{+w}{ }\PYG{n}{mars}\PYG{p}{.}\PYG{n}{GetComponent}\PYG{o}{\PYGZlt{}}\PYG{n}{Rigidbody}\PYG{o}{\PYGZgt{}}\PYG{p}{().}\PYG{n}{AddTorque}\PYG{p}{(}\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{l+m}{0}\PYG{p}{,}\PYG{l+m}{20}\PYG{p}{,}\PYG{l+m}{0}\PYG{p}{));}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Update}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{c+c1}{// rotate phobos and deimos a little each frame }
\PYG{+w}{ }\PYG{n}{phobos}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{mars}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{up}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{32}\PYG{o}{*}\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{n}{deimos}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{mars}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{up}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{8}\PYG{o}{*}\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{c+c1}{// control the camera's position using the arrow keys}
\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{Input}\PYG{p}{.}\PYG{n}{GetKey}\PYG{p}{(}\PYG{n}{KeyCode}\PYG{p}{.}\PYG{n}{LeftArrow}\PYG{p}{))}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{zero}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{up}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{cameraSpeed}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{n+nf}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{Input}\PYG{p}{.}\PYG{n}{GetKey}\PYG{p}{(}\PYG{n}{KeyCode}\PYG{p}{.}\PYG{n}{RightArrow}\PYG{p}{))}\PYG{+w}{ }\PYG{p}{\PYGZob{}}\PYG{+w}{ }
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{zero}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{up}\PYG{p}{,}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{n}{cameraSpeed}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{n+nf}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{Input}\PYG{p}{.}\PYG{n}{GetKey}\PYG{p}{(}\PYG{n}{KeyCode}\PYG{p}{.}\PYG{n}{UpArrow}\PYG{p}{))}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{zero}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{right}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{cameraSpeed}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{k}{else}\PYG{+w}{ }\PYG{n+nf}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{Input}\PYG{p}{.}\PYG{n}{GetKey}\PYG{p}{(}\PYG{n}{KeyCode}\PYG{p}{.}\PYG{n}{DownArrow}\PYG{p}{))}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{RotateAround}\PYG{p}{(}\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{zero}\PYG{p}{,}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{right}\PYG{p}{,}\PYG{+w}{ }\PYG{o}{\PYGZhy{}}\PYG{n}{cameraSpeed}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{c+c1}{// randomly spawn new asteroids}
\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{l+m}{1}\PYG{p}{,}\PYG{l+m}{180}\PYG{p}{)}\PYG{+w}{ }\PYG{o}{==}\PYG{+w}{ }\PYG{l+m}{1}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}\PYG{+w}{ }\PYG{c+c1}{// assuming Update() is called 60 times per second, want to spawn a new asteroid on average once every 3 seconds}
\PYG{+w}{ }\PYG{n}{Instantiate}\PYG{p}{(}\PYG{n}{asteroid}\PYG{p}{);}\PYG{+w}{ }\PYG{c+c1}{// instantiating asteroid prefab}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{Verbatim}

View File

@ -0,0 +1,36 @@
\begin{Verbatim}[commandchars=\\\{\},codes={\catcode`\$=3\catcode`\^=7\catcode`\_=8\relax}]
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections}\PYG{p}{;}
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{System.Collections.Generic}\PYG{p}{;}
\PYG{k}{using}\PYG{+w}{ }\PYG{n+nn}{UnityEngine}\PYG{p}{;}
\PYG{k}{public}\PYG{+w}{ }\PYG{k}{class}\PYG{+w}{ }\PYG{n+nc}{AsteroidScript}\PYG{+w}{ }\PYG{p}{:}\PYG{+w}{ }\PYG{n}{MonoBehaviour}
\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{k}{public}\PYG{+w}{ }\PYG{n}{GameObject}\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{;}
\PYG{+w}{ }\PYG{c+c1}{// Start is called before the first frame update}
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Start}\PYG{p}{()}
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{c+c1}{// set asteroid start position to a random plae to the left of mars}
\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{.}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{k}{new}\PYG{+w}{ }\PYG{n}{Vector3}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m}{500}\PYG{p}{,}\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m}{250}\PYG{p}{,}\PYG{+w}{ }\PYG{l+m}{250}\PYG{p}{),}\PYG{n}{Random}\PYG{p}{.}\PYG{n}{Range}\PYG{p}{(}\PYG{o}{\PYGZhy{}}\PYG{l+m}{250}\PYG{p}{,}\PYG{l+m}{250}\PYG{p}{));}
\PYG{+w}{ }\PYG{c+c1}{// adding force to the asteroir}
\PYG{+w}{ }\PYG{n}{asteroid}\PYG{p}{.}\PYG{n}{GetComponent}\PYG{o}{\PYGZlt{}}\PYG{n}{Rigidbody}\PYG{o}{\PYGZgt{}}\PYG{p}{().}\PYG{n}{AddForce}\PYG{p}{(}\PYG{n}{Vector3}\PYG{p}{.}\PYG{n}{right}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{l+m}{200000}\PYG{+w}{ }\PYG{o}{*}\PYG{+w}{ }\PYG{n}{Time}\PYG{p}{.}\PYG{n}{deltaTime}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{c+c1}{// Update is called once per frame}
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{Update}\PYG{p}{()}
\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{c+c1}{// destroy object if it goes off the right edge of the screen}
\PYG{+w}{ }\PYG{n}{Vector3}\PYG{+w}{ }\PYG{n}{position}\PYG{+w}{ }\PYG{o}{=}\PYG{+w}{ }\PYG{n}{Camera}\PYG{p}{.}\PYG{n}{main}\PYG{p}{.}\PYG{n}{WorldToScreenPoint}\PYG{p}{(}\PYG{n}{transform}\PYG{p}{.}\PYG{n}{position}\PYG{p}{);}
\PYG{+w}{ }\PYG{k}{if}\PYG{+w}{ }\PYG{p}{(}\PYG{n}{position}\PYG{p}{.}\PYG{n}{x}\PYG{+w}{ }\PYG{o}{\PYGZgt{}}\PYG{+w}{ }\PYG{n}{Screen}\PYG{p}{.}\PYG{n}{width}\PYG{p}{)}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{n}{Destroy}\PYG{p}{(}\PYG{n}{asteroid}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{+w}{ }\PYG{c+c1}{// destroy asterod upon collisions}
\PYG{+w}{ }\PYG{k}{void}\PYG{+w}{ }\PYG{n+nf}{OnCollisionEnter}\PYG{p}{()}\PYG{+w}{ }\PYG{p}{\PYGZob{}}
\PYG{+w}{ }\PYG{n}{Destroy}\PYG{p}{(}\PYG{n}{asteroid}\PYG{p}{);}
\PYG{+w}{ }\PYG{p}{\PYGZcb{}}
\PYG{p}{\PYGZcb{}}
\end{Verbatim}

View File

@ -0,0 +1,102 @@
\makeatletter
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
\let\PYG@ul=\relax \let\PYG@tc=\relax%
\let\PYG@bc=\relax \let\PYG@ff=\relax}
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
\PYG@tok{#1}\expandafter\PYG@toks\fi}
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
\PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
\@namedef{PYG@tok@c}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}}
\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@kp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@kt}{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}
\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@nf}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.80,0.25,0.22}{##1}}}
\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@no}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
\@namedef{PYG@tok@nl}{\def\PYG@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}}
\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}}
\@namedef{PYG@tok@nt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@nd}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
\@namedef{PYG@tok@s}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@sd}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@si}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}}
\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@m}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}}
\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}}
\@namedef{PYG@tok@ge}{\let\PYG@it=\textit}
\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf}
\@namedef{PYG@tok@ges}{\let\PYG@bf=\textbf\let\PYG@it=\textit}
\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
\@namedef{PYG@tok@err}{\def\PYG@bc##1{{\setlength{\fboxsep}{\string -\fboxrule}\fcolorbox[rgb]{1.00,0.00,0.00}{1,1,1}{\strut ##1}}}}
\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.50,0.00}{##1}}}
\@namedef{PYG@tok@fm}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,1.00}{##1}}}
\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@vg}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
\@namedef{PYG@tok@sa}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@sb}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@dl}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@s2}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@sh}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@s1}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.13,0.13}{##1}}}
\@namedef{PYG@tok@mb}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@mf}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@mh}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@mi}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@il}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@mo}{\def\PYG@tc##1{\textcolor[rgb]{0.40,0.40,0.40}{##1}}}
\@namedef{PYG@tok@ch}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PYG@tok@cm}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PYG@tok@cpf}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PYG@tok@c1}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\@namedef{PYG@tok@cs}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor[rgb]{0.24,0.48,0.48}{##1}}}
\def\PYGZbs{\char`\\}
\def\PYGZus{\char`\_}
\def\PYGZob{\char`\{}
\def\PYGZcb{\char`\}}
\def\PYGZca{\char`\^}
\def\PYGZam{\char`\&}
\def\PYGZlt{\char`\<}
\def\PYGZgt{\char`\>}
\def\PYGZsh{\char`\#}
\def\PYGZpc{\char`\%}
\def\PYGZdl{\char`\$}
\def\PYGZhy{\char`\-}
\def\PYGZsq{\char`\'}
\def\PYGZdq{\char`\"}
\def\PYGZti{\char`\~}
% for compatibility with earlier versions
\def\PYGZat{@}
\def\PYGZlb{[}
\def\PYGZrb{]}
\makeatother