OlivierC's Forum Posts

  • I use the Tint effect when I want to modify the color of my sprites (like to simulate ambient light). But this applies to the whole sprite. In order to recolor parts of a character individually, I think you have to break it into separate sprites. I don't think there is any native way to access the RGBA channels individually, which is an easy way to create masks

  • I had this issue too. I did pretty much like you did, but instead of using webstorage, I used a dictionary. Then I created a function called resetGlobals(), in which I first copy the variables I want to keep into the dictionary, then reset the global variables, and finally copy back the values from the dictionary to the global variables. Then I just call this function whenever I need it, like when changing layout.

    Having everything in one function is easier to maintain, especially if you want to add more variables later (score, sound volume, language...)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can already achieve a lot with the lerp function.

    There is the plugin LiteTween, but it's a behaviour, I don't know if you can use it to do all the things you say.

    But I think it would be really hard to implement a function which receives a parameter for duration, given that the event sheets are executed every tick.

  • People still use their OUYAs? huh.yes, they make nice door stoppers

  • I think what you encounter is normal. Disappointing, for sure, but normal. Mobile devices are not nearly as powerful as desktop, especially when it comes to HTML5, it's that simple. If latest generation devices like iphone 5 or ipad 2 can run games in HD resolution with decent frame rate, you can't say the same for older hardware (2 years is considered "old" for mobile devices).

    Why do you think the old school pixelated look got so popular lately? it's not just an artistic trend, it's just a lot easier to render 32*32 sprites than HD graphics on phones.

    So I guess there is nothing wrong with your export. You just need to optimize your game. I think it's the price to pay for using HTML5: it's portable, but not as efficient as coding native apps.

  • I already had this situation and found a workaround. You can do it with "pick by UID". You have a first event that picks an instance of FamilyA. Then you have a sub event that picks an instance of FamilyB by UID, providing the previously picked FamilyA member. Since it's supposed to be the same object, the UID is also the same. You can now access both FamilyA and familyB instance variable, which should refer to the same instance.

    Example:

    + mouse over Family A

       + pick FamilyB by UID (FamilyA.UID) --> Set FamilyA instance variable A

                                           --> Set FamilyB instance variable B

    I know this is a workaround and it might not be as elegant as having a specific event for that, but it does the work.

  • it works for me. But, like toggling full screen, I think it has to be triggered by a user input, for security reason. So the close action has to be inside mouse click or key pressed event

  • It's called "gesture".

    I found this plugin

  • How about being creative and trying make an original game instead ;) ?

  • There is no real solution, this is how the gamepad API works, Construct can't do much about it. Only workaround I know so far is, like jaza23 said, to have the main menu to say "press any button to start" and even then, you'd have to press twice.

  • The way I did it:

    All my menu items are instances of the same sprite (or sprite font in my case to be more precise), with an instance variable called "index". Each item has a unique value indicating in which order it should be highlighted in the menu (0 for the first item, 1 for the second one and so on).

    I create a global variable (or static local in a function) named "selected", which contain the index value of selected index. I default it to 0, so the first item is selected.

    Then, for a vertical menu, I test if the Y axis of the stick is greater than 0. But in order to not go to the next item on every click, I add an "every X second" condition, where X can vary between 0.5 and 1s, depends how sensible you want the menu to be. Then in that condition I "unselect" the currently selected item, (by finding the item which index variable matches the global). Whatever that is, a highlight effect, a color or scale change, I remove it. Then I increment the global variable and select the item with matching index. If no matching item is found, that means we reached the end of the menu, there is no more item, so we go back to the first one, we set the global variable to 0 and select again the matching item.

    For reverse selection, when stick Y is less than 0, this is a bit more tricky. Instead of incrementing the global variable, you decrement it, and when it reaches -1 (you went back past the first item) this time you must select the last item in the menu, you must find the item with the highest index value and set the global variable to this value. There are several ways to do that, the simplest is to count the number of instance of menu item and subtract 1 from it, but you have to make sure that all you items have properly numbered index starting form 0 and never skipping value (like 0-1-2-3-4 and not 0-1-2-4-6). Other methods would be to manually search the highest index with a "for each" loop and a temporary variable

    The advantage of this method over hardcoding which button follows which, it that the menu become flexible, you can add, remove and reorder items without modifying the events. Then I also use a global variable stating if the menu is vertical or horizontal layout, in which case I test for the gamepad X axis instead of Y

    It you don't use sprite font but each menu item is a different sprite instead, just put them all in a family, add the instance variable to the family use a that family in your events for selecting items

    you can see it in action in my test HERE, the menu works with keyboard, gamepad, mouse and touch. you can also press Esc or the gamepad start button while in game to bring the pause menu

  • Very nice trick R0J0hound, up until now I would test if the angle is between -45 and 45 degres, then between 46 and 135 and so on... Yours is much ore elegant, thank you

  • you must do the opposite, call the function inside the every x seconds

  • You might find it advisable to read the manual. For instance, THIS SECTION deals with Boolean variables.While boolean are available for instance variables, they are not for globals. And I really wonder why. I know it's not a big deal to use an integer instead, but it kinda makes you scratch your head why they are available in one case and not the other

  • Sorry I forgot to answer about that, yes the lighting is just part of the artwork, it's a low res 3d render, I modeled the room quikly in maya just for this test.

    Tobye : I see what you mean. But don't worry, I'm a former developer, I'm used to program with object oriented languages, I keep re-optimizing my events all the time. I'm planning to have a big recursive function for dialogue. Pauses and such things will be implemented in the XML. The function will then test for each new line of dialog who is talking, to whom, if there is a pause... It might even evolve into a full script which allows you trigger complex action (new character walks, one give an object...)

    I started with XML to load the current scene you see (walk areas, collisions, light area...), but I read that XML just won't load on android devices, so I might switch to JSON, which works just fine but harder to edit manually.