How do I make my Buttons work?

Just started using Construct 2? Post your questions here

Post » Wed Apr 26, 2017 10:32 am

I have some buttons and i want to not let my player shoot a bullet, when i click on a button.
I have tried something and i'd like to also be able to shoot, when i scroll off the button. xD
Some Random white coloured message to find out by you ♥
B
6
S
1
Posts: 14
Reputation: 378

Post » Wed Apr 26, 2017 8:46 pm

Hi, u can use groups or a variable to make it work.

Enable / disable groups or
Shoot variable
When u click on button "A" if variable "shoot" is = 0 then shoot
When u click on button "B" set value to variable "shoot" = 1

Cheers.
https://www.facebook.com/TeslaPCgames

https://www.twitter.com/TeslaPCGames

[email protected]

http://www.synergy-studios.net
B
39
S
20
G
58
Posts: 111
Reputation: 32,168

Post » Thu Apr 27, 2017 2:03 pm

Message: KittenKatja can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I have CanShoot by default to 1 for "true" and 0 for "false".
I made the mouse go over another object to make CanShoot false.
I made a sub event of the same thing and inverted it, but it doesn't work.
http://imgur.com/a/qbDGu
B
6
S
1
Posts: 14
Reputation: 378

Post » Thu Apr 27, 2017 9:32 pm

Isnt a sub event. Try this

Image
https://www.facebook.com/TeslaPCgames

https://www.twitter.com/TeslaPCGames

[email protected]

http://www.synergy-studios.net
B
39
S
20
G
58
Posts: 111
Reputation: 32,168

Post » Fri Apr 28, 2017 8:01 am

Ok thx, but for what are sub events for? xD
B
6
S
1
Posts: 14
Reputation: 378

Post » Fri Apr 28, 2017 8:18 am

Ex on touched sprite 1 do x
Sub event sprite animationframe = 1 do x
Sub event sprite animationframe = 2 do x
Sub event sprite animationframe = 3 do x

x = an action.
https://www.facebook.com/TeslaPCgames

https://www.twitter.com/TeslaPCGames

[email protected]

http://www.synergy-studios.net
B
39
S
20
G
58
Posts: 111
Reputation: 32,168

Post » Sat Apr 29, 2017 12:03 am

So sub events are ONLY for sprite animations?
Wow, pretty useless in to me right now...
B
6
S
1
Posts: 14
Reputation: 378

Post » Sat Apr 29, 2017 7:42 am

KittenKatja wrote:So sub events are ONLY for sprite animations?


No, sub-events can be for pretty much anything, they just happen after the main event has been checked and is true. They are often used where there is something in common that you could check first.

For example, you might need to check lot's of different things, but only when an object is on screen. Instead of lot's of separate events that each check Is On Screen as one of their conditions, you could do Is On Screen as the main event, and then make all the other events sub-events of that.
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,780

Post » Sat Apr 29, 2017 12:48 pm

Thx :3
B
6
S
1
Posts: 14
Reputation: 378


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest