Exercise #1
Fun with the tools and
beginning scripting
Due
time: Please refer to our
course web-site
In this programming assignment, we familiarize with the learning tool, Unity, that we will be using for the rest of this quarter and begin experimenting with controlling of the main hero object. You should also use this opportunity to:
Most of the time should be spent on asking and looking for
answers to:“how
do I make Unity do …”Let me know if this is not true.
Unity specific skills you will need,
practice, and demonstrate include:
·
Github
o
Branch
for your local copy
o
Learn
that to save a Unity Project, you
only need the following folders
§
Assets, Packages, ProjectSettings, UserSettings
§
There
is no reason to push the other folders to Github (or
to submit these)
·
Library,
Temp, Logs, obj, .vs
·
Note,
if you try to push the Library folder, Github will
fail!
·
Basic
o
Open
and work with the Unity editor
o
Setup
for 2D camera, including setting world size
o
Build
to EXE and WebGL
o
Hosting
of a WebGL game [optional]
·
User
Interaction
o
Polling
of keyboard states
·
Unity
Objects
o
Work
with textures, creation of 2D sprite objects
o
Attach
Scripts (MonoBehavior objects) to GameObjects
o
Work
with the Transform object to modify object position and size
Please refer to my attempt at the solution (links are
available off course page). Take note that it can take a significant amount of
time to build your game from the Unity editor. E.g., I think it took somewhere
between 10 to 20 minutes to build the WebGL version of the game. Remember to
always reserve time for building your games for submission. Note, you
need to build and submit only the PC-EXE version.
With the world height of 50-unit, you must support the following:
·
Height
of 50 (Total world height is 100)
·
Four
objects
o
Located
at: (1, 1), (-1, 1), (1, -1) and (-1, -1)
o
All
with size 1.0
·
Up/Down-arrow
keys
o
Objects
Positions
§
Move,
by the same amount, all four objects away from or towards the origin along each
object’s 45-degree trajectory.
§
Each
object’s x/y position must be kept in the ranges of:
·
(1,
1) to (50, 50)
·
(-1,
1) to (-50, 50)
·
(1,
-1) to (50, -50)
·
(-1,
-1) to (-50, -50)
o
Objects
Sizes
§
All
four objects size increased/decreased by 10% of Input.GetAxis(“Vertical”), this is to say:
// Note, Input.GetAxis(“Vertica”)
cab be negative
float s = Input.GetAxis(“Vertical”) *
0.1f;
Vector3 size = new Vector3(s, s, s);
object.transform.scale +=
size
·
Q-key:
o
Quits the application
Your submission must consist of two parts:
i. A zip file name, YouNameEX1.zip, containing
§
Your entire project, every file in the following
folders: Assets, Packages,
ProjectSettings,
UserSettings and
no
more!
i. Make sure you remove useless folders and files before the submission.
ii. Make sure you do not remove anything useful
iii. Make sure after removing files, you can still open your project!
b. A
separate
folder containing the PC-EXE
build of your project. We will double click on the exe file to run your
project.
·
(10%)
Camera Setting
o Height of 50
·
(30%)
Up/Down Arrow Keys: Position
o (10%) Up-arrow move objects
along 45-degree away from origin
o (10%) Down-arrow move objects
along 45-degree towards origin
o (10%) Object’s
positions between +-1 and +-50
·
(30%)
Up/Down Arrow Keys: Scale
o (10%) Up-arrow scales object
size up gradually
o (10%) Down-arrow scales
object size down gradually
o
(10%) Object’s size between 1 and about 6
·
(10%)
Q-key to quit application
· (20%) Proper zip submission
o (10%) Submission with a zip
§
Unzip
and run in the editor properly
§
Source
code include the proper folders
§
Please
remember to delete the rest of the files/folders (especially the Library folder, which can be
re-generated at run time).
o (10%) Submission include an
EXE folder
§
Double
click to run the game
This is a single-person assignment.