lennaert's Recent Forum Activity

  • Instead of saving to file,try saving to webstorage.

  • currentlevel = 3

    the < 6 is always true, as the value only triggers when its 3. (its a sub of the currentlevel = 3)

    The else should tigger when its bigger then 6, but that will never happen seeing as currentlevel is always three when it gets there.

  • check some tuts from allmarkmade.

  • Loop through them and indivudally check, if found, add 1 to counter.

    var: counter int() = 0

    event: for each sprite

    sub:

    event: compare animation frame not equal 0

    event: sprite is on screen

    subs action: add 1 to counter

    After the loop, the counter holds number of sprites which are on screen with their current animation frame other then 0

  • I think one of the ideas for the foundation of C2 is that the tools be as intuitive as possible. Having things that sudden don't work isn't a good idea.

    It wouldnt be sudden, as it would be in the manual, and in the webconsole.

    Though, one idea is to have another boolean for sprites for "Always maintain aspect ratio". But, it's easy enough to manually do that.

    This would generate the same issue you pointed out, it suddenly wouldnt work ? (changing width or height)

    Another idea, is that whenever your set scale for a sprite, then you can have an instance variable that keeps track of that scale. Thus a comparison can easily be done with that.

    These would be off if you changed only width or height.

  • By means of tokenat you can make tons of self made array approaches.

    simple approach:

    a text variable:

    you can create an array by using a comon character like a comma or pipe sign on which you can itterate through the sections.

    like

    text = 1,2,3,4,5,6,7

    tokenat arrays start counting at 0, so keep that in mind.

    tokenat(text, 0 , ",") = 1   

    tokenat(text, 1 , ",") = 2   

    etc

    This would all be sinle level arrays without keys, but straight up pieces of content.

    Extending this, making each piece alse have a list of options by means of a different comon character.

    text = 1,2,3,4 | 5,6,7,8,9 | 45,46,47

    This takes the second chunk of data from text:

    tokenat(text, 1, "|") = 5,6,7,8,9

    now, if I want the 8 from the second chunk of data, we simply nest the tokenat calls:

    tokenat(tokenat(text, 1, "|"), 2, ",") = 7

    tokenat(tokenat(text, 1, "|"), 3, ",") = 8

    tokenat(tokenat(text, 1, "|"), 4, ",") = 9

    this way it references single pieces from the second chunk, but you could easily loop through it:

    for each "looptokes"

    from: 0

    to: tokencount(tokenat(text, 1, "|"), ",")

    create text,

    set text tokenat(tokenat(text, 1, "|"), loopindex ,",")

    With the above approach, if you keep a uniform structure, like adding a question type first, then a question, then which of the following anwsers is correct, then some awnsers: either one or more. You have a full system that can dynamically expand as you add more.

    Or you could use objects having a text variable with these sets.

    example:

    obect questiontext, has instance variable awnser int()

    obect awnsertext, has instance variable awnser int()

    textvariable = multiplechoicetext,which is faster,0,train,horse,man|multiplechoiceimage,which color is red,2,image0,image1,image2,image3|inputquestion,how many cm are in a M,0,100

    The above variable shows examples of 3 type of questions.

    Looping through them with

    for each "looptokes"

    from: 0

    to: tokencount(textvariable, "|")

    sub of loop

    compare 2 variables

    tokenat(tokenat(textvariable, loopindex, "|"), 0 ,",")

    equals

    "multiplechoicetext" : action spawn questiontext, set text: tokenat(tokenat(textvariable, loopindex, "|"), 1 ,",") //Set question

    set questiontext instance variable awnser: tokenat(tokenat(textvariable, loopindex, "|"), 2 ,",") // Text instance variable now holds correct awsner

    set tempvariable: tokenat(textvariable, loopindex, "|") //use a temp to avoid loopindex issues in the next loop

    sub of compare

    for each loop to create the questions awnsers:

    from: 3 // First three entries were type, question and awnser

    to: tokencount(tempvariable, ",")

    action: spawn awnsertext, set text = tokenat(tempvariable, loopindex, ",") // sets the questions

    set awnsertext instance variable awnser: loopindex

    Onclick awnsertext

    compare 2 variables

    questiontext.awsner

    equals

    anwerstext.awnser

    action: awnser correct

    else: action: incorrect

    A bit advanced, but can work really well without any further extras.

  • lennaert - that's not possible. The editor cannot possibly know if the object aspect ratio will change at runtime.

    At the moment the function is called to be applied at runtime, can it not check if the current objects ratio is different from the original? and depending on that apply or not ?

    In the editor you might be able to apply the scale comparision, but if you tinkered with the individual width or height somewhere along the way, changing the ratio, it does not work at run time.

    You could have a console error log indicating ratio difference, ommiting the comparison check, and for example always return 0 or false in this scenario.

  • Pinball in the arcade with capx

    Used it myself last week for near same :D

    <img src="smileys/smiley2.gif" border="0" align="middle">

  • Check the origin positions of your frames.

  • Give the players a boolean, activeplayer false.

    Start with one activated.

    On click other character set other chars activeplayer to false and self active player to true.

    Control events could be assisted with boolean check as to which player to move.

  • Yeah, it's the same reason there's no 'scale' expression. If an object is twice as wide and half as tall, what's its scale?

    How about not showing/applying such option if current WxH aspect ratio is different from original aspect ratio ?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In some of my games, I like to create a keyboard event to toggle showing FPS. I think it is a good practice when developing games.

    IE 11 has the FPS view and CPU usage build in :)

    CTRL + SHIFT + U

    Perhaps not the best browser to test in, but if you have a web app/game that should be compatible with IE, IEs option has majorly advanced and this will give a good ndication.

    This way your app will show a more precise FPS on actual running apps .... for IE at least haha. (ofc results will differ comparing to other browsers)

    It also has the option to test repsonse time of user interface options through the web dev console. Also profiling options.

lennaert's avatar

lennaert

Early Adopter

Member since 8 Oct, 2013

Twitter
lennaert has 13 followers

Connect with lennaert

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • x5
    Popular Game One of your games has over 1,000 players
  • Famous Game One of your games has over 10,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • RTFM Read the fabulous manual
  • x2
    Great Comment One of your comments gets 3 upvotes
  • Delicious Comment One of your comments gets 10 upvotes
  • Email Verified

Progress

25/44
How to earn trophies