How do I activate power button

Get help using Construct 2

Post » Tue Feb 10, 2015 3:37 am

Im working on a game, in that game the player (nanomachine) have to destroy some viruses and bacteria, (sprites) there other good sprites, like red and white blood cells, first is for defense, and the second for the power.

How I do to activate a power button to use, when the nanomachine capture enough white blood cells?

Example, the game star with 0 on power variable, the nanomachine need capture 10 white blood cell to active the power button and can use.

one screen...
for now im using the variable like text...
You do not have the required permissions to view the files attached to this post.
B
3
Posts: 4
Reputation: 183

Post » Tue Feb 10, 2015 3:59 am

Just create your button with a Compare variable condition in its events.
Image
B
16
S
7
Posts: 126
Reputation: 1,920

Post » Tue Feb 10, 2015 11:42 am

Can be more specific, please :)
B
3
Posts: 4
Reputation: 183

Post » Tue Feb 10, 2015 11:58 am

Kaamos, please run through tutorials. This is a most basic question.

There should be two states for the power button: active and inactive. The power button sprite should have a boolean variable.

In the event sheet, create a variable (or make a sprite variable) called something like "power" and every time you get a white blood cell, add 1 to power. After it reaches 10, allow it to be activated, similar to this:

If power < 10, spritePowerOn is inactive
If power >= 10, spritePowerOn is active

I'm not going to explain further, you should know what to do with this information. Again this is a very simple to accomplish task. Little hint: you probably have less sprites/variables than you need, so write the ONE process down on paper and organize it from "do this first, then this, then this" etc. If you ever say "randomly put here" or "slow down to whatever" that should be a HUGE sign you need a variable somewhere to handle those randoms, or those speed references, etc.
B
27
S
6
G
6
Posts: 267
Reputation: 3,750

Post » Tue Feb 10, 2015 4:02 pm

Ok, Thanks for the advice, i will see the tutorials
B
3
Posts: 4
Reputation: 183


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 8 guests