Add timer with constructor 2

0

Stats

2,604 visits, 3,144 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 12 Aug, 2017. Last updated 19 Feb, 2019

Introduction:

The Constructor is based on the 2D game creation, without using game codings. The Game development is similar to time necessary to make your ideas into reality, they are initial some concept that must be followed on game creation.

• It should be very user friendly.

• It must have lot of export options.

• It should be fairly inexpensive.

• It must be able to make your creation into reality.

Requirements:

1. First install the constructor-2(free edition)

2. Get licence for construct-2

3. Collect the game object(online-sprite)

Overview:

In this article, the concept is on based of adding the timer with constructor.

=>click->new. select NEW-> new empty project.

Step1:

Change the active layer to main by clicking on the Main layer in the layer bar, and then, insert a new text object. Change the name of the object to something you want. Because, Although it can be changed later on, it is a good practice to change it first before adding the game object so that you don't have two objects with similar names.

Step2:

To change the size of a text, you will change the Font property on the Text object. When you click on the Font property, you will see a small box with three dots on it, clicking on this will open a window where you can change the font. Insert text object: (score)

Step1:

Before same concepts following change the active layer to main by clicking on the Main layer in the layer bar, and then, insert a new text object. Change the name of the object to something you want score object.

Step2:

To change the size of a text, after change the text name (score.) you will change the Font property on the Text object. When you click on the Font property,

Step3:

To create a global variable, just right-click in an event sheet and select Add global variables. After that, you will see a new window to add a global variable, this global variables assign the Timer.

S

step4:

Create a new text Score object add global variables, when either game Time is below 10 or when the player's life is equal to or less than 1. So, we will add an action to two events. Change add global variables

1. Initial name

2. Type

3. Initial value

4. Description(option)

After, open the event sheets Right-Click.

Steps

1. timer-text

2. set text

3. parameters name(“Time”& timer)

4. Done.

Step5:

Add event Click-on, Open

1. System

2. Every X-seconds

3. Interval(seconds)current value change

4. Done

Step6:

Event sheet: ->Add events->System

1. Subtract from

2. Variables default timer change(score)

3. Value 1

4. Done.

Step7

Make the state have an effect, you will make another event, This new event will set the Score text, if the state value is Every X seconds consider

Conditions:

1. Score-text

2. Text(“Score”& score)

3. Set Every X seconds

4. Done

       
      

Step 8:

Variables (timer) assigned, when either game Time is below 1 or when the player's life is equal to or less than 0. So, we will add an action to one events condition of restart layout. You can be see that following all events clear to understand screenshot.

     

Run Layout:

Finally, your project are run.

CONCLUSION:

This following article, we have seen in concept of adding timer with constructor, you can event do loud more changes in this further articles will be discussed about create android game build constructor 2, Thank you reading article.

  • 0 Comments

Want to leave a comment? Login or Register an account!