mekonbekon's Forum Posts

  • If using the sine behaviour, a simple way is to set the pendulum's sine magnitude to max(self.sine.magnitude-value,0) every tick, where "value" is the rate at which you want the pendulum to slow down.

    You can then do a check to see if the magnitude is 0 and disable the sine behaviour to stop it running.

  • PreacH You're welcome

  • PreacH Would this work for you?:

    https://www.dropbox.com/s/why3eeheyjhd7 ... .capx?dl=0

    Tap any key to add a random plate.

    Left click a plate to remove it.

    Tapping a key populates calls a function that populates the array with the UIDs of all plate objects that have an animation frame of 0, then picks one at random and assigns it a random plate frame (excluding 0).

    You can scale this by adding more plate objects to the layout, no need to adjust the code.

    If you want more plates of food you can add extra frames to the animation.

  • Create one card object with 10 frames (0-9), one for each card value. Make sure the animation speed is set to zero.

    Create a global variable "score".

    Create a text object "txt_score"

    On button clicked:

    spawn card

    On card created:

    set card.animationFrame to floor(random(10)

    add card.animationFrame+1 to global variable "score"

    set txt_score text to "score".

  • No worries

  • Check out this thread:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Most likely what says, but if that isn't the issue double check that you haven't got any silent space at the start of your sample.

  • Like Excel or Google sheets.

  • Hex27 Your sounds will trigger every tick. Try adding a "trigger once" condition to each event.

  • I'm not sure that you can host your games on Drive any more. I use https://www.bitballoon.com/ - it's free and super easy to use.

  • My suggestion would be:

    1) Create a spreadsheet with all of your strings, one column for each language.

    2) Copy those strings into a json array file or save the spreadsheet as csv and use a converter tool such as this: http://www.convertcsv.com/csv-to-json.htm , using the "CSV to JSON array" option.

    3) If you use the converter you will need to modify the output file slightly so that it's suitable for C2:

    {

    "c2array":true,

    "size":[2,3,1],

    "data":[ [ ["english0"], ["french0"], ["german0" ] ],

    [

    [ "english1"], ["french1" ], ["german1" ] ],

    ]

    }

    In this example each row is a new string and each column is a different language.

    4) Save this text file as *.json and add it to your project by right clicking on the files icon in the Projects bar and selecting "import files".

    5) Add an array object and the AJAX object to your project.

    6) Import your json data into the array object by using the AJAX object:

    On start of layout: AJAX | Request yourArray.json (tag "yourArray")

    AJAX | On "yourArray" completed: Array | Load from JSON string AJAX.LastData

    7) All of your strings should now be in the C2 array.

    8) You can now set the correct language string by calling it from the array e.g.:

    Set text1 to array.At(stringNo,language)

  • Global variables shouldn't reset when going to a new layout. Are you using a "Reset global variables" action with an "on start of layout" event? If so, you will need to save the score to a local or instance variable, or to local storage before resetting the globals. You can then reassign the value back to the global variable after resetting.

    If you aren't using reset global variables then you must have an action in your code somewhere that is setting the score back to 0.

  • If you want different types in one belt you can add different animation or frames to the asteroid object and use the "choose" expression to pick a random animation/frame in the event where the asteroid is created.

  • Only one spawner per belt - it's a lot easier to handle than trying to create multiple belts from a single spawner

  • I've updated the project file with a nicer tile set.