Ethan's Recent Forum Activity

  • yes that works perfectly thanks.

  • I can't open the file, it gives an error, 'expecting class Canimation but recieved Clayout'.

    You're probably using a newer version?

    Thanks.

  • > But what this does is goes through the instances one at a time, rather than doing them all together.

    >

    What do you mean? What's wrong with that and what would you rather happen?

    They don't count down all at the same time, as i think they should. Instead it's like the instances are in a queue, when one instance reaches 0 another instances starts counting down, i want it to happen at the same time.

    Like i said removing the 'for if ' condition solves the problem but creates another, which is time is not independant for each instance. If one instance is counting down and another instance is triggered to start counting down a few moments later, the time is synchronized rather than acting independantly.

    Hope you get what i mean.

    Thanks.

  • for each "my object"

    +"my object" private variable "key" = "yes"

    do actions

  • I have a number of instances, each has a variable called timer.

    I want this variable to count down every second for each instance, so i tried,

    for each object

    +timer > 0

    +every 1000ms > subtract 1 from timer value

    But what this does is goes through the instances one at a time, rather than doing them all together.

    If i remove the 'for each' condition, it now works but each instance is synchronized rather than counting down indpendantly of one another.

    Is it a bug, or am i doing something wrong?

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is that so the image doesnt get distorted?

    Not sure if i can use the tiled background object because it doesnt allow private values, which i need.

  • Thanks.

  • Say i have a sprite thats however many pixels in width and i want it to reflect how much health an object has.

    It has a private value, 100 being full health and 0 being dead, whats the maths to make the sprite width shrink proportionaly to the value?

    thanks.

  • I simplified my problem down as an example.

    What am actually doing is much more complicated but it boils down to what i posted.

    Thanks.

  • Not sure if its me doing something wrong as i'm new to functions.

    I have multiple instances of an object, each with a private value of either blue box or red box.

    When you click on one of these instances i want to create another object based on what type of private value it has which i've clicked on.

    I thought an elegant method would be to do -

    on object clicked > create object by name (funtion. return myfuntion)

    on funtion(myfunction)

    +instance priavate variable(object type)= "blue box" > return function (BlueBoxSprite1)

    on funtion(myfunction)

    +instance priavate variable(object type)= "red box" > return function (RedBoxSprite1)

    So the function compares the private value and if its a blue box it returns the blue blue box sprites name, and same for if its red.

    but i think the problem is when calling return functions in an expression there is no option to remember or forget picked objects, like you can do if it's just an action "call function".

    Is this right or have i got things wrong?

    Thanks.

  • yeah i always get those 2 lines mixed up.

  • I know we can add comments inbetween events, but It would be really great if we could also add comments inbetween the action lines of an event.

    Especially for when you are for example altering various variables in one event and want to remind yourself what each is for.

    Thanks.

Ethan's avatar

Ethan

Member since 20 Jun, 2007

None one is following Ethan yet!

Trophy Case

  • Coach One of your tutorials has over 1,000 readers

Progress

17/44
How to earn trophies