Toby R's Forum Posts

  • Yes it works with mobiles.

  • It should work the way you do it. Have you checked your mobile volume?

    You can also try to preload sounds first, or move them to the Music directory.... worth a shot I guess.

    What device do you use to test it?

  • Suppose the player closes down the app (ex. close web browser for HTML5 app and close app for exported Android/iOS), is it possible for the player to still receive some text notification?

    I'm not really sure how you see it with HTML5 app. When user closes the browser then there is no place where message should be sent to. In that case you can send him a message if he has some account in your app (on your server), and he will be able to read it once he logs in to the app. There is plenty ways to do that but I think this is not what you want.

    However if browser is opened and player is in your app then you can send him a message using WebSockets.

    Regarding mobile version, there is no built in plugin to do Push Notification in C2, but it is possible to do that with CooconJS and some manual scripting if I remember well. Just Google "construct 2 push notification" there are some information related to Ludei.

  • That is basically the same solution as with loading screen, but you use a black layer instead of loading screen sprite in it. However I haven't tried lerping the opacity. I need to check it out . Thanks for sharing!

  • I know, that's why I wrote that I agree with that. Just wanted to clarify that it is not only one of the options but it is the right one .

  • Second instance of the same object will also take some RAM memory because game engine generates an object (from the programming term) which needs a possibility to be treated separately in any way. The same goes for animations. Every animation on your screen (no matter if it's an instance of the same object or not) eats some CPU resources because it has to be rendered on the screen separately (it might start burning later or earlier right?).

    Now what they have in common (all instances of the same sprite) is the sprite object. Which is simply a - let's say - starting template for the instances. So when you use many different sprites/trees then your game will have to store many "templates" which will use some more memory.

  • Android app with C2. Tips&Tricks — Now for sale in the Scirra Store!

    https://www.scirra.com/store/ebooks/android-app-with-c2-tipstricks-1254

    <p>This e-book will teach you how to convert your Construct 2 HTML5 game into a mobile application for any Android device. I will guide you step by step, explaining most important options you will come across. I will also reveal some good practices, hints, tips and tricks which you won't find anywhere else. </p><p>I will show you common problems Construct 2 developers tend to find on their way and certainly solutions to them. I will also tell you how to improve your app performance and avoid most popular mistakes developers make after releasing the application to Google Play, as well as other useful information to make your development life easier. You will also find a lot of useful links to most valuable tutorials, manuals and other sources of practical knowledge.</p><p>In short � reading this book will save you many weeks of investigation, reading, searching and frustration caused by �unexpected� problems.</p>

    Use this topic to leave comments, ask questions and talk about Android app with C2. Tips&Tricks

  • I don't think you can determine with events if text fits the text box or it's too long. I had simillar problem with my quiz game. I use Sprite Fonts in my game, but the solution can be pretty the same with Text object. I manipulate the Sprite Font scale based on the text lenght. But I had to test it manually several times to find out the correct resizing ratio based on the text lenght. So you cannot check if text lenght is ok for your text box, but you can predict the resize you have to do on the fly.

  • Hi

    I assume every scene is a separate layout in your game. Every time player starts a scene you should save the scene name in the local storage. Then once you turn on the game again you can load layout by name which you can find under "System" functions.

    Regarding using local storage itself it is very easy and for your needs it will be only setting and reading the value which you can do with "Set item" and "Get item".

    Definitely the first step you should do is to read Local Storage manual.

    Good luck!

  • I am not very sure if I understand your problem, but I'll try to clear something out.

    If your forest is made with one tree, then you can use one sprite for everything. You can create a default animation as let's say "idle", and second animation of the same sprite for burning. Now it would be obviously resource saving to make forest by creating multiple instance of the same tree instead of using many different objects.

    If you have many different kind of trees then you might consider creating a separate sprite to imitate the fire which you could spawn on the particular trees. In such case you don't have to put butning animation in each tree sprite which will save some memory for sure.

    Anyway many objects/instances will cause performance drop - that's normal, so this is the first thing you should consider for optimisation. Next thing is the "weight" of the images you use for those sprites/animations. The rule is pretty simple, the more objects and sprite animation frames you have in your game the more memory and CPU resources it will take to load it up.

  • You cannot use directories/subdirectories to organize layers in C2, so putting everything in one layout is not a good idea - I totally agree with that and discourage to do this. That is simply not a good development practice. Another discouraging fact is that if you ever think of moving this game to mobile devices, too many objects in one layout would kill the mobile probably on the start.

    One of the most important thing in development is to correctly (also sematically if possible) organize your project elements. C2 gives us layout and layers for that and I recomment to use it.

    There is a delay while switching the layout - that is true - but this is totally normal, because all layout objects have to be loaded. It's not a C2 flaw - this is simply how it works everywhere. Check out other games, even the big ones like Diablo etc., everytime you swich between some distinct "screens" there is a loading screen and you have to wait. The faster PC/mobile you have the faster loading is, but it is there anyway.

    So don't try to workaround loading game elements by loading all of them at once because this is a bad practice and can kill weaker devices. Instead you should do the same thing as "the best devs" do for decades - use loading screens. Loading screen is not frustrating or anything like that. Players used to wait for game/screen to get loaded.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you have a static number of answers (and as I can see in your example there are always 4) then you can simply add 6th parameter which will determine which answer is correct.

  • Just below "<?php" put some output information, for example "die('here I am');". Than check if C2 AJAX.LastData holds this value. You can use Browser -> Alert (AJAX.LastData). This will tell you if you are calling a good address. You can do the same with parameters like "die($_GET['login']))" etc. to check if values comes to PHP succesfully.

  • Glad I could help. Don't forget to show us this game when you're done!

  • You may also want to pick the instance by the "instanceName" which can be a generated text. I have explained that here scirra.com/forum/how-to-quot-construct-quot-an-object-name-using-variables_t152556