NickRimer's Recent Forum Activity

  • Sorry, man.. I don't even know how to do what you knows..

  • There is nothing can stop you from using int() function.

    a = 0 //numeric var
    s = '5552368' //string var
    a = int(s); // a = 5552368
    
    beware: 
    a = 100
    s = 'text'
    a = int(s) // a = 0
    [/code:28jf9ltq]
    
    And now I read your question more attentively.. I understand, you want an Index of selected item in List plugin? It is [i]List.SelectedIndex[/i] expression.
  • You need to make such offsets by yourself..

    What prevents you from adding +360 degrees to negative angle?

    In geometry -90 degrees and 270 degrees are the same angle. I think you know it!

  • No, my code above is PSEUDOcode.

    So I understand you in programmable manner a sequence of your actions to do smth.

    To make this in C2 you need (let's disassemble my example):

    1. For object Button create string instance variable with name State. Its initial value must be initial state of your music. If pause - 'pause', if play - 'play'.

    2. Then create Event when you tap (with Touch plugin) or click (with Mouse plugin) this Button

    3. 1st sub-event of 2. event will be Button -- Compare instance variable with comparison Button.State = 'play'

    4. All sub-events of 3. event will be:

    4.1 Button -- Set value, pick State and set its value to 'pause'

    4.2 Button -- Set text and set text to ' ? '

    4.3 Any other actions to pause your music

    5. Then add another sub-event to 2. event: System -- Else and add new condition below Else - Button -- Compare instance variable with comparison Button.State = 'pause'

    6. All sub-events of 5. event will be:

    6.1 Button -- Set value, pick State and set its value to 'play'

    6.2 Button -- Set text and set text to ' ¦¦'

    6.3 Any other actions to play your music

    Do you understand so?

    Teach C2 and try to understand another's pseudocodes. I'll not write it so detail next time.

  • As I can understand the problem is that you can click object on hidden layer? And you want to avoid this.

    There are 2 ways I use to pass this around:

    1) Use Groups in Event Sheet. So you can activate and deactivate them whenever you want. It means - use special groups for layouts for events you need only when this layout is visible. May not works if you need both layers to show visible and this situation appears.

    2) The second way is to use Is on layer? and Is layer visible? conditions.

    Maybe there are other ways I never used.

  • Can't definitely understand your problem..

    But if you don't want percisely 450 px, maybe it will be better to use percents? For example, 450 is 90% of 500 (450 = 500 * 0,9)

  • frostyelk is right!

    another advice will be to make a Constant to store this initial value.

    it will save you later from remembering when you store what value and probably from logic mistakes.

    Example:

    constant INIT_TIMER = 20;
    var Timer = 0;
    <...>
    Timer = INIT_TIMER; //reseting your value to initial
    [/code:19hndrk4]
    
    now you need just to change INIT_TIMER at the top of your event sheet.
    very useful if you use this reset in several parts of your game.
    or you will need to search and change values in all this places.
  • Ha! It's freaking easy, dude..

    Let's consider that first state is play. And music is playing. So..

    var Button.State = 'play';
    <...>
    On Button clicked -->
         If Button.State = 'play' then {
              <pause music>;
              Button.State = 'pause';
              Button.Text = ' ► ';
              }
         Else if Button.State = 'pause' then {
              <resume playing music>;
              Button.State = 'play';
              Button.Text := ' ▌▌'
    [/code:hq50qlw4]
  • try this: right click on any block and toggle on Make 'or' block function. Now all conditions in this block will be separated by OR (not by AND as by default)

  • TextBox -> Set Focused[/code:2hs55f70]
    but there is no ways to check is control in focus or not, you need to make it manually with some var
  • Try Construct 3

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

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

    My customer wants me to use his ad banner code inside application.

    This is html-tag code with tags: script, ins.. this is it:

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-403xxx581xxx99xx" data-ad-slot="5xx5xx8xxx" data-ad-format="auto"></ins><script>(adsbygoogle = window.adsbygoogle || []).push({});</script>[/code:3r7wjyj3]
    Usually it just inserts into html page and no problems. But if there any way to use this code inside c2app? Any suggestions?
  • you can use TextBox to allow your teacher to write questions

    you can use Array or Dictionary to store your data (both questions and answers)

    you can use their save/load functions to store and restore data in JSON format

    all other is your imagination and experience to make game mechanics

NickRimer's avatar

NickRimer

Member since 3 Feb, 2015

None one is following NickRimer yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies