player chooses to attack

Get help using Construct 2

Post » Fri Jun 29, 2012 4:48 pm

hello good morning as dawn across the continent,

I keep wanting to further my project.

the situation is as follows:

1. a gate of fire, to cross it must destroy it with water.
2. a water gate to cross it must destroy it with fire.

how could it,
so my player can switch element.
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Post » Fri Jun 29, 2012 4:58 pm

All you need for that is a variable to keep track of which element your character is using.

E.g if the variable is 0, the attack is fire. If it's 1, the attack is water. Then you just need a keypress event or some other way to switch between them.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 29, 2012 5:21 pm

[QUOTE=Nimtrix] All you need for that is a variable to keep track of which element your character is using.

E.g if the variable is 0, the attack is fire. If it's 1, the attack is water. Then you just need a keypress event or some other way to switch between them.[/QUOTE]


mmm and how do I choose if 1, or 0 ... or power whatsoever.
I mean, which is recognized as command use, and as 0 to 1 exchange?
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Post » Fri Jun 29, 2012 5:26 pm

I am very sad with you, but I could help with an example
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Post » Fri Jun 29, 2012 5:29 pm

Depends. Are you using a global variable or an instance variable assigned to the player character? In any case, the action you would want is "Set instance variable" or "Set global variable".

If you don't know how to create those or where to find them, I would highly suggest going through the Getting Started Tutorial first. Also, the Manual holds an incredible wealth of information on all the features of Construct 2.
B
58
S
20
G
7
Posts: 305
Reputation: 8,804

Post » Fri Jun 29, 2012 5:31 pm

if I understand what part of the manual, except that I have to deal with bad translations, and I'm from Colombia and only speak Spanish.
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Post » Fri Jun 29, 2012 5:34 pm

The easiest way is give us the capx, and we'll fix it for you.
B
19
S
5
Posts: 51
Reputation: 1,883

Post » Fri Jun 29, 2012 5:40 pm

Here's a quick .capx for you, hope it helps:

VariableElements.capx (r95)

I used a global text instead of a number to make it easier to illustrate what's happening.
B
27
S
8
G
8
Posts: 903
Reputation: 8,452

Post » Fri Jun 29, 2012 5:45 pm

[QUOTE=hylists] The easiest way is give us the capx, and we'll fix it for you.[/QUOTE]

http://dl.dropbox.com/u/85024272/powerDoor.capx

this is my .capx
see doors and player
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Post » Fri Jun 29, 2012 5:46 pm

[QUOTE=Nimtrix] Here's a quick .capx for you, hope it helps:

VariableElements.capx (r95)

I used a global text instead of a number to make it easier to illustrate what's happening.[/QUOTE]

tks!!
B
12
S
4
G
4
Posts: 138
Reputation: 3,710

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 16 guests