applern's Recent Forum Activity

  • Unlike the heading, this is a bit more complicated.

    When 'Seed' is visible and Wrong = 1 show 'WrongCompletely' ( sprite)

    + System: Wrong ≥ 1
    ----+ System: Trigger once
    --------+ Seed: Is visible
    ---------> Seed: Set visibility Invisible
    ---------> WrongCompletely: Set visibility Visible
    ---------> System: Set Wrong to 0
    ---------> System: Subtract 1 from Correct
    

    so when apple is shown I don't want the wrong ( sprite) to show

    + System: Correct ≥ 7
    + System: Wrong ≥ 1
    -> WrongCompletely: Set visibility Invisible
    ----+ System: Pick a random Apple instance
    -----> Apple: Move to top of layer
    -----> Apple: Set Bullet angle of motion to 90 degrees
    -----> Apple: Set Bullet Enabled
    
    + Apple: Y > 600
    -> Apple: Destroy
    -> System: Set Wrong to 0
    -> System: Subtract 1 from Correct
    
    

    But when correct = 7 and wrong = 1 the 'Wrongcompletely' sprite shows and the apple doesn't fall. Here is a pic of the debugging

  • here is a quick sample:

    https://rieperts.com/games/forum/AppleTree.c3p

    In your code it states

    -> System: Create object Apple on layer 0 at (50 + random(400), 50 + random(250))
    

    What does that mean?

  • You can save all the questions in a string variable here is an example of a variable with 3 questions "1+1; 2+2; 3+3" after that when you start your game you can set what question to show like: set text -> tokenat(variable,0,";") this will show the question 1, etc.

    Also you can kinda fix your code, let's say you check if Wrong >= 1 Wrongco set invisible, you do it too many times, but you only need to add it in one event. invisible

    Also you have the if Wrong => 1 and if seed is visible / if Wrong => 1 and if seed2 is visible / seed3 , seed4.

    You can add as event the if wrong => 1 and the other as subevents.

    I don't understand. Can you do it in code format?

  • Hello, first of all, check the 1st picture at event 4 maybe you insert the event as sub-event.

    Second, if you did not care about the variable "Wrong" after a turn to 1 or higher you can remove "trigger once" and move the "Subtract 1 from correct" at top of the "turn Wrong to 0".

    And third, why so many layouts? Do you have different pictures in each layout? Or is it just a different question?

    Thank you. It is a different question.

  • Okay. So in my game when you get a correct answer it adds to the correct variable. and another event will do

    CONDITION

    Correct = 1

    ACTION:

    Show seed (sprite)

    And the same with 2 correct answers in a row

    CONDITION

    Corrrect= 2

    ACTION:

    Show Sapling (sprite)

    And if it is Wrong then

    Condition:

    Add 1 to Wrong

    ACTION:

    Show Wrong (sprite)

    Sub Event

    Trigger once

    Action:

    Subtract 1 from correct.

    Got me so far? Here is where it gets confusing.

    If I get correct and then 1 wrong, It'll show the Wrong (sprite) but also show the Seed because even though it got 1 wrong the variable becomes 1. After all, it subtracted but the value is still more than 1. And my event shows that when Correct = 1 shows seed. So yeah. I know its confusing and I'll show my coding so I hope it helps. If you can, It'll help a ton. Thanks!

    I didn't get to fit all the coding in 1 pic so it's the continuation

  • You do not have permission to view this post

  • I downloaded it from my site and it opened fine...

    I made it in the R189.2 stable version - what version are you using?

    It worked ! Thanks!

  • I downloaded it from my site and it opened fine...

    I made it in the R189.2 stable version - what version are you using?

    Thanks. I was using an older version. Downloaded. I'll check and see. Sorry for wasting your time!

  • here is a quick sample:

    https://rieperts.com/games/forum/AppleTree.c3p

    I can't open it?

  • if you don't care which apple gets destroyed you could use System - Pick a Random Instance, and then destroy that one.

    If you give them bullet behavior (turned off by default), then you could activate it and have the apple "fall" out of the tree.

    What would be the code for that?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello.

    So in my project when you do a correct answer an apple shows but when you do it wrong an apple goes. I clone each apple when you do a correct answer but how to destroy a clone?

  • You are looking for the System action Create object. It is used to create an instance of an object type at a given position and layer.

    Thanks!

    [giphy=

    ]

applern's avatar

applern

Member since 7 Oct, 2019

None one is following applern yet!

Trophy Case

  • 5-Year Club
  • Email Verified

Progress

6/44
How to earn trophies