How do I activate power button

  • 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...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Just create your button with a Compare variable condition in its events.

  • Can be more specific, please

  • 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.

  • Ok, Thanks for the advice, i will see the tutorials

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)