PixelRebirth's Forum Posts

  • you mentioned that the games have to run on both desktop and mobile devices, but how do they decide if a game can run on mobile devices? There a lot of mobile devices with different hardware specs. Some devices will run a game smoothly and others will lag and might not even run the game at all.

    Usually publishers have a QA department and will validate the game before finally paying the developer. They will likely test your game on the latest (or close) generation iPhone, iPad and Google Nexus.

    Of course there is no way you as a single developer can verify your game will work without any issues on every available device. Even a bigger company would struggle to achieve this 100% I imagine.

    Also I believe you can ignore performance problems with outdated devices. Noone will expect your HTML5 game to run great on some older Android Gingerbread smart device.

    Remember to support different aspect ratios and resolutions with your game. It's one of the most crucial things for mobile development. In many cases this can be achieved with the proper fullscreen option in Construct, if your game is properly designed at the same time.

    Still you obviously should have access to at least one Android or iOS device, ideally running the latest available version. Test your game there and you should be good.

    I use a Google Nexus 7 (1st generation) for my mobile testing. Had a few concerns from the QA before, but it's mostly stuff you can easily adjust. I admit it can get tricky (in my case) if the problem is solely iOS related, since I do not have access to such a device.

  • dhondon

    Nice idea! Thank you.

    PixelRebirth

    I didn't get you. Does not layout properties allow us to select at most one event sheet at a time?

    Sorry about that then! From your original post I got the idea you weren't aware that you could indeed specify the event sheet for each layout, when in fact you were asking about having multiple sheets. Ignore what I wrote. <img src="smileys/smiley2.gif" border="0" align="middle" />

  • Congratulations first of all PixelPalette on having made money with your games! It's definitely a fullfilling experience when that finally starts to happen!<img src="smileys/smiley4.gif" border="0" align="middle" />

    What slightly confused me is that you mention those being non-exclusive deals, yet when viewing the contract there is the line "SPIL's right to distribute and transmit the Game shall be exclusive".

    Just for the information of anyone who wants to start monetizing his games, the following line is taken from Clay.io:

    "Try not to under-price your game. Typically HTML5 games (that work on mobile devices) go for $500-$1,000 per non-exclusive license."

    And my admittedly still fairly limited experience pretty much agrees with that statement. So I surely hope PixelPalette didn't sign an exclusive agreement here, since that should have definitely made him more money.

  • Just wanted to additionally mention: you do not necessarily need to have an extra event sheet for every layout. If you just wanted to use the same core event sheet in say every level layout, you can simply select that event sheet in the layout properties.

  • You do not have permission to view this post

  • it's just as simple without custom movement,

    crosshair | set x to self.x + Xaxis*speed*dt

    crosshair | set y to self.y + Yaxis*speed*dt

    Agreed. I'm merely suggesting custom movement for handier expansion of the movement, since the behavior provides useful expressions, conditions and actions. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • bilgekaan Basically there isn't really much difference between my version and yours.

    Apart from the things I mentioned I did also only allow the game itself to load when the API was ready. However this isn't even a requirement for this particular API, so you can neglect that part.

    I almost overlooked earlier that skyhunter93 used a local version of the API script file to go with the plugin. This might work fine, however in the API documentation it states that you should include the script from the provided URL.

    Technically this does not comply with the requirements of the API anymore. Maybe it won't matter after all. Skyhunter93 should know soon. <img src="smileys/smiley17.gif" border="0" align="middle" />

  • An easy way to control a sprite with the analog stick of a gamepad would be to add the custom movement behavior to the relevant object.

    Then set its horizontal speed according to the X axis of the right analog stick with the expression "Gamepad(0,2)" and the vertical speed according to the Y axis with "Gamepad(0,3)".

    These expressions return a range from -100 to 100, so you should multiply here with the maximum speed value of your object. Also dont forget delta time "dt"!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Executing strings with the Browser object is an ugly hack. If you want to do it properly, use the Javascript SDK.

    Can't say I'm that much into cosmetics. So I wouldn't really care if something was "ugly", as long as it worked of course. <img src="smileys/smiley1.gif" border="0" align="middle">

    But seriously it seems to me that making a plugin just to use one javascript method or two is a little bit of an overkill.

    Would you care to elaborate briefly why you deem it a bad idea to use the execute javascript action/ expression of the browser object? Are there possible issues people don't usually consider?

  • I'm making a example capx right now but in the meantime:

    Here's a little plugin I made:

    https://www.dropbox.com/s/nuf5zq2dv3jwtgt/spilgames.zip

    The only thing it does is adding the spilgames API to the index.html so you don't have to add it manually each time you export your project. It's a huge time saver.

    I talked with spilgames and they said that the ads are not showing right now because their API isn't complete right now and are testing things. So there is no way for us to test it right now. I suppose they use a local environment on their side to test the ads.

    Actually my implementation is pretty similar to the one bilgekaan did. but you are now seeing the ads because of what I said.

    Ah, so the ads don't show on localhost as I suspected. This leads me to believe that bilgekaan's implementation and mine would also work fine.

    If you're worried about having to alter the index.html each time, you could simply keep a second already altered index file around, called index2.html so it won't get overwritten.

    Just don't forget to use the altered one and rename it back to index.html when you're submitting your game.

    If that's still too inconvenient I believe the CallJS plugin has a property to set an external javascript file. So that could likely be used to include any script and you wouldn't need a custom plugin just to include a specific one.

    EDIT: If you use a plugin dependency to include a javascript file, the tag to include the file will not be placed in the head of the index.html file.

    This can become relevant, because some APIs demand that the script be included in the head tag of the html document. I had the case that my implementation got rejected simply because the reference to the script wasn't within the head tag.

    However the spilgames API documentation just recommends to put it in the head, so you should be fine in this case. I still thought I'd mention this odd thing. <img src="smileys/smiley12.gif" border="0" align="middle" />

  • You can also create a simple plugin with no functions. Which sole job is to insert the custom api into window.foo name space. Then he wouldn't even need to modify anything else. So why not that. Even makes it easier in the long run. Also some wrappers don't even use the index.html.

    I can't say he is using CJS, more than likely it's just for a web browser. But if say it were CJS. Then putting the modifcation in index.html would have no effect as index.html isn't being used.

    Ah, I see where you're coming from. I suppose you could also easily include an external js script by adding the CallJS plugin, which has a property to do so.

  • Hey PixelRebirth

    I have tried something like that >

    I added those in index.html

    <script type="text/javascript"

    src="http://cdn.gameplayer.io/api/js/game.js"></script> ( before </head>)

    and

    <script>

         //Spil Api

         GameAPI.loadAPI(function(API) {

    GameAPI.GameBreak.request(fnPause, fnResume);

    });

    var apiTry= 2;

    function fnPause()

    {

    var apiTry = 0;

    }

    function fnResume()

    {

    var apiTry = 1;

    }

    </script> (after <script src="c2runtime.js"></script> )

    Also I have added those in capx.

    <img src="http://new.tinygrab.com/bd08b53d3f72a32d77a05e99619f2c09321047a8e2.png" border="0" />

    After all there is no error in console and when I tried apiTry = 0 and apiTry=1 it works. But there is no ads or anything.

    Just wanted to mention that in your script you keep declaring the variable apiTry every time. Actually it should just say "apiTry=value;" when you want to change it again. You only have to put "var apiTry=value;" one time.

    Also I'm not sure if you just did this for testing purposes, but I noticed you put "GameAPI.GameBreak.request(fnPause, fnResume);" in the loadAPI method. Normally you should call this from within C2 whenever you want to show an ad and not when the API is readily loaded.

    I also made a similar test on my localhost and didn't get any javascript errors either. And no ad either. I observed that you only ever get the fnResume callback, never fnPause, but this might be because it was on localhost. Also the branding thing seems to return "0" every time.

    This might be because the game has to be on their platform servers to work. I've used a couple of APIs before and usually they have some sort of online testing environment, it wouldn't work locally. Some do have a special script for testing locally too, which is nice.

    I really don't know about spilgames. Registering with them as a developer just gives you access to flash related stuff. Including such an online tester.

    Probably just wait for what skyhunter93 will report. <img src="smileys/smiley4.gif" border="0" align="middle" />

  • c2runtime.js

    at the very top or bottom(before or after C2 closure) insert the API code chunk. Make sure it's part of the window.[foo name space]

    then in C2

    Browser.execJS( api.function_name )

    You will need to insert this custom JS code into the c2runtime every time.

    Any particular reason why you suggest to put the code in the runtime file?

    Having it in the index.html should work just as well. Also you simply could keep a separate index file in the export folder without the need to always inject the script anew after exporting.

  • Holy cow, I was actually already contacted earlier by skyhunter93, but I kind of forgot all about it. <img src="smileys/smiley9.gif" border="0" align="middle" />

    We had a brief exchange over Skype and he said he was about to realize the implementation himself. I hope he succeeded in the meantime and would be so kind to share his approach.

    I think the problem was with the request(fnPause, fnResume) method. You need to define the functions fnPause and fnResume yourself and have them pause and resume the C2 game.

    A way to do this would be to create these functions in an additional js file or in a script tag in the index.html itself. Make them simple functions that change a variable, also defined in the same js file/script.

    Now in Construct you can actually compare the value of this variable with the Browser.ExecJS() expression. Just put "variablename" there. And obviously use it in a Compare two values condition of the System object.

    I imagine that should work, keep asking if there's anything yet unclear.

    I do believe skyhunter93 was creating a plugin btw, which could be ready by now. Don't see him on Skype right now, but maybe he will come back to this thread.

  • Have received a PM about this API.

    From briefly looking at the documentation I think this should be indeed possible with execute javascript and a little editing of the index.html file.

    Will look further into it as soon as possible and let you know.