How do I find what i'm looking for

Get help using Construct 2

Post » Sat Sep 20, 2014 9:22 pm

I'm looking for an example of a simple battle/fight system. I don't know exactly what to search for and the words i've used haven't helped. I have the hero and 1 monster at a time that I want to exchange damage. The system I have made works but starts as soon as the layout begins and I don't want it to start until the attack button is pressed or monster attacks. I also want to be able to stop the fight at any time and run away without a new monster spawning. Any suggestions or pointers to tutorials or capx would be very helpful
You do not have the required permissions to view the files attached to this post.
B
6
S
1
Posts: 36
Reputation: 452

Post » Sun Sep 21, 2014 1:48 am

Use a global variable: myVariable = 0 ; when attack button pressed or monster attacks set myVariable to 1

Under the condition that myVariable = 1 - Start Game [Run the events that start your game]

-

To stop the fight & run away without a new monster spawning: Use a global variable; On start of layout myVariable = 0

Add myVariable = 0 to the condition you already set for the monsters to spawn.

If monsters (INVERT)-Is on screen - set myVariable to 1
If monsters Is on screen - set myVariable to 0

To assure that monsters spawn when/where you want them to & there aren't any already on screen: clone your monster & set spawning events accordingly, i.e if myVariable= 0 & when you reach a certain point in the layout - you can use an invisible sprite to represent that "certain point" spawn monsters.
or on collision with "certain point" set myVariable to 0 and spawn monsters accordingly based on is/isn't on screen.
B
6
S
2
Posts: 151
Reputation: 1,366

Post » Sun Sep 21, 2014 4:04 am

ok thanks and that makes sense once it was pointed out to me. I was trying to figure out a way to use a function and wasn't thinking about globals as an answer.
B
6
S
1
Posts: 36
Reputation: 452

Post » Sun Sep 21, 2014 4:57 am

Yeah no prob, good luck !
B
6
S
2
Posts: 151
Reputation: 1,366


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 12 guests