GeometriX's Recent Forum Activity

  • You are wrong.

    The exe still runs in what's basically a web environment. The exported executable is simply the HTML5 game running in its own web browser as a sort-of wrapper.

  • It could be a few things.

    Are you using the CocoonJS launcher app on your phone? Have you signed up and received a registration code, and entered that key into your app? Does the game work in a mobile browser?

  • But look at what I'm saying: global objects are not destroyed between layouts. So if you have Sprite01 on Layout 1 - created normally with the drag-and-drop interface, and then go to Layout 2 - which doesn't contain an instance of Sprite01, Sprite01 will be there anyway, because it's not destroyed.

    So do this: create a layout that only has your UI. Put those in the positions that you want. Assign them all to families. Set them all to Global. In that layout's event sheet, create an event On start of layout -> go to (Game Layout). Those UI elements will carry over. Then have an event in that event sheet On start of layout -> Move (Families) to Layer "UI"

  • You shouldn't be creating the objects on each level - they should be there already since they were never destroyed in the first place. They simply carry through from the layout on which they first appear until they're destroyed.

    You haven't said what the actual issue is though. What about that event doesn't work for you? But to answer your question, you can also specify layer names as strings. Just be sure to wrap double quotation marks around them like "this".

  • You mean the screen isn't scrolling to the player? Are you referring to the Scroll To behaviour?

    You'd have to share your capx. The only thing I could think of without taking a look at your code is that you might have more than one object with the Scroll To behaviour.

  • Oh, yeah, forgot about that. It always goes to the bottom layer. It's an unfortunately lacking function in that it doesn't respect layers at all.

    I suggest that put all the elements in the same family (or in a few, if you're got a mix of sprites, tiled, and text objects), and, at the start of each game layout, move everything in those families to their own UI layer.

  • Yup, it'll stay in the same position.

  • Any object that's set to Global in the properties pane will not be destroyed upon changing layouts. If you want a global HUD/UI, I suggest that you create it on its own layout, and when the game starts go main menu -> UI layout -> level layout.

    Make your sun and moon objects (and anything they're attached to) global as well.

    In both instances, just be sure to manage them properly when you go back to the main menu or any non-game layouts. They'll still be there; easiest way is to just set them as invisible. For interactive UI elements, be sure to set their interaction conditions to include "is visible" so they're not activated when they're hidden.

  • Even with javascript, I don't think there's any way you could run an executable from what's essentially a web page. You could download the file (with the Browser -> Go to URL action), but not open it.

  • Global variables do that by default. They don't really care what layout or event sheet you're on.

  • Haha, this was the first thing I tried with the LOS plugin :P

    The thing is, you have to have smaller sprites if you want to avoid the blockiness, but then you'll probably kill performance. Chucking all of the sprites on their own layer and adding a layer effect of blur horizontal and vertical helps reduce the blockiness to some extent, but it's still pretty chunky.

    There's probably some fancy stuff that one could do with the canvas plugin, and using a lot of sprites as nodes to build a gigantic polygon, but that kind of stuff is a bit beyond me.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There are many ways to do this, but I'll give you a breakdown of how I do it:

    • One layout per level.
    • Create a global UI layout which is only visible and active in a level. The prevents you having to recreate your UI in every layout (a major pain if you want to adjust it later). Alternatively, create your UI at runtime with events.
    • Use a few global variables to record your progress (Score, CurrentLevel, UnlockedStuff, etc.).
    • At the end of each level (or in the score screen, if you have one), chuck all the important global variables into WebStorage, then wipe all of them. Restore the important ones back from WS.
    • Jump to your next level.
    • In your main menu, have an option for new game (starts at level 1, wipes WS), or continue game (checks if there's WS, if there is, populate the global variables and carry on from CurrentLevel). Use a level selection screen based on the value of CurrentLevel.
GeometriX's avatar

GeometriX

Member since 23 Aug, 2012

None one is following GeometriX yet!

Connect with GeometriX

Trophy Case

  • 12-Year Club
  • x2
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

16/44
How to earn trophies