Table of Contents

This lesson focuses on teaching the very basics of the engine: creating objects, running the game, basic commands, searching, and manipulating objects by scaling, rotating, translating.

Learning Objectives

  • Game object creation
  • Game object names
  • Editor commands
  • Object manipulation with editor tools

Level Setup

  • Command : New Project
  • Create a new project using the {nav icon=clone, name=Empty 2D Project} template

Here is a new empty level:

image

An "empty" 2D level

Notice that the level isn't actually empty. A quick look into the Objects Window shows us that the level has a few game objects already in it.

image

The Objects Window showing the objects present in the otherwise-empty level

We'll cover these in more detail in future tutorials.

Create a Game Object

CreateSprite

Creating a Sprite object via the Create Menu

The Sprite object object can now be found in the Objects Window:

image

The Sprite object listed in the Objects Window

NOTE: If the Properties Window is not visible, then enter the Command : Properties in the Search Window. (Remember you can open the Search Window from any where in the engine using Ctrl + Shift + Space.)

The properties of the Transform component attached to the object can be found in the Properties Window:

image

The properties of the Sprite object in the Properties Window

  • In the Properties Window
  • Click on the Transform component

Under

Expanding the Transform component in the Properties Window

(NOTE)Under: When accessing properties of a paticular component we use the term Under, as the properties are found under the component title in the Properties Window. For instance, Under the Transform component {icon long-arrow-right} //Set Scale to [2, 2, 1]//.

Renaming an Object

  • Select : Sprite object
  • In the Properties Window
  • Rename Sprite object to Square

image

Renaming the Sprite object

Here is how the game should look:

image

The Game Window

Tools

To help you create and manipulate objects, Zilch Engine provides tools that can be found at the top of the editor window within the Tool Bar.

image

Let's take a look at some of the more common tools:

Select Tool

The Select Tool allows you to select objects in the Level Window by clicking on them.

  • In the Tool Bar
  • Click the image button
  • In the Level Window
    • Click on the Sprite object object

Select

This is an equivalent operation of selecting the object in the Objects Window

Translate Tool

The Translate Tool is used to move objects around the level.

  • In the Tool Bar
  • Click the translategizmo button

You should see colored arrows along the X (red), Y (green), and Z (blue) axes of the object.

  • Click and drag the colored arrows to move the object along the corresponding axes.

Translate

Notice that in the Properties Window, the Translation values are changing while you move the object.

Rotate Tool

The Rotate Tool is used to rotate objects.

  • In the Tool Bar
  • Click the rotategizmo button
  • Click and drag one of the circles (red, blue, or green).

Rotate

This rotates the object around its X (red), Y (green), or Z (blue) axes. In 2D, we usually just rotate around the Z-axis. Notice that in the Properties Window, the Rotation values are changing while you rotate the object.

Scale Tool

The Scale Tool is used to scale objects.

  • In the Tool Bar
  • Click the scalegizmo button
  • Click and drag along the colored axes

This scales the object along its X (red), Y (green), or Z (blue) axis.

Scale

Notice that in the Properties Window, the Scale values are changing while you scale the object.

NOTE: Zilch Engine does not support negative scale for objects.

Related Materials

Manual

Code Reference