tulamide's Forum Posts

  • You can just do your own sine-based movement. You need a variable (here 'sinangle'). Set it to 0 initially.

    Calculate the center of the movement. Let's say x=200, while the total width of the movement is 300, for this example. The radius is half of the width = 150.

    every tick -> add n*360*dt to sinangle

    bird -> set x to 200 + sin(sinangle) * 150

    that will make it fly back and forth from 50 to 350. You have to experiment with n, it is the speed factor.

    Now that it runs, check sin(sinangle) for being close to +1 or -1. If it is +1 (or close to, might not exactly hit 1) the movement to the right is at its climax and will now turn to the left. If it's -1 exactly the other way round. Remember to use 'once while true' for those comparisons. That's all.

  • DrGreenThumbCAN

    It is intended to end the event on Monday, 23 September. I can't give a more exact time, as the closing of the 'creations' thread has to be done by moderators. I will ask them as late as possible to close on Monday.

  • Windwalker

    That sounds promising! And it feels good that you like her <img src="smileys/smiley2.gif" border="0" align="middle" />

  • jayderyu

    Thank you very much! It's a relief that I can do it this way. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • I also thought about it, but system save introduces other issues with this app that I would like to avoid.

    I'll wait a while if someone has already worked with JSON, Ajax and web storage in a similar way and can confirm, else I'll do some experiments.

  • I would like to have a confirmation on this before I build something that goes the wrong direction.

    Scenario:

    An app needs a lot of initial values for various items. But those values will change depending on the user's actions. When leaving the app and later return, the last state of the values should be restored rather than the initial one's.

    My logic:

    I save a dictionary with the initial values as a JSON file and import it as a project file. On start of layout that JSON file is requested using Ajax.Request(project file) and then loaded via Dictionary.Load(Ajax.LastData)

    When user changes values I store the dictionary's JSON string as a value to a key in web storage.

    Next time the user starts the app, an on-start-of-layout-event checks if the key exists in web storage via local-key-exists-condition. If true I load the key's value to the dictionary via dictionary.Load(webstorage.localvalue(key))

    Can anyone confirm that this is correct (without spending hours on testing it, just based on experience)? Is there a simpler way?

  • Good news: The badges are there. Five statements to choose from (blurred in this small preview to not spoil the fun).

    <img src="https://dl.dropboxusercontent.com/u/11182740/C2/images/blossom_badge_demo.png" border="0" />

    Now, if this isn't reason to participate... <img src="smileys/smiley4.gif" border="0" align="middle" />

  • I'm not a moderator, but I'd say, stop this now. There's no need for both sides to get personal or insulting!

  • [day 1] Still not sure where I'm going with this, but I made something:

    <img src="https://dl.dropboxusercontent.com/u/3954039/Temp/record07.gif" border="0" />

    <font color=#aaa>(sorry for crappy gif)</font>Wow, impressive already! Especially when imagining the song accompanying, there's atmosphere with immediate effect.

  • Actually, ryackov is right. There's an inconsistency, there's partly auto-casting, maybe by design Ashley?

    I never stumbled upon it, because I always use variables of suitable types. With this small 1-event-project you can test it:

    <img src="https://dl.dropboxusercontent.com/u/11182740/C2/images/event.png" border="0" />

    Preview it and enter the letter a. It will say NaN as expected. Enter the letter 1 and it will return the number 1. With all issues that I mentioned earlier in my posts. (1.34 gets 1; 1,35 gets 1; 1.a gets 1 etc.)

    I didn't see this behavior before and would like to know if it's by design, and if so, why? (I think, it doesn't help much and introduces other issues)

  • Now that's good news! There's hope for Blossom <img src="smileys/smiley4.gif" border="0" align="middle" />

    ...and thank you for the compliment!

  • As far as I know it only gets merged separately if "force own texture" is activated or certain WebGL effects needs it. "force own texture" shouldn't be used too much as it slows the rendering process.

    EDIT: Ooops, I read wrong, interpreting "Layout" as "Layer". I'm very sorry! No the layout is directly drawn to screen (except for the "force own layer"-textures)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When I convert the input from a text box to a variable, even though it's a "number" variable, if I inputted text, or had no input, it would come out as NaN.That was my point, that I explained in detail. Your thoughts are wrong at this point. The input from a text box will always be text. Entering "1" is text, not a number. If you assign "1" to a number variable, C2 reacts absolutely correct with NaN (not a number). Why auto-type-casting isn't feasible is explained in my last post.

  • But that's something you don't need to worry about. For example, if only one object changes the whole scene would have to be drawn again anyway, so no advantage there. Drawing every frame also frees from computational overhead (like examining the render tree on every frame to see if there are changes)

    The layers, btw, are not really existing. They are a thought construct. Technically all object have some kind of ID which determines when to draw them. Placing them on a higher layer for example just gives them a higher ID (with some math involved).

  • Button pressed doesn't work for me. Please could you be more specific about once true condition. I added that too, but I guess I did something wrong.

    I am trying to mirror the animation. When I go right everything is fine, but when I go left I have the same problem with freezing on first frame. You should post a capx, as it might be your order of events or other logic.