You are on page 1of 90

DOUBLE

CLICK
UNITY.EXE
TO OPEN
UNITY

NOW CLOSE THE


WELCOME WINDOW
TO CONTINUE

OPEN NEW
PROJECT

Now name
your project
and create it

NEW WINDOW WILL


NAMED AFTER YOU
CREATE IT

ON PROJECT WINDOW
MOUSE RIGHT CLICK > CREATE >
JAVASCRIPT

NOW NAME IT PLAYER

SELECT PLAYER AND PRESS CTRL+D 4 TIMES TO MAKE COPIES

NAME EACH OF IT
RESPECTIVELY
1. ENEMY
2. LOSE
3. MAINMENU
4. WIN

NAME IT LIKE THIS

RIGHT CLICK ON PROJECT


WINDOW CREATE>FOLDER AND
NAMED IT SCRIPTS

NOW PUT SCRIPTS FILES INTO SCRIPTS FOLDER THAT WE CREATED

IN HIERARCHY WINDOW
RIGHT MOUSE BUTTON > 3D OBJECT > CUBE

NAME IT ENEMY1

CUBE OBJECT WILL APPEAR LIKE THIS

IN HIERARCHY WINDOW
RIGHT MOUSE BUTTON > 3D OBJECT > SPHERE

NAME IT ENEMY2

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE > PREFAB
AND NAME IT ENEMY1

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE > PREFAB
AND NAME IT ENEMY2

NOW DRAG AND DROP THE HIERARCHY


WINDOW OBJECT INTO PROJECT WINDOW
PREFAB ACCORDING TO THEIR NAME

NOW DELETE THESE

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE > FOLDER
AND NAME IT PREFAB

DRAG AND DROP BOTH PREFAB INTO PREFAB FOLDER

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE > MATERIAL
AND NAME IT ENEMY1

NOW SELECT ENEMY1 MATERIAL THEN PRESS


CTRL+D TO MAKE COPY

NOW NAME IT ENEMY2

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE > FOLDER
AND NAME IT MATERIAL

NOW DRAG THE MATERIAL IN MATERIAL FOLDER

DRAG AND DROP EACH MATERIAL INTO THEIR RESPECTIVE NAME PREFAB

DRAG AND DROP EACH MATERIAL INTO THEIR RESPECTIVE NAME


PREFAB

NOW GO TO THE GAME OBJECT


OPTION TO CREATE PARTICLE

EXPLOSION

SYSTEM FOR
EFFECT

RENAME IT TO
EXPLOSION

NOW WE ADD MORE COMPONENT IN


EXPLOSION, FOR THIS GO TO

ADD

COMPONENT IN
INSPECTOR WINDOW

ADD COMPONENT > EFFECTS > LEGACY PARTICLES

ADD COMPONENT > EFFECTS > LEGACY PARTICLES > ELLIPSOID


PARTICLE EMITTER

ADD COMPONENT > EFFECTS > LEGACY PARTICLES > PARTICLE


ANIMATOR

ADD COMPONENT > EFFECTS > LEGACY PARTICLES > PARTICLE


RENDERER

NOW EXPLOSION LOOKS LIKE THIS

NOW CHANGE
THE VALUE OF
RND VELOCITY
0 TO 2

CHECK ALL THESE BOX

CHECK THIS BOX

IN PROJECT WINDOW
CLICK PREFAB FOLDER >RIGHT
MOUSE CLICK > CREATE >
PREFAB
AND NAME IT EXPLOSION

CHANGE THE VALUES


DRAG AND DROP EXPLOSION FROM
HIERARCHY WINDOW TO EXPLOSION
PREFAB

IN PROJECT WINDOW
RIGHT MOUSE CLICK > CREATE >
FOLDER
AND NAME IT SOUND

DRAG AND DROP SOUND FILE TO SOUND FOLDER

GoTo File > New Scene

Now change the camera view from Perspective > Orthographic

Put these two prefab


in to Hierarchy
window

Now select enemy prefab


and change the position Y 0
>2

Select Main Camera then


Change the value of FAR 1000
> 20

Now delete
these tow
Prefab again

Save the
scene now
and name it
mainmenu

Saved scene will appear


like this then make 3 more
copies by pressing
CRTL+D button

Rename these 3 copies like this


1. Lose
2. Win
3. Level1

mainmenu scene

Load the
then drag the main menu script and
drop over main camera

Script will appear in Inspector view

lose scene

Load the
then drag the lose script and
drop over main camera

win scene

Load the
then
drag the win script and drop over
main camera

2 Drag the
enemy1 and 2
from prefab to
Hierarchy

1 load the scene level1

Select enemy2 and


change the position Y
from 0 to 2

NOW ADD DIRECTIONAL LIGHT

SET THE POSITION OF LIGHT

Now we create a
Player object for
that GoTo
GameObject >
Create Empty and
Name it

Player

Drag and drop player


script into player
object

Scripts will open in MonoDevelop

Pas
t

Copy

Copy
Paste

Paste
Copy

Paste
Copy

Paste
Copy

Now put enemy script


into enemy prefab

It time to place
player script into
Player object

Change size for color appearances

Drab and drop explosion into Inspector explosion

Repeat both these step for enemy1

Select Add
Tag

And put the name enemy


NOW CHANGE
SIZE TO 2
DEPENDS ON
YOUR ENEMY

Select explosion from prefab


folder drag and drop sound
file in explosion

Change
Tag Name
to enemy
Ray
distance
to 100

It time to build the game for that go to

> Build Settings

File

Now add these scene to the


build settings