RPG Part (6)

2

Index

Attached Files

The following files have been attached to this tutorial:

.capx

Stats

5,174 visits, 10,858 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 17 Dec, 2015. Last updated 19 Feb, 2019

For our Enemy we will need 2 Instance Variables;

That’s done open your

Enemy Events

and add these lines

If you study these lines it will be understandable what we are asking Construct 2 to do?

Remember we created instance variable

Enemy_Health = 16

Enemy_State = IDLE

We will put into

practice

below:

Now we must check for our player Knife has

hit the Enemy?

Now we cannot have only one ENEMY, let’s spawn more for our player to enjoy himself or her. Create sprite 32 x 32 and leave it BLANCK and name it

spr_Enemyspawn

Now add lines below:

As you can see I have used CHOOSE (This is same as randomly selected seconds). It is entirely up to you but I like this method because player will never know when new Enemy being spawn. So our player will not be ready to shoot or aware of it.

Now if you RUN and test it you will notice that enemy health bar is not spawn with our Enemy. Here is how you accomplish this select both Enemy and health bar than scroll down in property and click on create container. This will accomplish our goal.

Now we will add sprite and name it spr_Items

ID_1

ID_2

Add Instance Variable below

Item_ID = 0

  • 2 Comments

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