d939569e84594e1586eac3e65e28dfb2's Forum Posts

  • > I don't think any of that changes the basic fact that you can't pretend asynchronous code is synchronous. It breaks assumptions like the events will run in any particular order, which the existing system makes obvious by making you use triggers in a separate event. Anything which looks like a simple comparison/access but really is asynchronous in the background would be even worse than we have now - it would just silently break or fail to work as you expect in random situations!

    >

    > I wrote up an idea for a "then" event to try and make things like this easier, but it's not supported and I'm not sure how much it would really help anyway: https://www.scirra.com/forum/idea-make-async-easier-with-quot-then-quot-event_t128870

    >

    Then a trigger on the event sheet on you say "load storage" and this event loads all the keys and sets to the variables you previously defined and in the case they are missing (first time running) sets to 0 or whatever you defined previously.

    And for save another unique event. Now i have to do "get item" event and after a "set item" event, or there is another way to do in a unique event? . If not, will be great simply when X happens set Key.BestScore(The local storage) to BestScore(Global variable).

    This is what i'm doing, is correct?

    There is no way to save the "get item" event? and in the comparision say something like:

    LocalStorage.key.BestScore

    I think you need to take a step back and understand the fundamentals of async calls. what you are trying to do won't work. A quick google will bring you many results on the differences.

    The way you are trying to use it is how the old storage worked, it was a sync call. New standards of browsers that is deprecated as I understand it and you need to use async methods.

    Once you step back, and understand how/why it works, it is not bad at all.

  • Once you figure out how local storage works, and keep in mind it is ASYNC, it is not that hard. You can write methods to make it easy as pie, or follow a certain technique.

    Your biggest challenge if you are not use to ASYNC methods, is to keep in mind the AYNC techniques. Once you understand that, it is easy. There are things to keep in mind, such as when to fire them, what to do if it takes awhile (blocking vs non blocking UI which has pros and cons), among other things.

  • You could also anchor it.

  • I use comments to separate them.

    On a side note, good god...some of your function names are so long lol

  • Try Construct 3

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

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

    so what you're telling me i should just give up and go make some games?

    Not what I am seeing. Ashley said you can hack away all you want. But perhaps keep everything well documented to yourself for now, and come back if you have something more solid? Some of your numbers are intriguing, but with working in large projects myself sometimes that does not translate well once deployed. Depending on the server deployed too, the code can run worse then testing. Which in terms of C2, would be a nightmare if a bunch of apps started performing badly.

    Anyways, point I am trying to make is, if you enjoy what you are doing, continue on. I don't think you will get any immediate action, and you would need to do a lot of work on your end to prove this more. Something well documented and well tested. We are talking hundreds upon hundreds of hours of testing if you really want to try it. I think it would be hard to get Ashley to do that . . . you would be asking him to do those hours upon hours of testing and as the saying goes...if it ain't broke, don't fix it!

  • OK, I understand the problem with a browser game. But what if a game is released as a nw.js exe, or as a mobile app? Is that still something to be concerned about?

    Sorry if I'm derailing the thread.

    It does not matter, global, local...if a player wants to cheat they will. There are things you can do to mitigate it, and try to make it harder...but you can not really prevent it 100%.

    Global variables in a programming sense, are typically to be avoided...but for construct and game purposes made with C2, I don't see any real concern with it personally. Should you take steps at preventing cheating? Sure...but it comes down to, at what cost?

    If this is a game with sales, then you better do something, but it won't be using global vs. local variables.

  • would need the capx to help better.

  • On touch

    ---> create object (that is a bullet)

    ------> set bullet angle to to angle(bullet.x, bullet.y, touch.x touch.y)

  • I like snagit personally for capturing video and screenshots. for editing...that is another story

  • On click, check if the object is overlapped, if so ignore the click.

  • Well, solved it.

    I have to unpin the object when my main object is being mirrored, set the object to the proper position (image point) then re-pin it. This works.

  • HI folks, just wondering how to do this

    I have a sprite that is moving via the directional plugin. On keyboard left/right the player moves. They catch an item and when the item is caught, it is pinned to the player. The problem is, it is pinned to a certain spot and when I move the player left, the picture is mirrored. When this occurs, the item pinned does NOT respect the pin (should go to the mirrored pinned position). Now, when I let go of the left arrow and the sprite stops moving, the pinned object goes to the proper spot. So it appears, it is not correcting itself during movement.

    Any idea how to fix this?

    I can try and put a capx together if it helps.

  • I want to clarify, not trying to knock on you I am legitamately curious as to what purpose/use you would have for such a feature. Over the years I have used many IDE's, on many projects, and worked with many people. I have never once seen or heard of someone taking advantage of a variable browser. That said, I know some people must use them, because there is a plugin for it on Notepad++. I just have never personally encountered a real use case for it.

    Something that I have used and enjoy is a function viewer which I wish Construct had. The search feature is not that great in construct, so being able to click on a function I have created and going to it with all my code listed (unlike Search which hides code) would be awesome.

  • do you have an example capx? I cannot picture this. It sounds like you are not working at efficiently as possible, but perhaps I am mis-understanding the situation.