iznaut's Forum Posts

  • Not sure if you guys have all used Sublime Text 3 for code editing. If not, you should. If you have, you will whole-heartedly agree with my #2 C3 feature wish

    I've been using Atom/WebStorm to do things like you mentioned in #2, but I agree that it would be nice to have built-in to Construct 3.

  • Oh okay so you're issue is basically you're running multiply games inside on app? Can't you just set when they go back to the menu or press the button it stops music and speed for that layout?

    No, the other apps would be other games, so the issue is with navigating the OS and not something I can handle inside Construct 2.

    Sorry if I don't make sense I don't dev on windows I do android and web.

    It's fine, I appreciate your suggestions either way.

  • I get what you mean now. But honestly why can't you just pause the game.. I mean if we're talking about a game here then why can't you just hit esc then that pauses the game. When you come back into the game and hit resume it just resumes. I don't see why that can't just be a work around?

    I wasn't able to open your example because you saved it on the newest beta (I'm on the r216 still), but I understand what you're saying. I have sort of a specific use case that I'm not expecting Scirra to support, but I was really just hoping there would be a solution I could use already available.

    My game will be playable on a large touchscreen table in my local public library. Users can open games from the Windows 8 Metro screen, at which point they go full screen. If a user presses the Windows button and returns to the Metro menu to pick another game, the library does not want my game to continue to produce sound while running in the background. So, the ideal solution in my use case would be an auto-suspend, as I can't expect the users (mostly small children) to press a pause button before abandoning my game.

    Now that I'm thinking about it, I wonder if exporting the game as a proper Windows 8 app might behave differently. I hadn't thought about it until this point because I wasn't planning on putting the game in the Windows Store, but it might be worth testing out.

  • Maybe this will work for you?

    It doesn't. I've tried exactly that solution. I don't think NW.js considers the executable window losing focus to be the same as a browser windows losing focus.

    Pause on unfocus

    If set to Yes, the preview will pause when the browser window loses focus, e.g. when switching back to work in Construct 2. This can be useful for certain workflows such as using continuous preview. If set to No the preview will continue to run even without focus, but note switching to another browser tab or minimising the browser window will still pause (as it does with published projects).

    Although the explanation in the manual isn't really clear about it, this setting is only meant for the preview.

    In the editor it is mentioned in the description:

    During preview only,whether to pause the game when browser loses focus.

    Right, I understand that. I know that feature is of zero use. But when exporting, a browser game will always pause when unfocused and an executable will NEVER pause when unfocused. This is my issue, I'd like the NW.js build to work the same as the HTML5 export.

    Sorry if my original post was unclear.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So, I'm aware that unfocusing a tab in a browser will cause the game to suspend (effectively pausing anything happening on screen). But what about NW.js?

    I tried exporting my game to NW.js and testing this, but it doesn't seem to suspend when I unfocus from the window. Is this expected behavior? I notice that if I turn on the "Pause on unfocus" option when previewing in NW.js, it DOES suspend.

  • I've published one game to iOS and Android, Lonk's Awakening. I used PhoneGap and it was a nightmare to find any sort of helpful documentation on how to get it on the app store. After a month or two of trial and error, I finally figured out enough to get it submitted and approved. Android (Intel XDK) took longer, but that was mostly because of how awful Google Play was to deal with.

    I've got a decent set of notes for how to get a game on iOS now, I'll write something up for others when I find some free time.

  • You should add a "type" tag to your JSON. Type can be "enemy" or whatever other types you have.

    Then just check the type on the way through the JSON and compare to the string "enemy" and only operate when that condition is true.

    Like:

    {
    type: "enemy",
    name: "jabi-jabi",
    stats: {
      attack: 22
      defense: 42
    }
    }
    [/code:3fznuhw6]
    

    Thanks for the tip. I already figured out a workaround, in case anyone is curious:

    Since my enemies exist on a tilemap, I loop through the tilemap and pop the JSON of each enemy on to the back of my array when exporting a level. On import, I loop through the tiles again, creating an enemy depending on what tile it hits and activate an event group that contains an "On enemy created" event, so each time an enemy is created at a tile, it loads the first object JSON in the array and removes it. Since I loop through the tiles in the same order on import and export, the order of the JSON objects is always consistent when importing back in.

  • Hello,

    I'm making a top down shooter game and when the player reloads, a reload sound effect is played. This sound always lags my game so badly that the entire game freezes for maybe 5-10 seconds before the sound is played. This only happens once though in the game. For example, the first time the player reloads, it will take a long time but the second time, the sound is played normally. If I export my game, will this problem still exist?

    I'm not sure if this is the same issue, but I've noticed using the "Play at object" action causes lag on the first play.

  • I'm aware of the ability to save an object's properties as JSON, but do those properties store the type of object it is as well?

    I have a family of "enemy" sprites that I'd like to import/export using JSON. I can save the JSON of each enemy without an issue, but when attempt to restore them all, there's no way for me to know which JSON object belongs to which member of the family.

    Is there a way to work around this? Does the JSON object even store the information I would need to make this work?

  • Hey there,

    This should help:

    You may also want to check the FAQ thread that's pinned in this section of the forum for more tips and tricks.

    This looks great! Thank you both for the suggestions.

  • This seems like something that may need a plugin of some sort, but I'm curious: Is there a way that I could create a sort of "picture in picture" effect, in which a small window inside the larger layout would show something off screen?

    For example, I have a platformer where you can throw a ball. If the ball goes off-screen, it would show a window displaying the ball's position, so you can still know roughly where it is.

  • I'm looking for answers to this question in more of a "in your opinion" way than not actually knowing how to do it, so I hope this is the most appropriate place to ask.

    So, I've been working on a project for a while now and I have two modes (single and multiplayer). When I made the single player a long while back, I made a TON of global variables for "global" things, like checking if the game is paused, checking if sound is on/off, etc. Later, working on the multiplayer, I realized how excessive my globals were getting and made an invisible "multiplayerVariables" sprite that tracked a bunch of stuff, but of course, that also feels a little excessive.

    I've been doing a lot of reorganization on this project recently and so I was hoping to hear what others tend to do to keep track of "common" variables in bigger projects like this.

  • Just last night I finally set up version control for one of my projects and used a diff tool to compare two revisions of an event sheet. While I was surprised by how readable it was, it was still quite a lot to sift through and it would sometimes take me a few seconds to figure out what certain things were representing.

    So, out of curiosity, does any one have a particular diff program that they prefer for dealing with Construct's XML files? I feel like there are probably ways to represent the contents more visually (like using the editor itself). Something specific to Construct would be especially cool (maybe a plugin that would let you diff projects in editor?), but I'm not sure if it exists.

  • I've been developing with Construct 2 for a few years now, but I've only just recently found someone interested in collaborating on the programming side of things. I'm very used to working on my own, but I'm curious about other people's experiences collaborating with others on Construct 2 projects.

    I've read the article about using SVN which is helpful, but I'm curious about any other potential pitfalls/helpful nuggets of advice those of you who have real experience working on the same project simultaneously can offer.

  • Okay, this is hopefully a simple answer that I'm overlooking: If my platform is jumping, I play a jump frame. If he double jumps, though, I'd like to play a different frame. How can I do this? I only see "Is Double Jump Enabled" as a trigger option, which isn't helpful (since it's always enabled). I need something to the extent of "On Double Jump" or something, I feel like, but I don't see anything like that.