How do I add object?

0 favourites
From the Asset Store
This is a single chapter from the "Construct Starter Kit Collection". It is the Student Workbook for its Workshop.
  • exist a function every "tot" points create a object???

    no.. sure.. but i want every 10 point create object.. someone can help me?

  • Store your score in a global variable then use the modulus operator to check if it's remainder its 0.

    You can then turn the score variable to 0 again or use the trigger once while true so only one object is created.

  • sorry i think non have understund ver good.. because in to my version of construct 2 "r172" is impossible to write your frist step

    you write: system score%10 = 0 i think thi is your step..

    1) add event

    2)compare variable

    3) i not know..

    i write: system "compare variable" score% 10 = 0 and result

    score = score% 10 = 0

  • You have to use System ---> Compare two values and then write what I told you before.

  • no work give me a infinite object....

  • Using donelwero method here is a quick working version.

    [attachment=0:1k5dyv3s][/attachment:1k5dyv3s]

  • uff new release.. every 2 day.... 1 moment ^_^

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • no is perfect.. because every multiple of 10 give me a object.. for example.. if i have 19 score and add 3 score 19 +3 is 22 points and no create a object... another question.. i have 4 object and have created 4 "system score ---> system trigger once----> because have a 4 different point but at star of game all my objects appear on the layer

  • How about this.

    [attachment=0:mdawi7o9][/attachment:mdawi7o9]

  • sorry only for understunding.. you can explain me this??

    choose(1,2,3,4,5,6,7)

  • That randomly chooses either 1,2,3,4,5,6 or 7 to add to your score.

    I used it for 2 reasons:

    1. I have no idea how your scoring works so it was easy for me to make for the example.

    2. It shows that whatever you add to your score every 10 point's will create an object.

  • tnk you in advance

    I'd like to understand how it works .. the reasoning .. but I can not understand .. so I would love it if you did a tutorial explaining step by step what to get and why ...

    for example

    i have already insert a global variables name score... but no understund why you use another global "point and object_create"

  • Hey lowkicker, what Minor did is really easy, I think you should stop by the tutorials section to learn a little bit more about the basics of Construct 2.

    Minor created two variables (score, object_create) where the score is stored and one where the points that will be added to the score are stored (points), he is using object_create to check if the score is greater or equal to 10, when than happens 10 points are substracted from object_create so that the system can evaluate that condition again. You could skip the usage of the points variable, but it's always better to have variables to store things like that, so you know where things that modify your score or another important things of your game are.

    The problem with MY example is that only one instance of the object is created and the condition is never evaluated again.

  • yes donelwero but i am a totally noob.. for me every day is a miracle^_^

    Minor no working your solution i thin because you use every 1 second..

    at me every "1 second" give me random 1 2 3 4 5 6 7 points...

  • Like I said I have

    no idea

    what type of game you are making, how your scoring works or how many points you get for doing anything.

    I used "every 1 second" because it let me add a number of points to a score which then let me show you how to create an object for every 10 points scored. What you need to do is include my method of checking for "every 10 points" into your game & scoring system.

    With the information given neither myself or anyone else can do any more to help.

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