WackyToaster's Forum Posts

  • I personally use a finite state machine for this. Basically you have a global variable that changes depending on the current state of your app. In your case you have two states, the "normal" state and the "confirm_dialog" state. Once the confirm dialog shows you change the global variable to "confirm_dialog" and check the condition of the variable.

    http://gameprogrammingpatterns.com/stat ... the-rescue

  • I´d like to but no Paypal so far. But anyway, right now it´s basically an "Early Access" thing and I´m not a fan of such a concept (There are simply some inherent problems with it) Since Paypal is a few months down the road, I have to wait and until then and that´s fine. Right now C3 is just C2.5 because it still uses the C2 runtime, once the C3 runtime drops C3 will hopefully start to shine. I hope the C3 runtime comes out before Paypal. I will most likely switch because C3 has some stuff that I really like and I don´t mind the subscription model, not to mention I get 50% off the first year. It´s a no-brainer to at least try it for a year.

    EDIT: Since I saw a bunch of people mentioning it, I also have one bigger project in development that I cannot port because of 3rd-party-plugins and I defenitely wouldn´t port it into something this early in development anyway. But it would defenitely suffice for prototyping / fooling around with ideas, that is what I mostly do apart from said big project.

  • As I said, the default plugin doesn't work on mobile. The one I linked you does, as long as you use cordova for export. I personally would avoid any kind of login as long as it is not absolutely necessary! So just out of curiosity, why do you need the login?

  • I just tried reaching your file with ajax and it seems that it actually is CORS that blocks the access. Since you included it in the file it is potentially overridden by the server.

    You can try to upload a htaccess file. Write the stuff below into a textfile, rename it to ".htaccess" (without "") and drop it next to your php files. Or ask the hoster. For testing, you can also disable the CORS in Chrome.

    <FilesMatch ".(php)">
    	Header set Access-Control-Allow-Origin "*"
    </FilesMatch>[/code:16q0ny3a]
    
    Or you can switch the hoster ofc  There´s some pretty cheap ones out there.
  • There is also mysprite.count that does that.

  • I think you have to use this plugin "rgbaAt(mouse.X,mouse.Y)"

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It´s hard to tell without seeing the source code. What error do you get? I work a lot with ajax and never had much of a problem with it. The only issue I had were CORS issues, that were relatively easy solved. I think that might be your problem. Try the following php code.

    <?php
    header('Access-Control-Allow-Origin: *');
    echo "Hi this is text";
    ?>[/code:37vdaafy]
    
    CORS means [i]Cross-origin resource sharing[/i]. Since C2 preview opens it´s own server that then tries to connect to your server, your server says "An outside connection... boy that might be harmful to allow access" and thus denies it. If you export your project as html and upload it on your webspace, it should work without defining the header, but from outside sources you have to specifically allow access.
    
    Please be aware that "header('Access-Control-Allow-Origin: *');" opens the access to the file up from any source outside your own server (* is the wildcard) and is not recommended. For testing it´s totally fine though. Instead of * you can also use any webadresses (including localhost and/or the ip of the construct preview)
  • Afaik the scirra facebook plugin does not work on mobile. You have to use a third-party-plugin. I think cranberry has one, I also used https://www.scirra.com/store/construct2 ... nnect-2650 with success.

  • Yes, you should add the health variable to the family. Then place your mages on the layout and change the health variable to whatever you want for each mage.

  • I assume you added the instance variables on the family. In this case, substract 5 from health does exactly what you need. Instance variables are for each instance of the family, not the whole family.

  • Let´s do it the easy way: tokenat!

    tokenat(str(number), 0, "")

    The number has to be converted to a string with 'str(1234)'

    If you have variable lenghts of numbers you probably want to make use of tokencount and loopindex.

    See: https://www.scirra.com/manual/126/system-expressions

  • Got to the boss, but gave up there because I couldn´t reach that last switch or the dynamite, no clue what I am supposed to do there. Be very careful about what and how you make your game hard. Make your game fun first, then make it hard. The line between hard and just plain annoying is very thin, and I think you crossed it into the annoying part.

    • Post link icon

    Waiting for paypal

  • I think you should be fine, as long as you keep some things in mind.

    • First of all... what is full-size? 480p? 720p? 1080p? Construct will scale the images up or down regardless of resolution, but the size you choose decides how big the image will be. It depends on what your main target resolution will be.
    • How many layouts do you plan to use? Because one layout = one more image.
    • Do NOT move these big background images. This costs a surprising amount of power. Move the viewport instead.

    I can only guess but if you go for 720p png images you should be able to go for ~1mb per layout. Also depends on how many colors you use (how good it compresses) or you could instead use jpg or gif (lower quality, lower size). Or you could load the images from a server. (Requires internet connection though)

  • [quote:2f3cp1ev] I have no idea what type of game you are making but that seems to me to be a bit overkill.

    I should have made it more clear that this is just an example, I don´t actually make a game right now, just an app. It was just exaggerated to show my thought behind it, that the event system will go through all other events even if they are not in the layout, before getting to the one event that matters, thus eating performance for nothing.

    [quote:2f3cp1ev]what I've learned in my experiences is that ESPECIALLY if there are no instances of the enemies - it will consistently run all code checks pertaining to the non-present enemies.

    What I do is create a spawner for each enemy, and at the start of a layout I check if the spawner exists. If it does, I enable the group for the enemy code and create the enemy per each spawner. If it doesn't exist it disables the group.

    Sounds like a good and easy approach to me. Not having to think about all the includes would make it even easier.