2019-06-01 net

(Brent) #1

PROJECTS
Unity


UNITY


2D side-scrolling background and moving ground
with real physics. You’ll learn how to add your
character and control its flight with user input. You’ll
build the project, export it for WebGL and be able to
run your new game in a web browser.
To get started, download and install the Unity
development tools. This will include Visual Studio for
editing your C# code. Unity is available for free here:
https://unity3d.com/

STEP 1: CREATE UP A NEW PROJECT
Open up Unity and create a new project. Call it
anything you like and save it somewhere you can
easily find – ideally, inside your local web server. I
called mine ‘Planes’.

STEP 2: GET SET UP
When you create your project you can select 2D or 3D.
If you choose 3D, be sure to set your camera type to
Orthographic and not Perspective. You can do that

DEVELOP A WEBGL GAME


WITH UNIT Y – PART 1


Richard Mattka continues his series on Unity WebGL by showing how you


can use Unity to create a 2D side-scroller game that runs in the browser


Building for WebGL from Unity publishes your
scenes and C# code as JavaScript using HTML5
technologies, along with the WebGL rendering AP, so
a project can run in any browser supporting WebGL.
An interface class also enables communication
between JavaScript and the WebGL app.
One of the biggest advantages to using Unity
for development is the ‘build once, deploy many’
approach. Mastering the skills of game or film
development in Unity enables you to target desktop,
gaming consoles, mobile devices and the web. There
are limits to mobile ‘web’ development but not
mobile ‘native OS’ development, which enables you
to deploy to mobile as well.

TUTORIAL: BUILD A WEBGL GAME
In this tutorial, you’ll create the first version of a
simple WebGL game created in Unity. You’ll build a
scene, work with the 2D orthographic camera and
add 2D sprites. You’ll learn how to create an endless

ABOUT THE AUTHOR
RICHARD MATTKA
w: richardmattka.com
t: @synergyseeker
job: Creative director,
designer, developer
areas of expertise:
Shaders, VFX, WebGL
Free download pdf