newbie question

0 favourites
  • 7 posts
From the Asset Store
Logo Quiz with 150 prepared logos and answers, automatic question and answer mixing
  • hello,

    just new to the program and love it !!!!

    I'm trying different thing lo learn and i'm stuck on one:

    I want the monster to get more difficult to kill everytime i kill 5 of them...

    made a random generator for spawn monster

    made a global variable Kill = 0

    monster instance variable Health = 1

    bullet on colision with monster - monster substract 1 from health

                                    - system add 1 to Kill

                                    - monster destroy

    system Kill (greater or equal) 5 - monster set Health to 2

    monster health ( less or equal ) 0 - monster destroy

    still need only a bullet to kill every monster

    and if someone know a better trick to make the monster health go up by 1 everytime i kill 5 of them...

  • You need a global variable to keep track of how many you killed, and then when you spawn a new one add that variable divided by 5 to the health value.

    Health = 1 + int(NumberKilled/5)

    (the int will drop the fraction, so the partial number isn't greater than your less than or equal zero check.)

    Edit: This way it increases every 5 killed. If 25 are killed, the health will be 6.

  • when i created the global value...

    in the TYPE: number doesnt support the 1 + int(NumberKilled/5)

    and text does... but do nothing on the game

    i try in text,

    and add bullet on collision with monster: - monster set health to Health

    but not working...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • and how do we change a behavior value

    exemple: i want to change the bullet speed of my monster

  • Sorry, the 1 + int(NumberKilled/5) should have been 1 + int(Kill/5) if "Kill" was the name of your global variable.

    Here is a quick example playable game I made up, using the Health instance variable, and the Kill to count the sprites destroyed.

    It speeds up the falling apples (slightly) as well as adding to the health.

    https://dl.dropboxusercontent.com/u/85412219/forumposts/AppleShootGame.capx

  • Thank's

    I did it, and still not working...

    when i try to open your file, it say i cannot open cause its a r140 or later version.... maybe you made it ou a Mac? i'm windows user...

  • Thank's

    I did it, and still not working...

    when i try to open your file, it say i cannot open cause its a r140 or later version.... maybe you made it ou a Mac? i'm windows user...

    You can download the latest beta version from here if you wish to check out the new features: scirra.com/construct2/releases

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